e1000e: Fix check_for_link return value with autoneg off
authorBenjamin Poirier <bpoirier@suse.com>
Tue, 20 Feb 2018 06:12:00 +0000 (15:12 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:38:16 +0000 (08:38 +0200)
commit 4e7dc08e57c95673d2edaba8983c3de4dd1f65f5 upstream.

When autoneg is off, the .check_for_link callback functions clear the
get_link_status flag and systematically return a "pseudo-error". This means
that the link is not detected as up until the next execution of the
e1000_watchdog_task() 2 seconds later.

Fixes: 19110cfbb34d ("e1000e: Separate signaling for link check/link up")
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Acked-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/e1000e/ich8lan.c
drivers/net/ethernet/intel/e1000e/mac.c

index 1dddfb7b2de6c988c9686e82c49d8081f91d5f31..00eedf202e62da10eec8ecf310fa1f689aaa0e57 100644 (file)
@@ -1598,7 +1598,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
         * we have already determined whether we have link or not.
         */
        if (!mac->autoneg)
-               return -E1000_ERR_CONFIG;
+               return 1;
 
        /* Auto-Neg is enabled.  Auto Speed Detection takes care
         * of MAC speed/duplex configuration.  So we only need to
index 5bdc3a2d4fd70aed476c8c0f17c180570b9eafb2..48cc945fc8b0f96e62d5066ba63b136718ce73d7 100644 (file)
@@ -443,7 +443,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
         * we have already determined whether we have link or not.
         */
        if (!mac->autoneg)
-               return -E1000_ERR_CONFIG;
+               return 1;
 
        /* Auto-Neg is enabled.  Auto Speed Detection takes care
         * of MAC speed/duplex configuration.  So we only need to