aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2012-03-04 03:55:54 -0500
committerLuciano Coelho <coelho@ti.com>2012-03-05 08:45:26 -0500
commite9ba7152c1f5babd6ad9ad45619e0a10b4c08554 (patch)
tree379a478f07f17c0ae2fe3057756825df8e2d671b
parent6667776d3cf32dd3809a18917c2b7adb8ef12aa2 (diff)
wl12xx: avoid bug_on_recovery during fw switch
Add a flag to indicate we initiated a recovery work on purpose, in order to avoid triggering BUG() (when the bug_on_recovery module param was set). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r--drivers/net/wireless/wl12xx/main.c5
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 89bf9eadc840..3c966f2e00d0 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1154,7 +1154,8 @@ static void wl1271_recovery_work(struct work_struct *work)
1154 wl1271_info("Hardware recovery in progress. FW ver: %s pc: 0x%x", 1154 wl1271_info("Hardware recovery in progress. FW ver: %s pc: 0x%x",
1155 wl->chip.fw_ver_str, wl1271_read32(wl, SCR_PAD4)); 1155 wl->chip.fw_ver_str, wl1271_read32(wl, SCR_PAD4));
1156 1156
1157 BUG_ON(bug_on_recovery); 1157 BUG_ON(bug_on_recovery &&
1158 !test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags));
1158 1159
1159 /* 1160 /*
1160 * Advance security sequence number to overcome potential progress 1161 * Advance security sequence number to overcome potential progress
@@ -2133,6 +2134,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
2133 2134
2134 if (wl12xx_need_fw_change(wl, vif_count, true)) { 2135 if (wl12xx_need_fw_change(wl, vif_count, true)) {
2135 wl12xx_force_active_psm(wl); 2136 wl12xx_force_active_psm(wl);
2137 set_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags);
2136 mutex_unlock(&wl->mutex); 2138 mutex_unlock(&wl->mutex);
2137 wl1271_recovery_work(&wl->recovery_work); 2139 wl1271_recovery_work(&wl->recovery_work);
2138 return 0; 2140 return 0;
@@ -2317,6 +2319,7 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
2317 WARN_ON(iter != wlvif); 2319 WARN_ON(iter != wlvif);
2318 if (wl12xx_need_fw_change(wl, vif_count, false)) { 2320 if (wl12xx_need_fw_change(wl, vif_count, false)) {
2319 wl12xx_force_active_psm(wl); 2321 wl12xx_force_active_psm(wl);
2322 set_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags);
2320 wl12xx_queue_recovery_work(wl); 2323 wl12xx_queue_recovery_work(wl);
2321 cancel_recovery = false; 2324 cancel_recovery = false;
2322 } 2325 }
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index b26b1be9a98b..6e13a3073e9f 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -260,6 +260,7 @@ enum wl12xx_flags {
260 WL1271_FLAG_SOFT_GEMINI, 260 WL1271_FLAG_SOFT_GEMINI,
261 WL1271_FLAG_RECOVERY_IN_PROGRESS, 261 WL1271_FLAG_RECOVERY_IN_PROGRESS,
262 WL1271_FLAG_VIF_CHANGE_IN_PROGRESS, 262 WL1271_FLAG_VIF_CHANGE_IN_PROGRESS,
263 WL1271_FLAG_INTENDED_FW_RECOVERY,
263}; 264};
264 265
265enum wl12xx_vif_flags { 266enum wl12xx_vif_flags {