Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2277194pxk; Sun, 27 Sep 2020 01:31:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpFM2md4PKr7OQumlAMrABNkwFm8M3mQFVjXucvNmbPP+UtPL917WKAheHL4J5X7FqF7Ye X-Received: by 2002:a17:906:70d4:: with SMTP id g20mr10932943ejk.413.1601195514521; Sun, 27 Sep 2020 01:31:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601195514; cv=none; d=google.com; s=arc-20160816; b=iUmguVaVAWDG0Pv+Q8+88QM7qdYlPO5RLqS5n/aPUx1rT91oVGhtFaR9lzl8Nku1K0 tEuRYbAxl9eneiE2TLZCi9v0YarnmWDrCdeTHbr67rmtDGG6NAfQUoPQEfBlavZR2viz /zbHPMIfyRRUOyxc881uuzHECBqizb1XYbbgmGa6iBAVimpVvIsJfXf7kjvZ6n4dQGz6 osvI7/RsoDr0kXfr6iCP4zpCK0NwQQYM6/UIgnYxQpsPEhkzTKIBpi9Qdd4vFgfUvrmR q7gA1Glg2mcjE8VobqVTWlV9FYJIL3R+lnOugWzsifkzUCSAQ5MMInJXViz3GM9txmaY uqDQ== 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=tPRn9Bkv1/FPCJFfPmgfNdH03b0F1aeecAHRQq0VUIw=; b=U2/8OIkUXEVliIYOY0whiZEca62I03eskaLDhxQeTMhiBsvAEX8HOobAoB0AEUeCv+ ZVfe7cHTk2P4K4SctnjYjtqh5Afo0Iq6aGukDZkTHcm5s5QV4I9uTU1iHlTtLZXJ+EW3 UDZacyjRn3o5eoPoAMbcDXHUT8ByEOqgkiGdAWCIb5fSuvioW3p6qvPnlpFSijO6q44s qV1/6tcuUs7o2F7fvB6wgwBABz4VFZbC2tpfTnCVYxLi9tFlezwkoDFnc9gimy+Q0KFw nliew7SdCfslFY701xLcxIrv09SmEPQF5JEZqbtET7Jodf1z+fyVNmsamtc82KFCL7KC shHw== 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 dn20si5480070ejc.342.2020.09.27.01.31.32; Sun, 27 Sep 2020 01:31:54 -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 S1730612AbgI0I3j (ORCPT + 99 others); Sun, 27 Sep 2020 04:29:39 -0400 Received: from mga03.intel.com ([134.134.136.65]:31488 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730585AbgI0I3e (ORCPT ); Sun, 27 Sep 2020 04:29:34 -0400 IronPort-SDR: aGacv/YwZE/Wi8/iVAOjDn78s9ds72acb2CKU/qDFzAo+Ejj3lqhIA9BgJRksyI0FDUm+AXbce j2lOjmDHl1ow== X-IronPort-AV: E=McAfee;i="6000,8403,9756"; a="161912226" X-IronPort-AV: E=Sophos;i="5.77,309,1596524400"; d="scan'208";a="161912226" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2020 01:29:34 -0700 IronPort-SDR: 40aHObQAnplGBnYqAfIAN3SuQU5CaBFREZ3wHS83PY0KCkuXEjpQpS4wrnGDOrMkuUmwO3uFOe fXFa5J8+3/Iw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,309,1596524400"; d="scan'208";a="456437758" Received: from shskylake.sh.intel.com ([10.239.48.137]) by orsmga004.jf.intel.com with ESMTP; 27 Sep 2020 01:29:30 -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, pei.p.jia@intel.com, ashok.raj@linux.intel.com, sathyanarayanan.kuppuswamy@intel.com, hch@infradead.org, joe@perches.com, Ethan Zhao Subject: [PATCH 5/5 V4] PCI/ERR: don't mix io state not changed and no driver together Date: Sun, 27 Sep 2020 04:27:36 -0400 Message-Id: <20200927082736.14633-6-haifeng.zhao@intel.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20200927082736.14633-1-haifeng.zhao@intel.com> References: <20200927082736.14633-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. 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..d85f27c90c26 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 might already being in error handling ...\n"); + vote = PCI_ERS_RESULT_NONE; + } else if (!dev->driver || !dev->driver->err_handler || !dev->driver->err_handler->error_detected) { /* -- 2.18.4