diff options
author | Eliad Peller <eliad@wizery.com> | 2012-09-03 11:27:58 -0400 |
---|---|---|
committer | Luciano Coelho <luca@coelho.fi> | 2012-09-27 05:13:54 -0400 |
commit | af390f4dd35373b3ca32bafc12d7f2ad12840529 (patch) | |
tree | 692652e15a9aed463e43f40aa351b4d640789faa /drivers/net/wireless/ti/wl18xx/main.c | |
parent | ab2c4f37dcef5bd517a95a32da50d5ed0cc24cb5 (diff) |
wlcore: protect wlcore_op_set_key with mutex
wlcore_op_set_key() calls wl18xx_set_key(),
which in turn executes some of his function
calls without acquiring wl->mutex and making
sure the fw is awake.
Adding mutex_lock()/ps_elp_wakeup() calls is
not enough, as wl18xx_set_key() calls
wl1271_tx_flush() which can't be called while
the mutex is taken.
Add the required calls to wlcore_op_set_key,
but limit the queues_stop and flushing
to the only encryption types in which
a spare block might be needed (GEM and TKIP).
[Arik - move state != ON check]
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <luca@coelho.fi>
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx/main.c')
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index 9e3e10a13498..a39682a7c25f 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -1252,13 +1252,6 @@ static int wl18xx_set_key(struct wl1271 *wl, enum set_key_cmd cmd, | |||
1252 | if (!change_spare) | 1252 | if (!change_spare) |
1253 | return wlcore_set_key(wl, cmd, vif, sta, key_conf); | 1253 | return wlcore_set_key(wl, cmd, vif, sta, key_conf); |
1254 | 1254 | ||
1255 | /* | ||
1256 | * stop the queues and flush to ensure the next packets are | ||
1257 | * in sync with FW spare block accounting | ||
1258 | */ | ||
1259 | wlcore_stop_queues(wl, WLCORE_QUEUE_STOP_REASON_SPARE_BLK); | ||
1260 | wl1271_tx_flush(wl); | ||
1261 | |||
1262 | ret = wlcore_set_key(wl, cmd, vif, sta, key_conf); | 1255 | ret = wlcore_set_key(wl, cmd, vif, sta, key_conf); |
1263 | if (ret < 0) | 1256 | if (ret < 0) |
1264 | goto out; | 1257 | goto out; |
@@ -1281,7 +1274,6 @@ static int wl18xx_set_key(struct wl1271 *wl, enum set_key_cmd cmd, | |||
1281 | } | 1274 | } |
1282 | 1275 | ||
1283 | out: | 1276 | out: |
1284 | wlcore_wake_queues(wl, WLCORE_QUEUE_STOP_REASON_SPARE_BLK); | ||
1285 | return ret; | 1277 | return ret; |
1286 | } | 1278 | } |
1287 | 1279 | ||