Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79949e8b authored by Michael Chan's avatar Michael Chan Committed by Greg Kroah-Hartman
Browse files

bnxt_en: Improve AER slot reset.



[ Upstream commit bae361c54fb6ac6eba3b4762f49ce14beb73ef13 ]

Improve the slot reset sequence by disabling the device to prevent bad
DMAs if slot reset fails.  Return the proper result instead of always
PCI_ERS_RESULT_RECOVERED to the caller.

Fixes: 6316ea6d ("bnxt_en: Enable AER support.")
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7ddb6aa9
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -9300,8 +9300,11 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
		}
	}

	if (result != PCI_ERS_RESULT_RECOVERED && netif_running(netdev))
	if (result != PCI_ERS_RESULT_RECOVERED) {
		if (netif_running(netdev))
			dev_close(netdev);
		pci_disable_device(pdev);
	}

	rtnl_unlock();

@@ -9312,7 +9315,7 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
			 err); /* non-fatal, continue */
	}

	return PCI_ERS_RESULT_RECOVERED;
	return result;
}

/**