Skip to content

Commit c3a910e

Browse files
emuslndavem330
authored andcommitted
ionic: fill out pci error handlers
Set up the pci_error_handlers error_detected and resume to be useful in handling AER events. If the error detected is pci_channel_io_frozen we set up to do an FLR at the end of the AER handling - this tends to clear things up well enough that traffic can continue. Else, let the AER/PCI machinery do what is needed for the less serious errors seen. Signed-off-by: Shannon Nelson <[email protected]> Reviewed-by: Brett Creeley <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ce66172 commit c3a910e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,35 @@ static void ionic_reset_done(struct pci_dev *pdev)
469469
__func__, err ? "failed" : "done");
470470
}
471471

472+
static pci_ers_result_t ionic_pci_error_detected(struct pci_dev *pdev,
473+
pci_channel_state_t error)
474+
{
475+
if (error == pci_channel_io_frozen) {
476+
ionic_reset_prepare(pdev);
477+
return PCI_ERS_RESULT_NEED_RESET;
478+
}
479+
480+
return PCI_ERS_RESULT_NONE;
481+
}
482+
483+
static void ionic_pci_error_resume(struct pci_dev *pdev)
484+
{
485+
struct ionic *ionic = pci_get_drvdata(pdev);
486+
struct ionic_lif *lif = ionic->lif;
487+
488+
if (lif && test_bit(IONIC_LIF_F_FW_RESET, lif->state))
489+
pci_reset_function_locked(pdev);
490+
}
491+
472492
static const struct pci_error_handlers ionic_err_handler = {
473493
/* FLR handling */
474494
.reset_prepare = ionic_reset_prepare,
475495
.reset_done = ionic_reset_done,
496+
497+
/* PCI bus error detected on this device */
498+
.error_detected = ionic_pci_error_detected,
499+
.resume = ionic_pci_error_resume,
500+
476501
};
477502

478503
static struct pci_driver ionic_driver = {

0 commit comments

Comments
 (0)