Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i40e: Give link more time after setting flow control

Give link a little more time to come back up after setting flow control
before resetting. In the new NVMs it is taking longer for link to come back.
This causes the driver to attempt to reset the link, which then errors
because the firmware was already in the middle of a reset. Also, initialize
err to 0.

Change-ID: I1cc987a944e389d8909c262da5796f50722b4d6b
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jmyoungx@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Catherine Sullivan and committed by
Jeff Kirsher
7d62dac6 7aa67613

+7 -3
+7 -3
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
··· 630 630 bool link_up = hw_link_info->link_info & I40E_AQ_LINK_UP; 631 631 i40e_status status; 632 632 u8 aq_failures; 633 - int err; 633 + int err = 0; 634 634 635 635 if (vsi != pf->vsi[pf->lan_vsi]) 636 636 return -EOPNOTSUPP; ··· 683 683 err = -EAGAIN; 684 684 } 685 685 686 - if (!test_bit(__I40E_DOWN, &pf->state)) 687 - return i40e_nway_reset(netdev); 686 + if (!test_bit(__I40E_DOWN, &pf->state)) { 687 + /* Give it a little more time to try to come back */ 688 + msleep(75); 689 + if (!test_bit(__I40E_DOWN, &pf->state)) 690 + return i40e_nway_reset(netdev); 691 + } 688 692 689 693 return err; 690 694 }