diff mbox series

[v2,1/2] wifi: ath11k: change to set 11d state instead of start 11d scan while disconnect

Message ID 20220928081413.27339-2-quic_wgong@quicinc.com
State Superseded
Headers show
Series wifi: ath11k: reduce the timeout value for hw scan | expand

Commit Message

Wen Gong Sept. 28, 2022, 8:14 a.m. UTC
When switch to connect to a new AP for station which is already connected
to an AP, the time cost is too long, it arrives 10 seconds.

The reason is when switch connection, disconnect operation happened on
the 1st AP, then 11d scan start command sent to firmware, and then a
new hw scan arrived for the 2nd AP. The 11d scan is running at this
moment, so the hw scan can not start immediately, it needs to wait
the 11d scan finished, it increased the time cost of switch AP and
even happened scan fail as log below after apply the incoming patch.

[ 1194.815104] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
[ 1196.864157] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
[ 1198.911926] ath11k_pci 0000:06:00.0: failed to start hw scan: -110

Change to set 11d state while disconnect, and the 11d scan will be
started after the new hw scan in ath11k_mac_op_hw_scan(). Then the
time cost of switching AP is small and not happened scan fail.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3

Fixes: 9dcf6808b253 ("ath11k: add 11d scan offload support")
Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Kalle Valo Oct. 10, 2022, 6:09 p.m. UTC | #1
Wen Gong <quic_wgong@quicinc.com> wrote:

> When switch to connect to a new AP for station which is already connected
> to an AP, the time cost is too long, it arrives 10 seconds.
> 
> The reason is when switch connection, disconnect operation happened on
> the 1st AP, then 11d scan start command sent to firmware, and then a
> new hw scan arrived for the 2nd AP. The 11d scan is running at this
> moment, so the hw scan can not start immediately, it needs to wait
> the 11d scan finished, it increased the time cost of switch AP and
> even happened scan fail as log below after apply the incoming patch.
> 
> [ 1194.815104] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
> [ 1196.864157] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
> [ 1198.911926] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
> 
> Change to set 11d state while disconnect, and the 11d scan will be
> started after the new hw scan in ath11k_mac_op_hw_scan(). Then the
> time cost of switching AP is small and not happened scan fail.
> 
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
> 
> Fixes: 9dcf6808b253 ("ath11k: add 11d scan offload support")
> Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

I still see warnings:

[ 3627.691737] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
[ 3715.435608] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
[ 3860.333214] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
[ 4542.000955] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
[ 4604.018451] ath11k_pci 0000:06:00.0: failed to start hw scan: -110

2 patches set to Changes Requested.

12991768 [v2,1/2] wifi: ath11k: change to set 11d state instead of start 11d scan while disconnect
12991769 [v2,2/2] wifi: ath11k: reduce the timeout value back for hw scan from 10 seconds to 1 second
Wen Gong Oct. 11, 2022, 3:53 a.m. UTC | #2
On 10/11/2022 2:09 AM, Kalle Valo wrote:
> Wen Gong <quic_wgong@quicinc.com> wrote:
>
>> When switch to connect to a new AP for station which is already connected
>> to an AP, the time cost is too long, it arrives 10 seconds.
>>
>> The reason is when switch connection, disconnect operation happened on
>> the 1st AP, then 11d scan start command sent to firmware, and then a
>> new hw scan arrived for the 2nd AP. The 11d scan is running at this
>> moment, so the hw scan can not start immediately, it needs to wait
>> the 11d scan finished, it increased the time cost of switch AP and
>> even happened scan fail as log below after apply the incoming patch.
>>
>> [ 1194.815104] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
>> [ 1196.864157] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
>> [ 1198.911926] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
>>
>> Change to set 11d state while disconnect, and the 11d scan will be
>> started after the new hw scan in ath11k_mac_op_hw_scan(). Then the
>> time cost of switching AP is small and not happened scan fail.
>>
>> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
>>
>> Fixes: 9dcf6808b253 ("ath11k: add 11d scan offload support")
>> Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
>> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
> I still see warnings:
>
> [ 3627.691737] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
> [ 3715.435608] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
> [ 3860.333214] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
> [ 4542.000955] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
> [ 4604.018451] ath11k_pci 0000:06:00.0: failed to start hw scan: -110
The failed log is now happened frequently as before, I will change it 
again to suppress the failed log.
> 2 patches set to Changes Requested.
>
> 12991768 [v2,1/2] wifi: ath11k: change to set 11d state instead of start 11d scan while disconnect
> 12991769 [v2,2/2] wifi: ath11k: reduce the timeout value back for hw scan from 10 seconds to 1 second
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 4218211afa30..b0c3cf258d12 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -7190,8 +7190,12 @@  ath11k_mac_op_unassign_vif_chanctx(struct ieee80211_hw *hw,
 				    ret);
 	}
 
-	if (arvif->vdev_type == WMI_VDEV_TYPE_STA)
-		ath11k_mac_11d_scan_start(ar, arvif->vdev_id);
+	if (arvif->vdev_type == WMI_VDEV_TYPE_STA &&
+	    ar->state_11d != ATH11K_11D_PREPARING &&
+	    test_bit(WMI_TLV_SERVICE_11D_OFFLOAD, ab->wmi_ab.svc_map)) {
+		reinit_completion(&ar->completed_11d_scan);
+		ar->state_11d = ATH11K_11D_PREPARING;
+	}
 
 	mutex_unlock(&ar->conf_mutex);
 }