Skip to content

Commit 45e72c3

Browse files
Karthikeyan Periyasamykvalo
authored andcommitted
wifi: ath12k: introduce QMI firmware ready flag
When hardware device group abstraction is introduced, the QMI firmware ready event of different devices in a group can be received simultaneously. To indicate the firmware ready event is completed for a particular device in a group set a flag (ATH12K_FLAG_QMI_FW_READY_COMPLETE). This helps the upcoming hardware recovery implementation for hardware device group abstraction. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Karthikeyan Periyasamy <[email protected]> Signed-off-by: Harshitha Prem <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 17dd22a commit 45e72c3

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

drivers/net/wireless/ath/ath12k/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ static void ath12k_core_reset(struct work_struct *work)
11451145
int reset_count, fail_cont_count;
11461146
long time_left;
11471147

1148-
if (!(test_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags))) {
1148+
if (!(test_bit(ATH12K_FLAG_QMI_FW_READY_COMPLETE, &ab->dev_flags))) {
11491149
ath12k_warn(ab, "ignore reset dev flags 0x%lx\n", ab->dev_flags);
11501150
return;
11511151
}

drivers/net/wireless/ath/ath12k/core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ enum ath12k_dev_flags {
228228
ATH12K_FLAG_HTC_SUSPEND_COMPLETE,
229229
ATH12K_FLAG_CE_IRQ_ENABLED,
230230
ATH12K_FLAG_EXT_IRQ_ENABLED,
231+
ATH12K_FLAG_QMI_FW_READY_COMPLETE,
231232
};
232233

233234
struct ath12k_tx_conf {

drivers/net/wireless/ath/ath12k/qmi.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,6 +3033,8 @@ void ath12k_qmi_firmware_stop(struct ath12k_base *ab)
30333033
{
30343034
int ret;
30353035

3036+
clear_bit(ATH12K_FLAG_QMI_FW_READY_COMPLETE, &ab->dev_flags);
3037+
30363038
ret = ath12k_qmi_wlanfw_mode_send(ab, ATH12K_FIRMWARE_MODE_OFF);
30373039
if (ret < 0) {
30383040
ath12k_warn(ab, "qmi failed to send wlan mode off\n");
@@ -3336,7 +3338,7 @@ static void ath12k_qmi_driver_event_work(struct work_struct *work)
33363338
break;
33373339
case ATH12K_QMI_EVENT_FW_READY:
33383340
clear_bit(ATH12K_FLAG_QMI_FAIL, &ab->dev_flags);
3339-
if (test_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags)) {
3341+
if (test_bit(ATH12K_FLAG_QMI_FW_READY_COMPLETE, &ab->dev_flags)) {
33403342
if (ab->is_reset)
33413343
ath12k_hal_dump_srng_stats(ab);
33423344
queue_work(ab->workqueue, &ab->restart_work);
@@ -3346,8 +3348,12 @@ static void ath12k_qmi_driver_event_work(struct work_struct *work)
33463348
clear_bit(ATH12K_FLAG_CRASH_FLUSH,
33473349
&ab->dev_flags);
33483350
clear_bit(ATH12K_FLAG_RECOVERY, &ab->dev_flags);
3349-
ath12k_core_qmi_firmware_ready(ab);
3350-
set_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags);
3351+
ret = ath12k_core_qmi_firmware_ready(ab);
3352+
if (!ret) {
3353+
set_bit(ATH12K_FLAG_QMI_FW_READY_COMPLETE,
3354+
&ab->dev_flags);
3355+
set_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags);
3356+
}
33513357

33523358
break;
33533359
default:

0 commit comments

Comments
 (0)