Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2211427pxk; Sat, 26 Sep 2020 22:33:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSmDxOGGSj/QY19rm5XLpRol+q09rGupKXDtCPkk5hrRUi0KZrM9Ac9N52QlfZybrpSk06 X-Received: by 2002:a17:906:48d6:: with SMTP id d22mr10225010ejt.462.1601184811426; Sat, 26 Sep 2020 22:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601184811; cv=none; d=google.com; s=arc-20160816; b=JmPKzz5Ju2QzQZyyfTlEnbgc8wgsZAb7SQB4chopL6SpZLFx5e2UeeBvb7QzFaL7nc LjggNTPqZuWZEOsA/jip6UhfJ01yTlSgyLbg8Ey7yyELoAq4WptuTx8wU4HRuIF/eutz 4ZSBFPUmF85rWFIe6NtaFKVYzccbfgB2taqZitZ9x00WN2pEa3XyDMzjfl4+D+E1bVf7 xnDqPe5ORA/RQOpq0iMo81TRNkSpM950ABmKxwUsa7JQGo3BCkzvg/XLSx3rgmm25UdI Qc5Dj8F02Wj35w4tjEn1nhWPjFe5MeYiWdawmAzn6fVkXhPnnxtMQWB6df+f2J184zaE 0U2A== 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=iDWsfUGhZl2sYuViPuaOQOkbO6abY1mCHz6gkFY6OMw=; b=tHrPQ6uJwkJMkKOmcc9fuGv1bfo+4TwrwbbkUH6UAFmgX+g63QgQmTk/f4KnenM2cG dmLkcAJGJWuxzLBOIAO9YmEUeH6hrd4iLwHR3dxXiq+AB8Mif8kMBMQH+tZ0Mq2rbPmf VU1b3+0rPdH1u0SDpjI/vn8b4e5+CmzE/yo6DkDZ0/RyhPRzZRRLD+SMyIXuBKC4pxiJ Tk4hhGagRYbhBBwkAt+yOEm9BBdfjrzsCs7oG7k7z5FdhEzi6mBvfp19JfANduck+mn0 2mYV8Oy8pwKOiTK4sMw/cBh1/M8VY9jIZQOp8MuJqGqB+Ii+mCb+6rYOPf0L4Q7d/ObC +CjQ== 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 lx3si5010672ejb.306.2020.09.26.22.33.08; Sat, 26 Sep 2020 22:33:31 -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 S1730330AbgI0Fak (ORCPT + 99 others); Sun, 27 Sep 2020 01:30:40 -0400 Received: from mga07.intel.com ([134.134.136.100]:23634 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730325AbgI0Fad (ORCPT ); Sun, 27 Sep 2020 01:30:33 -0400 IronPort-SDR: kz45VRzIvB/Yz+d0VE8vuWrubWlo/cubvB5VTu3F78PSblpVeaFqKhNvw+YFL55MOT0q9M2BxF ag5Yxxs3G8ow== X-IronPort-AV: E=McAfee;i="6000,8403,9756"; a="225993145" X-IronPort-AV: E=Sophos;i="5.77,308,1596524400"; d="scan'208";a="225993145" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2020 22:30:33 -0700 IronPort-SDR: wAmf8ckV5LcAVkHc6U//N7Z1GbAd4QYDLQ8AtknV2w5/bvFaeazLbdmuLnTb2+89YEZaZaBdkC yy7jwAlDxNgA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,308,1596524400"; d="scan'208";a="323909418" Received: from shskylake.sh.intel.com ([10.239.48.137]) by orsmga002.jf.intel.com with ESMTP; 26 Sep 2020 22:30:29 -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, Ethan Zhao Subject: [PATCH 5/5 V3] PCI/ERR: don't mix io state not changed and no driver together Date: Sun, 27 Sep 2020 01:28:41 -0400 Message-Id: <20200927052841.12629-6-haifeng.zhao@intel.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20200927052841.12629-1-haifeng.zhao@intel.com> References: <20200927052841.12629-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. 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