ixgbe: Correct spec violations by waiting after reset
authorMark Rustad <mark.d.rustad@intel.com>
Tue, 27 Oct 2015 20:23:14 +0000 (13:23 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 3 Dec 2015 10:32:12 +0000 (02:32 -0800)
The ixgbe driver was violating the specification in the datasheet
by not waiting 1ms before checking for the reset bit clearing. This
is called out for devices supported by ixgbe, so implement the
required delay.

Reported-by: Dan Streetman <dan.streetman@canonical.com>
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Darin Miller <darin.j.miller@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

index 65db69b862fb9d8ce87299b641b3615b5b472a0a..8f09d291a0430a0260cda90da03a300d5ffd7116 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel 10 Gigabit PCI Express Linux driver
-  Copyright(c) 1999 - 2014 Intel Corporation.
+  Copyright(c) 1999 - 2015 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
@@ -765,13 +765,14 @@ mac_reset_top:
        ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL) | IXGBE_CTRL_RST;
        IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
        IXGBE_WRITE_FLUSH(hw);
+       usleep_range(1000, 1200);
 
        /* Poll for reset bit to self-clear indicating reset is complete */
        for (i = 0; i < 10; i++) {
-               udelay(1);
                ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
                if (!(ctrl & IXGBE_CTRL_RST))
                        break;
+               udelay(1);
        }
        if (ctrl & IXGBE_CTRL_RST) {
                status = IXGBE_ERR_RESET_FAILED;
index a39afcf03e2c4a84fb6e6aea7960c47a3d589528..b8bd72589f729452a64ec739f50f6a7c5c2952d9 100644 (file)
@@ -990,13 +990,14 @@ mac_reset_top:
        ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
        IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
        IXGBE_WRITE_FLUSH(hw);
+       usleep_range(1000, 1200);
 
        /* Poll for reset bit to self-clear indicating reset is complete */
        for (i = 0; i < 10; i++) {
-               udelay(1);
                ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
                if (!(ctrl & IXGBE_CTRL_RST_MASK))
                        break;
+               udelay(1);
        }
 
        if (ctrl & IXGBE_CTRL_RST_MASK) {
index c1d4584f6469df00e9b12d9254f6c2e17bd1070f..b9e9b0c173988c544841f4b6a04f0104098f0ad0 100644 (file)
@@ -110,13 +110,14 @@ mac_reset_top:
        ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
        IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
        IXGBE_WRITE_FLUSH(hw);
+       usleep_range(1000, 1200);
 
        /* Poll for reset bit to self-clear indicating reset is complete */
        for (i = 0; i < 10; i++) {
-               udelay(1);
                ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
                if (!(ctrl & IXGBE_CTRL_RST_MASK))
                        break;
+               udelay(1);
        }
 
        if (ctrl & IXGBE_CTRL_RST_MASK) {
index b8ad3f212e726cb29270c4ef518b7bae31e220b5..f4ef0d1a5dbea384f3d7aa1cbf493a0943661bfa 100644 (file)
@@ -2146,13 +2146,14 @@ mac_reset_top:
        ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
        IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
        IXGBE_WRITE_FLUSH(hw);
+       usleep_range(1000, 1200);
 
        /* Poll for reset bit to self-clear meaning reset is complete */
        for (i = 0; i < 10; i++) {
-               udelay(1);
                ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
                if (!(ctrl & IXGBE_CTRL_RST_MASK))
                        break;
+               udelay(1);
        }
 
        if (ctrl & IXGBE_CTRL_RST_MASK) {