[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <F7B8FD780A346D46A0042F5C63B06AE785E3B2@SHSMSX102.ccr.corp.intel.com>
Date: Fri, 26 Apr 2013 06:28:59 +0000
From: "Zhang, LongX" <longx.zhang@...el.com>
To: "linasvepstas@...il.com" <linasvepstas@...il.com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "yanmin_zhang@...ux.intel.com" <yanmin_zhang@...ux.intel.com>,
"Joseph.Liu@...lex.Com" <Joseph.Liu@...lex.Com>
Subject: Subject : [ PATCH ]
pci-reset-error_state-to-pci_channel_io_normal-at-report_slot_reset
From: Zhang Long <longx.zhang@...el.com>
Specific pci device drivers might have many functions to call
pci_channel_offline to check device states. When slot_reset happens,
drivers' slot_reset callback might call such functions and eventually
abort the reset.
The patch resets pdev->error_state to pci_channel_io_normal at
the begining of report_slot_reset.
Thank Liu Joseph for pointing it out.
Signed-off-by: Zhang Yanmin <yanmin_zhang@...ux.intel.com>
Signed-off-by: Zhang Long <longx.zhang@...el.com>
---
drivers/pci/pcie/aer/aerdrv_core.c | 1 +
drivers/pci/pcie/portdrv_pci.c | 12 +++++-------
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
index 564d97f..c61fd44 100644
--- a/drivers/pci/pcie/aer/aerdrv_core.c
+++ b/drivers/pci/pcie/aer/aerdrv_core.c
@@ -286,6 +286,7 @@ static int report_slot_reset(struct pci_dev *dev, void *data)
result_data = (struct aer_broadcast_data *) data;
device_lock(&dev->dev);
+ dev->error_state = pci_channel_io_normal;
if (!dev->driver ||
!dev->driver->err_handler ||
!dev->driver->err_handler->slot_reset)
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index ed4d094..7abefd9 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -332,13 +332,11 @@ static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev)
pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED;
int retval;
- /* If fatal, restore cfg space for possible link reset at upstream */
- if (dev->error_state == pci_channel_io_frozen) {
- dev->state_saved = true;
- pci_restore_state(dev);
- pcie_portdrv_restore_config(dev);
- pci_enable_pcie_error_reporting(dev);
- }
+ /* restore cfg space for possible link reset at upstream */
+ dev->state_saved = true;
+ pci_restore_state(dev);
+ pcie_portdrv_restore_config(dev);
+ pci_enable_pcie_error_reporting(dev);
/* get true return value from &status */
retval = device_for_each_child(&dev->dev, &status, slot_reset_iter);
--
1.7.4.1
Download attachment "
"0001-pci-reset-error_state-to-pci_channel_io_normal-at-report_slot_reset.patch"" of type "application/octet-stream" (2283 bytes)
Powered by blists - more mailing lists