Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4352028pxk; Wed, 30 Sep 2020 00:09:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxya8UGbXHK+XtjEvWlAO8lsvvrBbk/rIgZPIh4/Z5BO5XTVo6wso5aT9W4DCSKmO2b5Ebb X-Received: by 2002:a05:6402:1353:: with SMTP id y19mr1229478edw.71.1601449787784; Wed, 30 Sep 2020 00:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601449787; cv=none; d=google.com; s=arc-20160816; b=hKP20VACGpz8zFasxVsiKIN3RM2b0ShWEZDkVXwn5qcSUbbGOXjaNd0EUpryHVjm4W YQXJBwoWm/Wbs28MyTYRplvMHyRvCwQW5XHs3SDE0D+RF08kT683Q3FODWYLG2x3r4G8 a9MuaU8NkE6IlbPywTH+BSVqnDI3EN23pGqRLjwSjt1ZcE34xRfhfp5O5uy8mxqB6gYx zqmYziWmfAFEsEuNZg361WE3h0GGVanf+vnRr+H+j+lRYjqeqAGqMGSfe8zMg+08GLL5 BIQKDRHWeW1+tou5EAxnBXnTdFJlRBdOeiAuPLtb0bhoS9cniufhVedSw3Nm+sFxImFC 7NBQ== 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=r0e85gb1WyeaG9p/cnQTqAZeJbAraY7esTmB2JqDbIE=; b=TBtRdyCXzeSr9YSffKkrval3bxKu/i5oWXjUrpkHquFh0HkpNOc/JILDOgpbR8sAio +ivyCD/RDmvF03Rlm4pzxW9r5v2Fq6fMEVuMxLyRPuexQ2hfgkq0A4o8fACnY9Z3dbx4 CZ63dLmDVsjpN46kXDPjYpvGYE0VDO2mc4G5uEUc9Dbr1eL5ixxOlmzlzqxQYgskD1XY sNuaP1qt9PIxoy+vE/WRonXGP4pWTRrQz2FGBKVOLW5scik8yqZi0W3bkG0GLDufR5cj gg/nMgXJWZliIVftbkeVLTkMYL5Ch+je1EHQ658I+KE550hk6BiMVmRkUDXCyH0lkKkb Gjow== 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 h19si481801edq.571.2020.09.30.00.09.25; Wed, 30 Sep 2020 00:09:47 -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 S1728380AbgI3HHu (ORCPT + 99 others); Wed, 30 Sep 2020 03:07:50 -0400 Received: from mga07.intel.com ([134.134.136.100]:34497 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728348AbgI3HHq (ORCPT ); Wed, 30 Sep 2020 03:07:46 -0400 IronPort-SDR: rsS3GsyM1bnnCY4F3Qk/IoieBUhwjGw8jUkrwYZJALxACMWOfzxXcKeQBCRBwBmrTOhKknsXJ+ PeZVSBohV6yw== X-IronPort-AV: E=McAfee;i="6000,8403,9759"; a="226533047" X-IronPort-AV: E=Sophos;i="5.77,321,1596524400"; d="scan'208";a="226533047" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2020 00:07:45 -0700 IronPort-SDR: LiERPO1+tll/6J6HuXgQ4AgKdFukn06B4YZvMthJCs/89/8F1HXQO7OxhlkPgRmGLEsxatbt9q 9vTQ3RfH6zMw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,321,1596524400"; d="scan'208";a="496014288" Received: from shskylake.sh.intel.com ([10.239.48.137]) by orsmga005.jf.intel.com with ESMTP; 30 Sep 2020 00:07:42 -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 v6 5/5] PCI/ERR: don't mix io state not changed and no driver together Date: Wed, 30 Sep 2020 03:05:37 -0400 Message-Id: <20200930070537.30982-6-haifeng.zhao@intel.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20200930070537.30982-1-haifeng.zhao@intel.com> References: <20200930070537.30982-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. 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