2022-09-28 08:22:16

by Wen Gong

[permalink] [raw]
Subject: [PATCH v2 0/2] wifi: ath11k: reduce the timeout value for hw scan

v2:
add "wifi: ath11k: change to set 11d state instead of start 11d scan while disconnect"

Reduce the max timeout for hw scan started.

Wen Gong (2):
wifi: ath11k: change to set 11d state instead of start 11d scan while
disconnect
wifi: ath11k: reduce the timeout value back for hw scan from 10
seconds to 1 second

drivers/net/wireless/ath/ath11k/mac.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)


base-commit: c6d18be90f9b0c7fb64c6138b51c49151140fb57
--
2.31.1


2022-09-28 08:22:21

by Wen Gong

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

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 <[email protected]>
---
drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

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);
}
--
2.31.1

2022-10-10 18:28:23

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] wifi: ath11k: change to set 11d state instead of start 11d scan while disconnect

Wen Gong <[email protected]> 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 <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

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

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2022-10-11 04:07:38

by Wen Gong

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] wifi: ath11k: change to set 11d state instead of start 11d scan while disconnect

On 10/11/2022 11:53 AM, Wen Gong wrote:
> On 10/11/2022 2:09 AM, Kalle Valo wrote:
>> Wen Gong <[email protected]> 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 <[email protected]>
>>> Signed-off-by: Kalle Valo <[email protected]>
>> 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.
change typo.
The failed log is NOT 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
>>

2022-10-11 04:08:31

by Wen Gong

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] wifi: ath11k: change to set 11d state instead of start 11d scan while disconnect

On 10/11/2022 2:09 AM, Kalle Valo wrote:
> Wen Gong <[email protected]> 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 <[email protected]>
>> Signed-off-by: Kalle Valo <[email protected]>
> 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
>

2022-10-11 04:40:49

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] wifi: ath11k: change to set 11d state instead of start 11d scan while disconnect

Wen Gong <[email protected]> writes:

> On 10/11/2022 11:53 AM, Wen Gong wrote:
>
>> On 10/11/2022 2:09 AM, Kalle Valo wrote:
>>> Wen Gong <[email protected]> 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 <[email protected]>
>>>> Signed-off-by: Kalle Valo <[email protected]>
>>> 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.
> change typo.
> The failed log is NOT happened frequently as before, I will change it
> again to suppress the failed log.

Please think about this more, ignoring errors doesn't sound like a good
solution.

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2022-10-11 07:50:45

by Wen Gong

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] wifi: ath11k: change to set 11d state instead of start 11d scan while disconnect

On 10/11/2022 12:31 PM, Kalle Valo wrote:
> Wen Gong <[email protected]> writes:
>
>> On 10/11/2022 11:53 AM, Wen Gong wrote:
>>
>>> On 10/11/2022 2:09 AM, Kalle Valo wrote:
>>>> Wen Gong <[email protected]> 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 <[email protected]>
>>>>> Signed-off-by: Kalle Valo <[email protected]>
>>>> 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.
>> change typo.
>> The failed log is NOT happened frequently as before, I will change it
>> again to suppress the failed log.
> Please think about this more, ignoring errors doesn't sound like a good
> solution.
Yes, I have sent v3, it is not ignoring errors directly.