diff mbox

ath10k : Fix channel survey dump

Message ID 1493217698-22451-1-git-send-email-c_vnaral@qti.qualcomm.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

c_vnaral@qti.qualcomm.com April 26, 2017, 2:41 p.m. UTC
Channel active/busy time are showing incorrect
(less than previous or sometimes zero) for
successive survey dump command.

example:
Survey data from wlan0
        frequency:                      5180 MHz [in use]
        channel active time:            54995 ms
        channel busy time:              432 ms
        channel receive time:           0 ms
        channel transmit time:          59 ms
Survey data from wlan0
        frequency:                      5180 MHz [in use]
        channel active time:            32592 ms
        channel busy time:              254 ms
        channel receive time:           0 ms
        channel transmit time:          0 ms

This patch fix this issue by assigning 'wmi_bss_survey_req_type'
as 'WMI_BSS_SURVEY_REQ_TYPE_READ'.

Firmware ver 10.4-3.4-00082
Hardware QCA4019

Signed-off-by: Venkateswara Rao Naralasetty <c_vnaral@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/mac.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Felix Fietkau April 26, 2017, 3:29 p.m. UTC | #1
On 2017-04-26 16:41, Venkateswara Rao Naralasetty wrote:
> Channel active/busy time are showing incorrect
> (less than previous or sometimes zero) for
> successive survey dump command.
> 
> example:
> Survey data from wlan0
>         frequency:                      5180 MHz [in use]
>         channel active time:            54995 ms
>         channel busy time:              432 ms
>         channel receive time:           0 ms
>         channel transmit time:          59 ms
> Survey data from wlan0
>         frequency:                      5180 MHz [in use]
>         channel active time:            32592 ms
>         channel busy time:              254 ms
>         channel receive time:           0 ms
>         channel transmit time:          0 ms
> 
> This patch fix this issue by assigning 'wmi_bss_survey_req_type'
> as 'WMI_BSS_SURVEY_REQ_TYPE_READ'.
> 
> Firmware ver 10.4-3.4-00082
> Hardware QCA4019
> 
> Signed-off-by: Venkateswara Rao Naralasetty <c_vnaral@qti.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath10k/mac.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> index 9977829..87a9b55 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -6621,7 +6621,7 @@ static void ath10k_reconfig_complete(struct ieee80211_hw *hw,
>  				  struct ieee80211_channel *channel)
>  {
>  	int ret;
> -	enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ_CLEAR;
> +	enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ;
Does the firmware read the registers directly, or does it accumulate the
results in a way that can't overflow?
If you don't clear the counters on reset, the overflow will be
problematic for the current-channel stats.
I think a better approach would be to use READ_CLEAR for in-use channels
and store the sum inside the driver.

- Felix
Kalle Valo May 19, 2017, 9:17 a.m. UTC | #2
Felix Fietkau <nbd@nbd.name> writes:

> On 2017-04-26 16:41, Venkateswara Rao Naralasetty wrote:
>> Channel active/busy time are showing incorrect
>> (less than previous or sometimes zero) for
>> successive survey dump command.
>> 
>> example:
>> Survey data from wlan0
>>         frequency:                      5180 MHz [in use]
>>         channel active time:            54995 ms
>>         channel busy time:              432 ms
>>         channel receive time:           0 ms
>>         channel transmit time:          59 ms
>> Survey data from wlan0
>>         frequency:                      5180 MHz [in use]
>>         channel active time:            32592 ms
>>         channel busy time:              254 ms
>>         channel receive time:           0 ms
>>         channel transmit time:          0 ms
>> 
>> This patch fix this issue by assigning 'wmi_bss_survey_req_type'
>> as 'WMI_BSS_SURVEY_REQ_TYPE_READ'.
>> 
>> Firmware ver 10.4-3.4-00082
>> Hardware QCA4019
>> 
>> Signed-off-by: Venkateswara Rao Naralasetty <c_vnaral@qti.qualcomm.com>
>> ---
>>  drivers/net/wireless/ath/ath10k/mac.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
>> index 9977829..87a9b55 100644
>> --- a/drivers/net/wireless/ath/ath10k/mac.c
>> +++ b/drivers/net/wireless/ath/ath10k/mac.c
>> @@ -6621,7 +6621,7 @@ static void ath10k_reconfig_complete(struct ieee80211_hw *hw,
>>  				  struct ieee80211_channel *channel)
>>  {
>>  	int ret;
>> -	enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ_CLEAR;
>> +	enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ;
>
> Does the firmware read the registers directly, or does it accumulate
> the results in a way that can't overflow? If you don't clear the
> counters on reset, the overflow will be problematic for the
> current-channel stats. I think a better approach would be to use
> READ_CLEAR for in-use channels and store the sum inside the driver.

Venkateswara, any comments?
Adrian Chadd May 19, 2017, 3:32 p.m. UTC | #3
On 19 May 2017 at 02:17, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Felix Fietkau <nbd@nbd.name> writes:
>
>> On 2017-04-26 16:41, Venkateswara Rao Naralasetty wrote:
>>> Channel active/busy time are showing incorrect
>>> (less than previous or sometimes zero) for
>>> successive survey dump command.

[snip]

>> Does the firmware read the registers directly, or does it accumulate
>> the results in a way that can't overflow? If you don't clear the
>> counters on reset, the overflow will be problematic for the
>> current-channel stats. I think a better approach would be to use
>> READ_CLEAR for in-use channels and store the sum inside the driver.
>
> Venkateswara, any comments?

I just bumped into this at work. I'm thinking of teaching mac80211
about optionally summing things so each driver doesn't need another
per-channel array.



-adrian
Johannes Berg May 22, 2017, 6:11 a.m. UTC | #4
On Fri, 2017-05-19 at 08:32 -0700, Adrian Chadd wrote:
> 
> I just bumped into this at work. I'm thinking of teaching mac80211
> about optionally summing things so each driver doesn't need another
> per-channel array.
> 

We could possibly even do that in cfg80211, I guess.

johannes
Venkateswara Naralasetty May 22, 2017, 3:17 p.m. UTC | #5
-----Original Message-----
From: Kalle Valo 
Sent: Friday, May 19, 2017 2:48 PM
To: nbd@nbd.name
Cc: Venkateswara Naralasettty <vnaralas@qti.qualcomm.com>; ath10k@lists.infradead.org; linux-wireless@vger.kernel.org
Subject: Re: [PATCH] ath10k : Fix channel survey dump

Felix Fietkau <nbd@nbd.name> writes:

> On 2017-04-26 16:41, Venkateswara Rao Naralasetty wrote:
>> Channel active/busy time are showing incorrect (less than previous or 
>> sometimes zero) for successive survey dump command.
>> 
>> example:
>> Survey data from wlan0
>>         frequency:                      5180 MHz [in use]
>>         channel active time:            54995 ms
>>         channel busy time:              432 ms
>>         channel receive time:           0 ms
>>         channel transmit time:          59 ms
>> Survey data from wlan0
>>         frequency:                      5180 MHz [in use]
>>         channel active time:            32592 ms
>>         channel busy time:              254 ms
>>         channel receive time:           0 ms
>>         channel transmit time:          0 ms
>> 
>> This patch fix this issue by assigning 'wmi_bss_survey_req_type'
>> as 'WMI_BSS_SURVEY_REQ_TYPE_READ'.
>> 
>> Firmware ver 10.4-3.4-00082
>> Hardware QCA4019
>> 
>> Signed-off-by: Venkateswara Rao Naralasetty 
>> <c_vnaral@qti.qualcomm.com>
>> ---
>>  drivers/net/wireless/ath/ath10k/mac.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
>> b/drivers/net/wireless/ath/ath10k/mac.c
>> index 9977829..87a9b55 100644
>> --- a/drivers/net/wireless/ath/ath10k/mac.c
>> +++ b/drivers/net/wireless/ath/ath10k/mac.c
>> @@ -6621,7 +6621,7 @@ static void ath10k_reconfig_complete(struct ieee80211_hw *hw,
>>  				  struct ieee80211_channel *channel)  {
>>  	int ret;
>> -	enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ_CLEAR;
>> +	enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ;
>
> Does the firmware read the registers directly, or does it accumulate 
> the results in a way that can't overflow? If you don't clear the 
> counters on reset, the overflow will be problematic for the 
> current-channel stats. I think a better approach would be to use 
> READ_CLEAR for in-use channels and store the sum inside the driver.

Venkateswara, any comments?

--
Kalle Valo

Sorry for the delayed response I held up with some other work. Currently I am working with firmware team to address your comments.

--
Venkatesh.
Venkateswara Naralasetty May 30, 2017, 12:01 p.m. UTC | #6
-----Original Message-----
From: ath10k [mailto:ath10k-bounces@lists.infradead.org] On Behalf Of Venkateswara Naralasettty
Sent: Monday, May 22, 2017 8:48 PM
To: Kalle Valo <kvalo@qca.qualcomm.com>; nbd@nbd.name
Cc: linux-wireless@vger.kernel.org; ath10k@lists.infradead.org
Subject: RE: [PATCH] ath10k : Fix channel survey dump


-----Original Message-----
From: Kalle Valo
Sent: Friday, May 19, 2017 2:48 PM
To: nbd@nbd.name
Cc: Venkateswara Naralasettty <vnaralas@qti.qualcomm.com>; ath10k@lists.infradead.org; linux-wireless@vger.kernel.org
Subject: Re: [PATCH] ath10k : Fix channel survey dump

Felix Fietkau <nbd@nbd.name> writes:

> On 2017-04-26 16:41, Venkateswara Rao Naralasetty wrote:
>> Channel active/busy time are showing incorrect (less than previous or 
>> sometimes zero) for successive survey dump command.
>> 
>> example:
>> Survey data from wlan0
>>         frequency:                      5180 MHz [in use]
>>         channel active time:            54995 ms
>>         channel busy time:              432 ms
>>         channel receive time:           0 ms
>>         channel transmit time:          59 ms
>> Survey data from wlan0
>>         frequency:                      5180 MHz [in use]
>>         channel active time:            32592 ms
>>         channel busy time:              254 ms
>>         channel receive time:           0 ms
>>         channel transmit time:          0 ms
>> 
>> This patch fix this issue by assigning 'wmi_bss_survey_req_type'
>> as 'WMI_BSS_SURVEY_REQ_TYPE_READ'.
>> 
>> Firmware ver 10.4-3.4-00082
>> Hardware QCA4019
>> 
>> Signed-off-by: Venkateswara Rao Naralasetty 
>> <c_vnaral@qti.qualcomm.com>
>> ---
>>  drivers/net/wireless/ath/ath10k/mac.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/net/wireless/ath/ath10k/mac.c
>> b/drivers/net/wireless/ath/ath10k/mac.c
>> index 9977829..87a9b55 100644
>> --- a/drivers/net/wireless/ath/ath10k/mac.c
>> +++ b/drivers/net/wireless/ath/ath10k/mac.c
>> @@ -6621,7 +6621,7 @@ static void ath10k_reconfig_complete(struct ieee80211_hw *hw,
>>  				  struct ieee80211_channel *channel)  {
>>  	int ret;
>> -	enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ_CLEAR;
>> +	enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ;
>
> Does the firmware read the registers directly, or does it accumulate 
> the results in a way that can't overflow? If you don't clear the 
> counters on reset, the overflow will be problematic for the 
> current-channel stats. I think a better approach would be to use 
> READ_CLEAR for in-use channels and store the sum inside the driver.

Venkateswara, any comments?

--
Kalle Valo

Sorry for the delayed response I held up with some other work. Currently I am working with firmware team to address your comments.

--
Venkatesh.

> Firmware is not handling the overflow while accumulating the results,  we are looking into some other options to make it in host

-Venkatesh.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 9977829..87a9b55 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6621,7 +6621,7 @@  static void ath10k_reconfig_complete(struct ieee80211_hw *hw,
 				  struct ieee80211_channel *channel)
 {
 	int ret;
-	enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ_CLEAR;
+	enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ;
 
 	lockdep_assert_held(&ar->conf_mutex);