Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1885543pxk; Sat, 3 Oct 2020 00:59:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdZh8yRa5g7cDkSIODV7MCW3Is4BbyHsd/VHEKvqUARE7a1nAQs9FPsPOgoftbu8s2huE6 X-Received: by 2002:aa7:cc02:: with SMTP id q2mr6750197edt.196.1601711949127; Sat, 03 Oct 2020 00:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601711949; cv=none; d=google.com; s=arc-20160816; b=gZ8VP5yBBtltvpYkvcmjnTwbJqT7XZntUgH6mB5xt3G5pwqjTGQAZtbQG1EmnsPRG5 4uSHjhnpi4eOo+FVC1VRElOSP5ps8gUYMhEsM0xS/ixUH5Q2buv3SCkGnLvTFp8GpyG4 iC+RTdoJu84HNkTRFTds6CFpOvp1mZ6co0kpJ4l01bwg7UWvTS9Jic8D3mIIXoybrl30 MU59fjJPJ76ZfW1dCV60INM8odYltZBtYDA2+7s7r+47o8ltG8zdSriPCrcP3E6w66hB FZRU7dD2TEAVpNvZOL3zhTmSpw2KddmPG9Cz8zH4bQAMKaIqgnqP7EH4SVDz1rSw5Owu etiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=9jxaq35suEUV3Xu5gaz0ZiwMh1I9Dloj8RGw/YlkcHo=; b=glZl24gfoFiIlHK2ZwS3M1xm5Q4wnRdVQv1rczDwDf5oqczGsq1zfkBQgpeVvl+teC YhvhVysT4nLEZu+JXTQ9vpe2yAyd/ouoroN+6dEdgPUEhXkav0ikDppblMSEOgA46bVd OmZ01zvhQ0zvonVk95rWi9tuR1RGtuVDvL5SQd3k6qeva/bIZh8o+eDiXz492XxXkPP9 iy3mRmoHEOkhTZmrWZmavzzrqndz5y/GHk3dIC/USYgU2RKB1GgAKP6QZP4X/4rg7UnZ 0nnYh4kY+xTCXUOedOZdQWVrw1AbontZ74glkW0qOiqD5JXgNldbDLyKR/orzI+KP327 qslQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw7si2667377ejb.711.2020.10.03.00.58.47; Sat, 03 Oct 2020 00:59:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725842AbgJCH5G (ORCPT + 99 others); Sat, 3 Oct 2020 03:57:06 -0400 Received: from mga14.intel.com ([192.55.52.115]:3728 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbgJCH5D (ORCPT ); Sat, 3 Oct 2020 03:57:03 -0400 IronPort-SDR: ICyQvsFGqdn/6lqHKGEXNFWGNZj4G3mu0Srd03+TJPfHov83nLn0ZJOh0KbarwZAZh3dR9uV3X TUbOkvNTgXCQ== X-IronPort-AV: E=McAfee;i="6000,8403,9762"; a="162410477" X-IronPort-AV: E=Sophos;i="5.77,330,1596524400"; d="scan'208";a="162410477" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2020 00:56:58 -0700 IronPort-SDR: f+jl3Z5P5AhJ8KVZm1r63Prpnfw3PrvBdNAU8WdU7PpY4nXUSFXj7JVk4gxAiJYRpxiVMcSn5z +eJIs13XiLSw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,330,1596524400"; d="scan'208";a="513063244" Received: from shskylake.sh.intel.com ([10.239.48.137]) by orsmga005.jf.intel.com with ESMTP; 03 Oct 2020 00:56:53 -0700 From: Ethan Zhao To: bhelgaas@google.com, oohall@gmail.com, ruscur@russell.cc, lukas@wunner.de, andriy.shevchenko@linux.intel.com, stuart.w.hayes@gmail.com, mr.nuke.me@gmail.com, mika.westerberg@linux.intel.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, ashok.raj@linux.intel.com, sathyanarayanan.kuppuswamy@intel.com, xerces.zhao@gmail.com, Ethan Zhao Subject: [PATCH v7 5/5] PCI/ERR: don't mix io state not changed and no driver together Date: Sat, 3 Oct 2020 03:55:14 -0400 Message-Id: <20201003075514.32935-6-haifeng.zhao@intel.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20201003075514.32935-1-haifeng.zhao@intel.com> References: <20201003075514.32935-1-haifeng.zhao@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When we see 'can't recover (no error_detected callback)' on console, Maybe the reason is io state is not changed by calling pci_dev_set_io_state(), that is confused. fix it. Signed-off-by: Ethan Zhao Tested-by: Wen Jin Tested-by: Shanshan Zhang --- Chagnes: v2: no change. v3: no change. v4: no change. v5: no change. v6: no change. v7: change debug output information. drivers/pci/pcie/err.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index e35c4480c86b..2ca2723f3b34 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -55,8 +55,10 @@ static int report_error_detected(struct pci_dev *dev, if (!pci_dev_get(dev)) return 0; device_lock(&dev->dev); - if (!pci_dev_set_io_state(dev, state) || - !dev->driver || + if (!pci_dev_set_io_state(dev, state)) { + pci_dbg(dev, "Device was in that state or not allowed setting.\n"); + vote = PCI_ERS_RESULT_NONE; + } else if (!dev->driver || !dev->driver->err_handler || !dev->driver->err_handler->error_detected) { /* -- 2.18.4