Skip to content

Commit 19b7960

Browse files
atbrady-intelJeff Kirsher
authored andcommitted
i40e: implement split PCI error reset handler
This patch implements the PCI error handler reset_prepare and reset_done. This allows us to handle function level reset. Without this patch we are unable to perform and recover from an FLR correctly and this will cause VFs to be unable to recover from an FLR on the PF. Signed-off-by: Alan Brady <alan.brady@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 013df59 commit 19b7960

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12045,6 +12045,28 @@ static pci_ers_result_t i40e_pci_error_slot_reset(struct pci_dev *pdev)
1204512045
return result;
1204612046
}
1204712047

12048+
/**
12049+
* i40e_pci_error_reset_prepare - prepare device driver for pci reset
12050+
* @pdev: PCI device information struct
12051+
*/
12052+
static void i40e_pci_error_reset_prepare(struct pci_dev *pdev)
12053+
{
12054+
struct i40e_pf *pf = pci_get_drvdata(pdev);
12055+
12056+
i40e_prep_for_reset(pf, false);
12057+
}
12058+
12059+
/**
12060+
* i40e_pci_error_reset_done - pci reset done, device driver reset can begin
12061+
* @pdev: PCI device information struct
12062+
*/
12063+
static void i40e_pci_error_reset_done(struct pci_dev *pdev)
12064+
{
12065+
struct i40e_pf *pf = pci_get_drvdata(pdev);
12066+
12067+
i40e_reset_and_rebuild(pf, false, false);
12068+
}
12069+
1204812070
/**
1204912071
* i40e_pci_error_resume - restart operations after PCI error recovery
1205012072
* @pdev: PCI device information struct
@@ -12235,6 +12257,8 @@ static int i40e_resume(struct device *dev)
1223512257
static const struct pci_error_handlers i40e_err_handler = {
1223612258
.error_detected = i40e_pci_error_detected,
1223712259
.slot_reset = i40e_pci_error_slot_reset,
12260+
.reset_prepare = i40e_pci_error_reset_prepare,
12261+
.reset_done = i40e_pci_error_reset_done,
1223812262
.resume = i40e_pci_error_resume,
1223912263
};
1224012264

0 commit comments

Comments
 (0)