Skip to content

Commit

Permalink
rt2x00: Make queue_entry flags access atomic
Browse files Browse the repository at this point in the history
All access to the queue_entry->flags can be done concurrently,
so all flags must use the atomic operators. On most locations
this was already done, so just fix the last few non-atomic
versions.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Ivo van Doorn authored and John W. Linville committed Oct 11, 2010
1 parent 1550c8e commit a1d1eab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/wireless/rt2x00/rt2x00usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
struct queue_entry *entry = (struct queue_entry *)urb->context;
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;

if (!__test_and_clear_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags))
if (!test_and_clear_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags))
return;

/*
Expand All @@ -220,7 +220,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
* Check if the frame was correctly uploaded
*/
if (urb->status)
__set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);

/*
* Schedule the delayed work for reading the TX status
Expand Down Expand Up @@ -407,7 +407,7 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
struct queue_entry *entry = (struct queue_entry *)urb->context;
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;

if (!__test_and_clear_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags))
if (!test_and_clear_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags))
return;

/*
Expand All @@ -421,7 +421,7 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
* a problem.
*/
if (urb->actual_length < entry->queue->desc_size || urb->status)
__set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);

/*
* Schedule the delayed work for reading the RX status
Expand Down

0 comments on commit a1d1eab

Please sign in to comment.