Commit e9ba7152 authored by Eliad Peller's avatar Eliad Peller Committed by Luciano Coelho

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: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 6667776d
...@@ -1154,7 +1154,8 @@ static void wl1271_recovery_work(struct work_struct *work) ...@@ -1154,7 +1154,8 @@ static void wl1271_recovery_work(struct work_struct *work)
wl1271_info("Hardware recovery in progress. FW ver: %s pc: 0x%x", wl1271_info("Hardware recovery in progress. FW ver: %s pc: 0x%x",
wl->chip.fw_ver_str, wl1271_read32(wl, SCR_PAD4)); wl->chip.fw_ver_str, wl1271_read32(wl, SCR_PAD4));
BUG_ON(bug_on_recovery); BUG_ON(bug_on_recovery &&
!test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags));
/* /*
* Advance security sequence number to overcome potential progress * Advance security sequence number to overcome potential progress
...@@ -2133,6 +2134,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, ...@@ -2133,6 +2134,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
if (wl12xx_need_fw_change(wl, vif_count, true)) { if (wl12xx_need_fw_change(wl, vif_count, true)) {
wl12xx_force_active_psm(wl); wl12xx_force_active_psm(wl);
set_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags);
mutex_unlock(&wl->mutex); mutex_unlock(&wl->mutex);
wl1271_recovery_work(&wl->recovery_work); wl1271_recovery_work(&wl->recovery_work);
return 0; return 0;
...@@ -2317,6 +2319,7 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw, ...@@ -2317,6 +2319,7 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
WARN_ON(iter != wlvif); WARN_ON(iter != wlvif);
if (wl12xx_need_fw_change(wl, vif_count, false)) { if (wl12xx_need_fw_change(wl, vif_count, false)) {
wl12xx_force_active_psm(wl); wl12xx_force_active_psm(wl);
set_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags);
wl12xx_queue_recovery_work(wl); wl12xx_queue_recovery_work(wl);
cancel_recovery = false; cancel_recovery = false;
} }
......
...@@ -260,6 +260,7 @@ enum wl12xx_flags { ...@@ -260,6 +260,7 @@ enum wl12xx_flags {
WL1271_FLAG_SOFT_GEMINI, WL1271_FLAG_SOFT_GEMINI,
WL1271_FLAG_RECOVERY_IN_PROGRESS, WL1271_FLAG_RECOVERY_IN_PROGRESS,
WL1271_FLAG_VIF_CHANGE_IN_PROGRESS, WL1271_FLAG_VIF_CHANGE_IN_PROGRESS,
WL1271_FLAG_INTENDED_FW_RECOVERY,
}; };
enum wl12xx_vif_flags { enum wl12xx_vif_flags {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment