* [PATCH] ath11k: Handle failure in qmi firmware ready
@ 2022-02-17 6:26 Seevalamuthu Mariappan
2022-02-21 10:28 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Seevalamuthu Mariappan @ 2022-02-17 6:26 UTC (permalink / raw)
To: ath11k; +Cc: linux-wireless, Seevalamuthu Mariappan
In some scenarios like firmware crashes during init time
and hardware gets restarted after qmi firmware ready event.
During restart, ath11k_core_qmi_firmware_ready() returns timeout.
But, this failure is not handled and ATH11K_FLAG_REGISTERED is set.
When hardware restart completed, firmware sends firmware ready event
again. Since ATH11K_FLAG_REGISTERED is already set, ath11k handles
this as core restart. Inits are not done because of previous timeout.
But ath11k_core_restart does deinit's which causes NULL pointer crash.
Fix this by handling failure from ath11k_core_qmi_firmware_ready().
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-00881-QCAHKSWPL_SILICONZ-1
Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
---
drivers/net/wireless/ath/ath11k/qmi.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index 42c2ad3..efb0146 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -2959,7 +2959,11 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work)
clear_bit(ATH11K_FLAG_CRASH_FLUSH,
&ab->dev_flags);
clear_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags);
- ath11k_core_qmi_firmware_ready(ab);
+ ret = ath11k_core_qmi_firmware_ready(ab);
+ if (ret) {
+ set_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags);
+ break;
+ }
set_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ath11k: Handle failure in qmi firmware ready
2022-02-17 6:26 [PATCH] ath11k: Handle failure in qmi firmware ready Seevalamuthu Mariappan
@ 2022-02-21 10:28 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2022-02-21 10:28 UTC (permalink / raw)
To: Seevalamuthu Mariappan; +Cc: ath11k, linux-wireless, Seevalamuthu Mariappan
Seevalamuthu Mariappan <quic_seevalam@quicinc.com> wrote:
> In some scenarios like firmware crashes during init time
> and hardware gets restarted after qmi firmware ready event.
> During restart, ath11k_core_qmi_firmware_ready() returns timeout.
> But, this failure is not handled and ATH11K_FLAG_REGISTERED is set.
>
> When hardware restart completed, firmware sends firmware ready event
> again. Since ATH11K_FLAG_REGISTERED is already set, ath11k handles
> this as core restart. Inits are not done because of previous timeout.
> But ath11k_core_restart does deinit's which causes NULL pointer crash.
>
> Fix this by handling failure from ath11k_core_qmi_firmware_ready().
>
> Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-00881-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Patch applied to ath-next branch of ath.git, thanks.
a19c0e104db9 ath11k: Handle failure in qmi firmware ready
--
https://patchwork.kernel.org/project/linux-wireless/patch/1645079195-13564-1-git-send-email-quic_seevalam@quicinc.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-21 10:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 6:26 [PATCH] ath11k: Handle failure in qmi firmware ready Seevalamuthu Mariappan
2022-02-21 10:28 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).