>From 1a49e453816dbab747788b87f9d03edc978cb50b Mon Sep 17 00:00:00 2001 From: "Guilherme G. Piccoli" Date: Tue, 7 Feb 2017 17:38:04 -0200 Subject: [PATCH] i40: force global reset on adapter probe Device might experience a bad state on probe time, making impossible to the function i40e_probe() to successfully complete. In these cases, for example we observed the following message in kernel log: [22.6397] i40e 0002:01:00.0: capability discovery failed, err OK aq_err I40E_AQ_RC_EMODE This patch forces a global reset to happen on driver probe to avoid the issue. Signed-off-by: Guilherme G. Piccoli --- drivers/net/ethernet/intel/i40e/i40e_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index ad4cf63..f686c4a 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -10928,7 +10928,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) static u16 pfs_found; u16 wol_nvm_bits; u16 link_status; - int err; + int err, globr_probe = 1; u32 val; u32 i; u8 set_fc_aq_fail; @@ -11009,6 +11009,11 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (debug < -1) pf->hw.debug_mask = debug; + if (globr_probe) { + i40e_do_reset_safe(pf, BIT(__I40E_GLOBAL_RESET_REQUESTED)); + globr_probe = 0; + } + /* do a special CORER for clearing PXE mode once at init */ if (hw->revision_id == 0 && (rd32(hw, I40E_GLLAN_RCTL_0) & I40E_GLLAN_RCTL_0_PXE_MODE_MASK)) { -- 2.7.4