Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp336355pxu; Wed, 7 Oct 2020 04:36:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrWBOLiSqgd4TJ+b1iKG8ocqQQMVWn2PP/wuMNd32lG3yPXmY3lsWIY8AIqj5ArDr69clp X-Received: by 2002:a17:906:9153:: with SMTP id y19mr2833004ejw.475.1602070583736; Wed, 07 Oct 2020 04:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602070583; cv=none; d=google.com; s=arc-20160816; b=bL/12FcJCaRGHe1rSrazgSL20a82n9Lm2rb1gTV6+93Uxb4BumBbtn5en3tz2/SXzn lJze2nC/im7V5C4fdqp3Th8zcyNeUDnTj8aPa2u5dHOnlp4AlF8cLOCt9/3xWahirtU9 RiAA0G0TyrhoZUFQTMezEsQLh/OSDyrVNhaNw9Dv2iAyvY8C/WxFBz9nxhr4MCv41Rn1 +EY+8yCuj+oWcN0dcRk+jkL4cEQTIDhOAuIjlw+MZy0qJ04bLTgr9yki1RW4yrEqtLR5 NJKvZtMRmCPx4wkcbJrB20KMXCsE7z394QCSYMlrIJ+k2/qmGON1S5DSCzMuhWjpkbdX zaag== 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=ss5fJnRd/Y3jXnohZc76m38WX1Jg8Ex4oxSblsMQGC4=; b=fx4olOEXDeEG5T8lbwLE9NtnAjqrlVZ27HaOVc0AQcTT+Nyraot5Q3OCCfOagP5+FZ rbzBrEulh+A/+zciLr4Aa2ULWyazDRoLMGgd9TP+tlPS8+t5QoHu2cV2nK9mmcCfuovb nIfZszbAHHA/tNa41101tdNtOlXdaaMcvp79nSM4tDRprFQShxEDmqaoPmkL8cdArzTS KuWhM6h7TuP3GJ3XYv7Wik+cpNlLplkZB6Tn+I8xx/01kjNf1sDYNuVxYwUR1iZP2vLl pbQ5A/W4et52VV69AE0A6NtBPx+g8m9tzfpQ7/jBQqQxTpE5pYiINtKQykaCCwgG1itB VmSg== 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 pg3si1447773ejb.685.2020.10.07.04.36.01; Wed, 07 Oct 2020 04:36:23 -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 S1727949AbgJGLeK (ORCPT + 99 others); Wed, 7 Oct 2020 07:34:10 -0400 Received: from mga06.intel.com ([134.134.136.31]:24771 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727792AbgJGLdt (ORCPT ); Wed, 7 Oct 2020 07:33:49 -0400 IronPort-SDR: FKX8RpaFiJnnC9mekK5tAtiyYqTVbhVnfJJGpj5KcmwPvz4Y3uBG+mxJGG1thoaHHp3zwGpDiN VGWNoetE/pmQ== X-IronPort-AV: E=McAfee;i="6000,8403,9766"; a="226492589" X-IronPort-AV: E=Sophos;i="5.77,346,1596524400"; d="scan'208";a="226492589" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 04:33:48 -0700 IronPort-SDR: 7KLHxxLDY6xmAzbLRIFPSBEx6TDN7qXbBiWSdczuzYGDVSX6Fn3qttxZ+0p04sYkbFSWJlkyqW qFakeqtkFOfA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,346,1596524400"; d="scan'208";a="354862200" Received: from shskylake.sh.intel.com ([10.239.48.137]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2020 04:33:45 -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 v8 6/6] PCI/ERR: don't mix io state not changed and no driver together Date: Wed, 7 Oct 2020 07:31:58 -0400 Message-Id: <20201007113158.48933-7-haifeng.zhao@intel.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20201007113158.48933-1-haifeng.zhao@intel.com> References: <20201007113158.48933-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. v8: 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..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