Commit 66ddcc39 authored by Vasanthakumar Thiagarajan's avatar Vasanthakumar Thiagarajan Committed by Kalle Valo

ath6kl: Make fw error recovery configurable

Add a modparam to configure recovery. Recovery
from firmware error is disabled by default to debug
the actual issue further. To recovery from error,
modprobe ath6kl_core recovery_enable=1.
Reported-by: default avatarJin Navy <nhjin@qca.qualcomm.com>
Signed-off-by: default avatarVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent a3561706
...@@ -33,6 +33,7 @@ static unsigned int wow_mode; ...@@ -33,6 +33,7 @@ static unsigned int wow_mode;
static unsigned int uart_debug; static unsigned int uart_debug;
static unsigned int ath6kl_p2p; static unsigned int ath6kl_p2p;
static unsigned int testmode; static unsigned int testmode;
static unsigned int recovery_enable;
static unsigned int heart_beat_poll; static unsigned int heart_beat_poll;
module_param(debug_mask, uint, 0644); module_param(debug_mask, uint, 0644);
...@@ -41,9 +42,12 @@ module_param(wow_mode, uint, 0644); ...@@ -41,9 +42,12 @@ module_param(wow_mode, uint, 0644);
module_param(uart_debug, uint, 0644); module_param(uart_debug, uint, 0644);
module_param(ath6kl_p2p, uint, 0644); module_param(ath6kl_p2p, uint, 0644);
module_param(testmode, uint, 0644); module_param(testmode, uint, 0644);
module_param(recovery_enable, uint, 0644);
module_param(heart_beat_poll, uint, 0644); module_param(heart_beat_poll, uint, 0644);
MODULE_PARM_DESC(heart_beat_poll, "Enable fw error detection periodic" \ MODULE_PARM_DESC(recovery_enable, "Enable recovery from firmware error");
"polling. This also specifies the polling interval in msecs"); MODULE_PARM_DESC(heart_beat_poll, "Enable fw error detection periodic" \
"polling. This also specifies the polling interval in" \
"msecs. Set reocvery_enable for this to be effective");
void ath6kl_core_tx_complete(struct ath6kl *ar, struct sk_buff *skb) void ath6kl_core_tx_complete(struct ath6kl *ar, struct sk_buff *skb)
{ {
...@@ -206,6 +210,10 @@ int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type) ...@@ -206,6 +210,10 @@ int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type)
ath6kl_dbg(ATH6KL_DBG_TRC, "%s: name=%s dev=0x%p, ar=0x%p\n", ath6kl_dbg(ATH6KL_DBG_TRC, "%s: name=%s dev=0x%p, ar=0x%p\n",
__func__, wdev->netdev->name, wdev->netdev, ar); __func__, wdev->netdev->name, wdev->netdev, ar);
ar->fw_recovery.enable = !!recovery_enable;
if (!ar->fw_recovery.enable)
return ret;
if (heart_beat_poll && if (heart_beat_poll &&
test_bit(ATH6KL_FW_CAPABILITY_HEART_BEAT_POLL, test_bit(ATH6KL_FW_CAPABILITY_HEART_BEAT_POLL,
ar->fw_capabilities)) ar->fw_capabilities))
......
...@@ -815,6 +815,7 @@ struct ath6kl { ...@@ -815,6 +815,7 @@ struct ath6kl {
u32 seq_num; u32 seq_num;
bool hb_pending; bool hb_pending;
u8 hb_misscnt; u8 hb_misscnt;
bool enable;
} fw_recovery; } fw_recovery;
#ifdef CONFIG_ATH6KL_DEBUG #ifdef CONFIG_ATH6KL_DEBUG
......
...@@ -41,6 +41,9 @@ static void ath6kl_recovery_work(struct work_struct *work) ...@@ -41,6 +41,9 @@ static void ath6kl_recovery_work(struct work_struct *work)
void ath6kl_recovery_err_notify(struct ath6kl *ar, enum ath6kl_fw_err reason) void ath6kl_recovery_err_notify(struct ath6kl *ar, enum ath6kl_fw_err reason)
{ {
if (!ar->fw_recovery.enable)
return;
ath6kl_dbg(ATH6KL_DBG_RECOVERY, "Fw error detected, reason:%d\n", ath6kl_dbg(ATH6KL_DBG_RECOVERY, "Fw error detected, reason:%d\n",
reason); reason);
...@@ -112,6 +115,9 @@ void ath6kl_recovery_init(struct ath6kl *ar) ...@@ -112,6 +115,9 @@ void ath6kl_recovery_init(struct ath6kl *ar)
void ath6kl_recovery_cleanup(struct ath6kl *ar) void ath6kl_recovery_cleanup(struct ath6kl *ar)
{ {
if (!ar->fw_recovery.enable)
return;
set_bit(RECOVERY_CLEANUP, &ar->flag); set_bit(RECOVERY_CLEANUP, &ar->flag);
del_timer_sync(&ar->fw_recovery.hb_timer); del_timer_sync(&ar->fw_recovery.hb_timer);
...@@ -120,6 +126,9 @@ void ath6kl_recovery_cleanup(struct ath6kl *ar) ...@@ -120,6 +126,9 @@ void ath6kl_recovery_cleanup(struct ath6kl *ar)
void ath6kl_recovery_suspend(struct ath6kl *ar) void ath6kl_recovery_suspend(struct ath6kl *ar)
{ {
if (!ar->fw_recovery.enable)
return;
ath6kl_recovery_cleanup(ar); ath6kl_recovery_cleanup(ar);
if (!ar->fw_recovery.err_reason) if (!ar->fw_recovery.err_reason)
...@@ -135,6 +144,9 @@ void ath6kl_recovery_suspend(struct ath6kl *ar) ...@@ -135,6 +144,9 @@ void ath6kl_recovery_suspend(struct ath6kl *ar)
void ath6kl_recovery_resume(struct ath6kl *ar) void ath6kl_recovery_resume(struct ath6kl *ar)
{ {
if (!ar->fw_recovery.enable)
return;
clear_bit(RECOVERY_CLEANUP, &ar->flag); clear_bit(RECOVERY_CLEANUP, &ar->flag);
if (!ar->fw_recovery.hb_poll) if (!ar->fw_recovery.hb_poll)
......
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