[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201003075514.32935-6-haifeng.zhao@intel.com>
Date: Sat, 3 Oct 2020 03:55:14 -0400
From: Ethan Zhao <haifeng.zhao@...el.com>
To: bhelgaas@...gle.com, oohall@...il.com, ruscur@...sell.cc,
lukas@...ner.de, andriy.shevchenko@...ux.intel.com,
stuart.w.hayes@...il.com, mr.nuke.me@...il.com,
mika.westerberg@...ux.intel.com
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
ashok.raj@...ux.intel.com, sathyanarayanan.kuppuswamy@...el.com,
xerces.zhao@...il.com, Ethan Zhao <haifeng.zhao@...el.com>
Subject: [PATCH v7 5/5] PCI/ERR: don't mix io state not changed and no driver together
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 <haifeng.zhao@...el.com>
Tested-by: Wen Jin <wen.jin@...el.com>
Tested-by: Shanshan Zhang <ShanshanX.Zhang@...el.com>
---
Chagnes:
v2: no change.
v3: no change.
v4: no change.
v5: no change.
v6: no change.
v7: change debug output information.
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
Powered by blists - more mailing lists