tg3: Fix int selftest for recent devices.
authorMatt Carlson <mcarlson@broadcom.com>
Wed, 20 Jul 2011 10:20:55 +0000 (10:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Jul 2011 19:36:15 +0000 (12:36 -0700)
This patch fixes interrupt selftest failures for recent devices (57765,
5717, 5718. 5719, 5720) by disabling MSI one-shot mode and applying the
status tag workaround to the selftest code.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c

index e5c1bc919b4d8587dfc2a24ef9c1a3f7b2731d93..f2b0839f981018384eaf6ad9fa0063118de01616 100644 (file)
@@ -9183,7 +9183,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
         * Turn off MSI one shot mode.  Otherwise this test has no
         * observable way to know whether the interrupt was delivered.
         */
-       if (tg3_flag(tp, 57765_PLUS) && tg3_flag(tp, USING_MSI)) {
+       if (tg3_flag(tp, 57765_PLUS)) {
                val = tr32(MSGINT_MODE) | MSGINT_MODE_ONE_SHOT_DISABLE;
                tw32(MSGINT_MODE, val);
        }
@@ -9211,6 +9211,10 @@ static int tg3_test_interrupt(struct tg3 *tp)
                        break;
                }
 
+               if (tg3_flag(tp, 57765_PLUS) &&
+                   tnapi->hw_status->status_tag != tnapi->last_tag)
+                       tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24);
+
                msleep(10);
        }
 
@@ -9225,7 +9229,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
 
        if (intr_ok) {
                /* Reenable MSI one shot mode. */
-               if (tg3_flag(tp, 57765_PLUS) && tg3_flag(tp, USING_MSI)) {
+               if (tg3_flag(tp, 57765_PLUS)) {
                        val = tr32(MSGINT_MODE) & ~MSGINT_MODE_ONE_SHOT_DISABLE;
                        tw32(MSGINT_MODE, val);
                }