All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath9k: fix DFS detector synchronization
@ 2018-02-08 11:46 Timothy Redaelli
  2018-02-09  8:01 ` Kalle Valo
  2018-02-12 18:40 ` Felix Fietkau
  0 siblings, 2 replies; 6+ messages in thread
From: Timothy Redaelli @ 2018-02-08 11:46 UTC (permalink / raw)
  To: linux-wireless; +Cc: QCA ath9k Development, Felix Fietkau

The code currently syncronize the DFS region only if curchan != 0, but hostapd
launch DFS before the channel is set and so set_dfs_domain is never executed.

CC: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 drivers/net/wireless/ath/ath9k/init.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index e479fae5aab9..b71b16715f6a 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -257,6 +257,11 @@ static void ath9k_reg_notifier(struct wiphy *wiphy,
 
 	ath_reg_notifier_apply(wiphy, request, reg);
 
+	/* synchronize DFS detector if regulatory domain changed */
+	if (sc->dfs_detector != NULL)
+		sc->dfs_detector->set_dfs_domain(sc->dfs_detector,
+						 request->dfs_region);
+
 	/* Set tx power */
 	if (!ah->curchan)
 		return;
@@ -267,10 +272,6 @@ static void ath9k_reg_notifier(struct wiphy *wiphy,
 	ath9k_cmn_update_txpow(ah, sc->cur_chan->cur_txpower,
 			       sc->cur_chan->txpower,
 			       &sc->cur_chan->cur_txpower);
-	/* synchronize DFS detector if regulatory domain changed */
-	if (sc->dfs_detector != NULL)
-		sc->dfs_detector->set_dfs_domain(sc->dfs_detector,
-						 request->dfs_region);
 	ath9k_ps_restore(sc);
 }
 
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath9k: fix DFS detector synchronization
  2018-02-08 11:46 [PATCH] ath9k: fix DFS detector synchronization Timothy Redaelli
@ 2018-02-09  8:01 ` Kalle Valo
  2018-02-09 14:33   ` Timothy Redaelli
  2018-02-12 18:40 ` Felix Fietkau
  1 sibling, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2018-02-09  8:01 UTC (permalink / raw)
  To: Timothy Redaelli; +Cc: linux-wireless, QCA ath9k Development, Felix Fietkau

Timothy Redaelli <tredaelli@redhat.com> writes:

> The code currently syncronize the DFS region only if curchan != 0, but hostapd
> launch DFS before the channel is set and so set_dfs_domain is never executed.
>
> CC: Felix Fietkau <nbd@nbd.name>
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>

What kind of bug does this fix? Please describe the symptoms from user's
point of view.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath9k: fix DFS detector synchronization
  2018-02-09  8:01 ` Kalle Valo
@ 2018-02-09 14:33   ` Timothy Redaelli
  2018-02-12 12:44     ` Kalle Valo
  0 siblings, 1 reply; 6+ messages in thread
From: Timothy Redaelli @ 2018-02-09 14:33 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, QCA ath9k Development, Felix Fietkau

On Fri, 09 Feb 2018 10:01:09 +0200
Kalle Valo <kvalo@codeaurora.org> wrote:

> Timothy Redaelli <tredaelli@redhat.com> writes:
> 
> > The code currently syncronize the DFS region only if curchan != 0,
> > but hostapd launch DFS before the channel is set and so
> > set_dfs_domain is never executed.
> >
> > CC: Felix Fietkau <nbd@nbd.name>
> > Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>  
> 
> What kind of bug does this fix? Please describe the symptoms from
> user's point of view.

With the current code radar detection (CAC) doesn't work on ath9k
since "dpd_set_domain" is only called once with NL80211_DFS_UNSET (0) as
region and so "dpd_add_pulse" always returns true (radar detected)
without doing a real scan.

You can test it easily with a kernel built with
CONFIG_ATH9K_DFS_CERTIFIED and by using a simple hostapd configuration:

interface=wlp1s0
hw_mode=a
channel=acs_survey
chanlist=100 104 108 112 116 120 124 128 132 136 140
ieee80211d=1
ieee80211h=1
country_code=US
ieee80211n=1
wmm_enabled=1
ssid=testwifi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath9k: fix DFS detector synchronization
  2018-02-09 14:33   ` Timothy Redaelli
@ 2018-02-12 12:44     ` Kalle Valo
  2018-02-12 15:27       ` Zefir Kurtisi
  0 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2018-02-12 12:44 UTC (permalink / raw)
  To: Timothy Redaelli; +Cc: linux-wireless, QCA ath9k Development, Felix Fietkau

Timothy Redaelli <tredaelli@redhat.com> writes:

> On Fri, 09 Feb 2018 10:01:09 +0200
> Kalle Valo <kvalo@codeaurora.org> wrote:
>
>> Timothy Redaelli <tredaelli@redhat.com> writes:
>> 
>> > The code currently syncronize the DFS region only if curchan != 0,
>> > but hostapd launch DFS before the channel is set and so
>> > set_dfs_domain is never executed.
>> >
>> > CC: Felix Fietkau <nbd@nbd.name>
>> > Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>  
>> 
>> What kind of bug does this fix? Please describe the symptoms from
>> user's point of view.
>
> With the current code radar detection (CAC) doesn't work on ath9k
> since "dpd_set_domain" is only called once with NL80211_DFS_UNSET (0) as
> region and so "dpd_add_pulse" always returns true (radar detected)
> without doing a real scan.
>
> You can test it easily with a kernel built with
> CONFIG_ATH9K_DFS_CERTIFIED and by using a simple hostapd configuration:
>
> interface=wlp1s0
> hw_mode=a
> channel=acs_survey
> chanlist=100 104 108 112 116 120 124 128 132 136 140
> ieee80211d=1
> ieee80211h=1
> country_code=US
> ieee80211n=1
> wmm_enabled=1
> ssid=testwifi

Any ideas what broke this? Or has it never worked with FCC (US)?

Anyway, please add this info to the commit log and submit v2.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath9k: fix DFS detector synchronization
  2018-02-12 12:44     ` Kalle Valo
@ 2018-02-12 15:27       ` Zefir Kurtisi
  0 siblings, 0 replies; 6+ messages in thread
From: Zefir Kurtisi @ 2018-02-12 15:27 UTC (permalink / raw)
  To: Kalle Valo, Timothy Redaelli
  Cc: linux-wireless, QCA ath9k Development, Felix Fietkau

On 02/12/2018 01:44 PM, Kalle Valo wrote:
> Timothy Redaelli <tredaelli@redhat.com> writes:
> 
>> On Fri, 09 Feb 2018 10:01:09 +0200
>> Kalle Valo <kvalo@codeaurora.org> wrote:
>>
>>> Timothy Redaelli <tredaelli@redhat.com> writes:
>>>
>>>> The code currently syncronize the DFS region only if curchan != 0,
>>>> but hostapd launch DFS before the channel is set and so
>>>> set_dfs_domain is never executed.
>>>>
>>>> CC: Felix Fietkau <nbd@nbd.name>
>>>> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>  
>>>
>>> What kind of bug does this fix? Please describe the symptoms from
>>> user's point of view.
>>
>> With the current code radar detection (CAC) doesn't work on ath9k
>> since "dpd_set_domain" is only called once with NL80211_DFS_UNSET (0) as
>> region and so "dpd_add_pulse" always returns true (radar detected)
>> without doing a real scan.
>>
>> You can test it easily with a kernel built with
>> CONFIG_ATH9K_DFS_CERTIFIED and by using a simple hostapd configuration:
>>
>> interface=wlp1s0
>> hw_mode=a
>> channel=acs_survey
>> chanlist=100 104 108 112 116 120 124 128 132 136 140
>> ieee80211d=1
>> ieee80211h=1
>> country_code=US
>> ieee80211n=1
>> wmm_enabled=1
>> ssid=testwifi
> 
> Any ideas what broke this? Or has it never worked with FCC (US)?
> 
> Anyway, please add this info to the commit log and submit v2.
> 

Hi,

the idea / reasoning behind setting the DFS detector's initial regulatory domain
to UNSET is a fail-safe mechanism to ensure a proper countrycode is set before the
CAC is initiated.

It used to work for a long time, but might broke when the regdb was moved into the
kernel and with that the initialization order between channel and regulatory
domain changed.


Not tested, but patch looks sane.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath9k: fix DFS detector synchronization
  2018-02-08 11:46 [PATCH] ath9k: fix DFS detector synchronization Timothy Redaelli
  2018-02-09  8:01 ` Kalle Valo
@ 2018-02-12 18:40 ` Felix Fietkau
  1 sibling, 0 replies; 6+ messages in thread
From: Felix Fietkau @ 2018-02-12 18:40 UTC (permalink / raw)
  To: Timothy Redaelli, linux-wireless; +Cc: QCA ath9k Development

On 2018-02-08 12:46, Timothy Redaelli wrote:
> The code currently syncronize the DFS region only if curchan != 0, but hostapd
> launch DFS before the channel is set and so set_dfs_domain is never executed.
> 
> CC: Felix Fietkau <nbd@nbd.name>
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Felix Fietkau <nbd@nbd.name>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-12 18:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08 11:46 [PATCH] ath9k: fix DFS detector synchronization Timothy Redaelli
2018-02-09  8:01 ` Kalle Valo
2018-02-09 14:33   ` Timothy Redaelli
2018-02-12 12:44     ` Kalle Valo
2018-02-12 15:27       ` Zefir Kurtisi
2018-02-12 18:40 ` Felix Fietkau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.