diff mbox

ath10k: Fix fetching channel during potential radar detection

Message ID 1488976412-8970-1-git-send-email-mohammed@qca.qualcomm.com (mailing list archive)
State Accepted
Commit a28f6f27a88f047f03f04b9246ca260ebc91455e
Delegated to: Kalle Valo
Headers show

Commit Message

Mohammed Shafi Shajakhan March 8, 2017, 12:33 p.m. UTC
From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>

Fetch target operating channel during potential radar detection when
the interface is just brought up, but no channel is assigned from
userspace. In this scenario rx_channel may not be having a valid pointer
hence fetch the target operating channel to avoid warnings as below
which can be triggered by the commands with DFS testing over longer run

comamnds:
iw wlan1 set type mesh
ifconfig wlan1 up (valid tgt_oper_chan only)
iw wlan1 cac trigger freq 5260 HT20 (valid rx_channel, tgt_oper_chan)
iw wlan1 cac trigger freq 5280 HT20
iw wlan1 cac trigger freq 5300 HT20

Once the CAC expires, current channel context will be removed and
we are only left with the fallback option of using 'target operating
channel'

Firmware and driver log:
ath: phy1: DFS: radar found on freq=5300: id=1, pri=1125, count=5,
count_false=4
ath: phy1: DFS: radar found on freq=5260: id=5, pri=3151, count=6,
count_false=11
ath: phy1: DFS: radar found on freq=5280: id=1, pri=1351, count=6,
count_false=4
ath: phy1: DFS: radar found on freq=5300: id=1, pri=1125, count=5,
count_false=4
ath10k_pci 0001:01:00.0: failed to derive channel for radar pulse,
treating as radar
ath10k_pci 0001:01:00.0: failed to derive channel for radar pulse,
treating as radar

Call trace:

WARNING: CPU: 1 PID: 2145 at
backports-20161201-3.14.77-9ab3068/net/wireless/chan.c:265
cfg80211_set_dfs_state+0x3c/0x88 [cfg80211]()

 Workqueue: phy1 ieee80211_dfs_radar_detected_work
[mac80211]
[<c0320770>] (warn_slowpath_null) from [<bf79b90c>]
(cfg80211_set_dfs_state+0x3c/0x88 [cfg80211])
[<bf79b90c>] (cfg80211_set_dfs_state [cfg80211]) from
[<bf79697c>] (cfg80211_radar_event+0xc4/0x140 [cfg80211])
[<bf79697c>] (cfg80211_radar_event [cfg80211]) from
[<bf83c058>] (ieee80211_dfs_radar_detected_work+0xa8/0xb4 [mac80211])
[<bf83c058>] (ieee80211_dfs_radar_detected_work
[mac80211]) from [<c0339518>] (process_one_work+0x298/0x4a4)

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/wmi.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Kalle Valo March 16, 2017, 8:58 a.m. UTC | #1
Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com> wrote:
> From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
> 
> Fetch target operating channel during potential radar detection when
> the interface is just brought up, but no channel is assigned from
> userspace. In this scenario rx_channel may not be having a valid pointer
> hence fetch the target operating channel to avoid warnings as below
> which can be triggered by the commands with DFS testing over longer run
> 
> comamnds:
> iw wlan1 set type mesh
> ifconfig wlan1 up (valid tgt_oper_chan only)
> iw wlan1 cac trigger freq 5260 HT20 (valid rx_channel, tgt_oper_chan)
> iw wlan1 cac trigger freq 5280 HT20
> iw wlan1 cac trigger freq 5300 HT20
> 
> Once the CAC expires, current channel context will be removed and
> we are only left with the fallback option of using 'target operating
> channel'
> 
> Firmware and driver log:
> ath: phy1: DFS: radar found on freq=5300: id=1, pri=1125, count=5,
> count_false=4
> ath: phy1: DFS: radar found on freq=5260: id=5, pri=3151, count=6,
> count_false=11
> ath: phy1: DFS: radar found on freq=5280: id=1, pri=1351, count=6,
> count_false=4
> ath: phy1: DFS: radar found on freq=5300: id=1, pri=1125, count=5,
> count_false=4
> ath10k_pci 0001:01:00.0: failed to derive channel for radar pulse,
> treating as radar
> ath10k_pci 0001:01:00.0: failed to derive channel for radar pulse,
> treating as radar
> 
> Call trace:
> 
> WARNING: CPU: 1 PID: 2145 at
> backports-20161201-3.14.77-9ab3068/net/wireless/chan.c:265
> cfg80211_set_dfs_state+0x3c/0x88 [cfg80211]()
> 
>  Workqueue: phy1 ieee80211_dfs_radar_detected_work
> [mac80211]
> [<c0320770>] (warn_slowpath_null) from [<bf79b90c>]
> (cfg80211_set_dfs_state+0x3c/0x88 [cfg80211])
> [<bf79b90c>] (cfg80211_set_dfs_state [cfg80211]) from
> [<bf79697c>] (cfg80211_radar_event+0xc4/0x140 [cfg80211])
> [<bf79697c>] (cfg80211_radar_event [cfg80211]) from
> [<bf83c058>] (ieee80211_dfs_radar_detected_work+0xa8/0xb4 [mac80211])
> [<bf83c058>] (ieee80211_dfs_radar_detected_work
> [mac80211]) from [<c0339518>] (process_one_work+0x298/0x4a4)
> 
> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>

Patch applied to ath-next branch of ath.git, thanks.

a28f6f27a88f ath10k: fix fetching channel during potential radar detection
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 2f1743e..1f83276 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -3643,6 +3643,11 @@  static void ath10k_dfs_radar_report(struct ath10k *ar,
 
 	spin_lock_bh(&ar->data_lock);
 	ch = ar->rx_channel;
+
+	/* fetch target operating channel during channel change */
+	if (!ch)
+		ch = ar->tgt_oper_chan;
+
 	spin_unlock_bh(&ar->data_lock);
 
 	if (!ch) {