diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-08-29 15:04:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-08-29 16:24:11 -0400 |
commit | 0262ab0df64a67d4c0ed7577a29b7d866819cc68 (patch) | |
tree | 95c5e7842787c60140fe6c35ff7a1bc8b43bebaf /drivers/net/wireless/rt2x00/rt2x00rfkill.c | |
parent | de9cc7a4e6f975ca5e91cf8745b3e35a7e780bae (diff) |
rt2x00: Fix race conditions in flag handling
Some of the flags should be accessed atomically to
prevent race conditions. The flags that are most important
are those that can change often and indicate the actual
state of the device, queue or queue entry.
The big flag rename was done to move all state flags to
the same naming type as the other rt2x00dev flags and
made sure all places where the flags were used were changed. ;)
Thanks to Stephen for most of the queue flags updates,
which fixes some of the most obvious consequences of the
race conditions. Among those the notorious:
rt2x00queue_write_tx_frame: Error - Arrived at non-free entry in the non-full queue 0.
rt2x00queue_write_tx_frame: Error - Arrived at non-free entry in the non-full queue 0.
rt2x00queue_write_tx_frame: Error - Arrived at non-free entry in the non-full queue 0.
Signed-off-by: Stephen Blackheath <tramp.enshrine.stephen@blacksapphire.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00rfkill.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00rfkill.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00rfkill.c b/drivers/net/wireless/rt2x00/rt2x00rfkill.c index 04b29716d356..8a2fefb365b7 100644 --- a/drivers/net/wireless/rt2x00/rt2x00rfkill.c +++ b/drivers/net/wireless/rt2x00/rt2x00rfkill.c | |||
@@ -41,16 +41,16 @@ static int rt2x00rfkill_toggle_radio(void *data, enum rfkill_state state) | |||
41 | /* | 41 | /* |
42 | * Only continue if there are enabled interfaces. | 42 | * Only continue if there are enabled interfaces. |
43 | */ | 43 | */ |
44 | if (!test_bit(DEVICE_STARTED, &rt2x00dev->flags)) | 44 | if (!test_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags)) |
45 | return 0; | 45 | return 0; |
46 | 46 | ||
47 | if (state == RFKILL_STATE_UNBLOCKED) { | 47 | if (state == RFKILL_STATE_UNBLOCKED) { |
48 | INFO(rt2x00dev, "Hardware button pressed, enabling radio.\n"); | 48 | INFO(rt2x00dev, "Hardware button pressed, enabling radio.\n"); |
49 | __clear_bit(DEVICE_DISABLED_RADIO_HW, &rt2x00dev->flags); | 49 | clear_bit(DEVICE_STATE_DISABLED_RADIO_HW, &rt2x00dev->flags); |
50 | retval = rt2x00lib_enable_radio(rt2x00dev); | 50 | retval = rt2x00lib_enable_radio(rt2x00dev); |
51 | } else if (state == RFKILL_STATE_SOFT_BLOCKED) { | 51 | } else if (state == RFKILL_STATE_SOFT_BLOCKED) { |
52 | INFO(rt2x00dev, "Hardware button pressed, disabling radio.\n"); | 52 | INFO(rt2x00dev, "Hardware button pressed, disabling radio.\n"); |
53 | __set_bit(DEVICE_DISABLED_RADIO_HW, &rt2x00dev->flags); | 53 | set_bit(DEVICE_STATE_DISABLED_RADIO_HW, &rt2x00dev->flags); |
54 | rt2x00lib_disable_radio(rt2x00dev); | 54 | rt2x00lib_disable_radio(rt2x00dev); |
55 | } else { | 55 | } else { |
56 | WARNING(rt2x00dev, "Received unexpected rfkill state %d.\n", | 56 | WARNING(rt2x00dev, "Received unexpected rfkill state %d.\n", |