]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
e1000e: Guarantee descriptor writeback flush success.
authorMatthew Vick <matthew.vick@intel.com>
Fri, 16 Mar 2012 09:03:00 +0000 (09:03 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 07:56:49 +0000 (15:56 +0800)
In rare circumstances, a descriptor writeback flush may not work if it
arrives on a specific clock cycle as a writeback request is going out.

(cherry picked from commit bf03085f85112eac2d19036ea3003071220285bb)
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/e1000e/netdev.c

index cea99d0d5a54d4f98f1a873c8315831073d71a2f..1c7a8f18ede27e6e57cd1d2ab8b5f1b7d3f0c88d 100644 (file)
@@ -1045,6 +1045,13 @@ static void e1000_print_hw_hang(struct work_struct *work)
                ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
                /* execute the writes immediately */
                e1e_flush();
+               /*
+                * Due to rare timing issues, write to TIDV again to ensure
+                * the write is successful
+                */
+               ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
+               /* execute the writes immediately */
+               e1e_flush();
                adapter->tx_hang_recheck = true;
                return;
        }
@@ -3570,6 +3577,16 @@ static void e1000e_flush_descriptors(struct e1000_adapter *adapter)
 
        /* execute the writes immediately */
        e1e_flush();
+
+       /*
+        * due to rare timing issues, write to TIDV/RDTR again to ensure the
+        * write is successful
+        */
+       ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
+       ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD);
+
+       /* execute the writes immediately */
+       e1e_flush();
 }
 
 static void e1000e_update_stats(struct e1000_adapter *adapter);