Skip to content

Commit

Permalink
PCI: Fix pci-e port driver slot_reset bad default return value
Browse files Browse the repository at this point in the history
When an upstream port reports an AER error to root port, kernel
starts error recovery procedures. The default return value of
function pcie_portdrv_slot_reset is PCI_ERS_RESULT_NONE. If all
port service drivers of the downstream port under the upstream
port have no slot_reset method in pci_error_handlers, AER recovery
would stop without resume. Below patch against 2.6.30-rc3 fixes it.

Signed-off-by: Zhang Yanmin <yanmin.zhang@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Zhang, Yanmin authored and Jesse Barnes committed May 5, 2009
1 parent f328ddc commit 029091d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions drivers/pci/pcie/aer/aerdrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ struct aer_broadcast_data {
static inline pci_ers_result_t merge_result(enum pci_ers_result orig,
enum pci_ers_result new)
{
if (new == PCI_ERS_RESULT_NONE)
return orig;

switch (orig) {
case PCI_ERS_RESULT_CAN_RECOVER:
case PCI_ERS_RESULT_RECOVERED:
Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/pcie/portdrv_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static int slot_reset_iter(struct device *device, void *data)

static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev)
{
pci_ers_result_t status = PCI_ERS_RESULT_NONE;
pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED;
int retval;

/* If fatal, restore cfg space for possible link reset at upstream */
Expand Down

0 comments on commit 029091d

Please sign in to comment.