Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp782058pxk; Thu, 24 Sep 2020 19:42:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHfkE2rXT/a/46RVyGeMHJrsCwxC7pMdUr9G3/6xiXwdGIU37o/V3P4FBXUr/5tmEYlZcM X-Received: by 2002:a17:906:1644:: with SMTP id n4mr653778ejd.332.1601001729380; Thu, 24 Sep 2020 19:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601001729; cv=none; d=google.com; s=arc-20160816; b=JHpv5s1JnUKzXkDVxfNnz3L6QXbBWFdqSx0V/+w5GmgHLEEDaaNuADZm/PBnJpIWJo y845Vk/Zv3UxtSqFQv2YzbLEhux4XkKfo/i2AOxyjdqj9J7FdF/GiEUofgRNDdPr+i1P Nfs8Vj9JjibNdKmNT9X7aJlhcyrlbJPP68M+jDbxABcr/V5Rb6EBgApFi6lk9ZygxIw3 41nEDEgBKp0cJGv0ail6w1a6ato4zX2jzbXMNGjqVgd/OTcYyz72wZA61Z/WmJrFsIFD fvFGWBz2dn4ZRXy9C4cyD2YH/c/Y/3I1cBEmJNE0YI8yXD82PHFfD2boDp9nWdYIwXK1 HYgA== 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=DnOynbnupT8QhUU+/+uM8ik9KEas+rwUECZloCaEev0=; b=ryPSMRc8TeBJjYsRJqMKmWVXBQOoaS9ZTQ00mvlrrO08zmFuUMC5nIY2YLZR/mGyL4 MyNpWn5VokqMcUBM1lyNNBqID/EOhy69tzFxP9nyMZV1fl0LJo974DUTMKqjf15tBD8w y5TjYxycusxvL/7jL69aJlRNmDruUkC2ziNdfb71Xpvdi4aEgSPyrlTFzxtCwlBJDJAm 0fGLsVCH3SorRUTnglkjz6s6oiq6B7B/QHAnUBcprH+iH26xufM+/suS4Xk7OtBXJoTv HUbO5uAIjfqxZCMXO9r+sNoSGuagp5yBMtrwQFgkDRbYRFX8l/w13WhiOpPP5H5P5MRU /7wQ== 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 v26si933143eja.287.2020.09.24.19.41.45; Thu, 24 Sep 2020 19:42: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 S1726843AbgIYCku (ORCPT + 99 others); Thu, 24 Sep 2020 22:40:50 -0400 Received: from mga17.intel.com ([192.55.52.151]:60724 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726676AbgIYCku (ORCPT ); Thu, 24 Sep 2020 22:40:50 -0400 IronPort-SDR: gGhkLgHy7JwBe9rH1gVdYeuhZRWP9RzTPzH1850yXJTsGLwmuphn+C6xGBksPaMR3DEOo1pKxf W0gJdkpOyrMA== X-IronPort-AV: E=McAfee;i="6000,8403,9754"; a="141431851" X-IronPort-AV: E=Sophos;i="5.77,300,1596524400"; d="scan'208";a="141431851" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2020 19:36:01 -0700 IronPort-SDR: ufkFF0YDpCuSDDBlyTqSVBAAm7yWx6S9ZOhe0VJvulU99hgn3Gmvwk1LGM9R8HGeeRxsn3QZ2R 2H5ENX9XXrDg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,300,1596524400"; d="scan'208";a="512515344" Received: from shskylake.sh.intel.com ([10.239.48.137]) by fmsmga005.fm.intel.com with ESMTP; 24 Sep 2020 19:35:58 -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, Ethan Zhao Subject: [PATCH 5/5] PCI/ERR: don't mix io state not changed and no driver together Date: Thu, 24 Sep 2020 22:34:23 -0400 Message-Id: <20200925023423.42675-6-haifeng.zhao@intel.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20200925023423.42675-1-haifeng.zhao@intel.com> References: <20200925023423.42675-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 --- 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