rt2x00: rt2800usb: fix status register reread logic
authorStanislaw Gruszka <[email protected]>
Mon, 19 Mar 2012 14:59:41 +0000 (15:59 +0100)
committerJohn W. Linville <[email protected]>
Mon, 26 Mar 2012 19:07:28 +0000 (15:07 -0400)
Another good catch from Jakub Kicinski. This patch fixes my
recent commit: ed61e2b02027935520d1be884fac0b2ffce8379a
"rt2x00: rt2800usb: rework txdone code"

We should reread status register only when nobody else start already
reading status i.e. test_and_set_bit(TX_STATUS_READING, flags) return 0.

Reported-by: Jakub Kicinski <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Acked-by: Gertjan van Wingerde <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
drivers/net/wireless/rt2x00/rt2800usb.c

index f97f84606f56f04f33f58c039bfc8859a59350ef..001735f7a6619b5f5419e3abbc7371c989f432cf 100644 (file)
@@ -184,7 +184,7 @@ stop_reading:
         * here again if status reading is needed.
         */
        if (rt2800usb_txstatus_pending(rt2x00dev) &&
-           test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags))
+           !test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags))
                return true;
        else
                return false;