2013-10-17 18:23:39

by Michal Kazior

[permalink] [raw]
Subject: [PATCH 1/2] cfg80211: fix DFS channel recovery timeout

The timeout was not properly converted from msecs
to jiffies. As a result channel transition to
NL80211_DFS_USABLE was delayed depending on
CONFIG_HZ configuration, e.g. HZ=100 would delay
the NOP from 30 minutes to 300 minutes.

Signed-off-by: Michal Kazior <[email protected]>
---
net/wireless/mlme.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 8d49c1c..edfe6de 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -707,8 +707,8 @@ void cfg80211_dfs_channels_update_work(struct work_struct *work)
if (c->dfs_state != NL80211_DFS_UNAVAILABLE)
continue;

- timeout = c->dfs_state_entered +
- IEEE80211_DFS_MIN_NOP_TIME_MS;
+ timeout = c->dfs_state_entered + msecs_to_jiffies(
+ IEEE80211_DFS_MIN_NOP_TIME_MS);

if (time_after_eq(jiffies, timeout)) {
c->dfs_state = NL80211_DFS_USABLE;
--
1.8.4.rc3



2013-10-17 18:23:42

by Michal Kazior

[permalink] [raw]
Subject: [PATCH 2/2] cfg80211: update dfs_state_entered upon dfs_state change

The timestamp wasn't updated after transitioning
to the NL80211_DFS_USABLE state after NOP time.

Signed-off-by: Michal Kazior <[email protected]>
---
net/wireless/mlme.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index edfe6de..6a6b1c8 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -712,6 +712,8 @@ void cfg80211_dfs_channels_update_work(struct work_struct *work)

if (time_after_eq(jiffies, timeout)) {
c->dfs_state = NL80211_DFS_USABLE;
+ c->dfs_state_entered = jiffies;
+
cfg80211_chandef_create(&chandef, c,
NL80211_CHAN_NO_HT);

--
1.8.4.rc3


2013-10-21 13:04:38

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2] cfg80211: fix DFS channel recovery timeout

On Thu, 2013-10-17 at 11:21 -0700, Michal Kazior wrote:
> The timeout was not properly converted from msecs
> to jiffies. As a result channel transition to
> NL80211_DFS_USABLE was delayed depending on
> CONFIG_HZ configuration, e.g. HZ=100 would delay
> the NOP from 30 minutes to 300 minutes.

Applied both, but I think getting into 3.12 might be hard.

johannes