mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>,
	Kalle Valo <kvalo@qca.qualcomm.com>,
	Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL for 3.18 10/63] ath10k: disallow DFS simulation if DFS channel is not enabled
Date: Sat, 3 Mar 2018 22:33:14 +0000	[thread overview]
Message-ID: <20180303223228.27323-10-alexander.levin@microsoft.com> (raw)
In-Reply-To: <20180303223228.27323-1-alexander.levin@microsoft.com>

From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>

[ Upstream commit ca07baab0b1e627ae1d4a55d190fb1c9d32a3445 ]

If DFS is not enabled in hostapd (ieee80211h=0) DFS channels shall
not be available for use even though the hardware may have the capability
to support DFS. With this configuration (DFS disabled in hostapd) trying to
bring up ath10k device in DFS channel for AP mode fails and trying to
simulate DFS in ath10k debugfs results in a warning in cfg80211 complaining
invalid channel and this should be avoided in the driver itself rather than
false propogating RADAR detection to mac80211/cfg80211. Fix this by
checking for the first vif 'is_started' state(should work for client mode
as well) as all the vifs shall be configured for the same channel

sys/kernel/debug/ieee80211/phy1/ath10k# echo 1 > dfs_simulate_radar

WARNING: at net/wireless/chan.c:265 cfg80211_radar_event+0x24/0x60
Workqueue: phy0 ieee80211_dfs_radar_detected_work [mac80211]
[<c022f2d4>] (warn_slowpath_null) from
[<bf72dab8>] (cfg80211_radar_event+0x24/0x60 [cfg80211])
[<bf72dab8>] (cfg80211_radar_event [cfg80211]) from
[<bf7813e0>] (ieee80211_dfs_radar_detected_work+0x94/0xa0 [mac80211])
[<bf7813e0>] (ieee80211_dfs_radar_detected_work [mac80211]) from
[<c0242320>] (process_one_work+0x20c/0x32c)

WARNING: at net/wireless/nl80211.c:2488 nl80211_get_mpath+0x13c/0x4cc
 Workqueue: phy0 ieee80211_dfs_radar_detected_work [mac80211]
[<c022f2d4>] (warn_slowpath_null) from
[<bf72dab8>] (cfg80211_radar_event+0x24/0x60 [cfg80211])
[<bf72dab8>] (cfg80211_radar_event [cfg80211]) from
[<bf7813e0>] (ieee80211_dfs_radar_detected_work+0x94/0xa0 [mac80211])
[<bf7813e0>] (ieee80211_dfs_radar_detected_work [mac80211]) from
[<c0242320>] (process_one_work+0x20c/0x32c)

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/net/wireless/ath/ath10k/debug.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 3756feba3223..d3ebac0d7f7a 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -1079,6 +1079,15 @@ static ssize_t ath10k_write_simulate_radar(struct file *file,
 					   size_t count, loff_t *ppos)
 {
 	struct ath10k *ar = file->private_data;
+	struct ath10k_vif *arvif;
+
+	/* Just check for for the first vif alone, as all the vifs will be
+	 * sharing the same channel and if the channel is disabled, all the
+	 * vifs will share the same 'is_started' state.
+	 */
+	arvif = list_first_entry(&ar->arvifs, typeof(*arvif), list);
+	if (!arvif->is_started)
+		return -EINVAL;
 
 	ieee80211_radar_detected(ar->hw);
 
-- 
2.14.1

  parent reply	other threads:[~2018-03-03 22:55 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-03 22:33 [PATCH AUTOSEL for 3.18 01/63] Input: tsc2007 - check for presence and power down tsc2007 during probe Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 02/63] kretprobes: Ensure probe location is at function entry Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 03/63] HID: reject input outside logical range only if null state is set Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 04/63] net: mvpp2: set dma mask and coherent dma mask on PPv2.2 Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 05/63] PCI/MSI: Stop disabling MSI/MSI-X in pci_device_shutdown() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 07/63] perf tools: Make perf_event__synthesize_mmap_events() scale Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 06/63] selinux: check for address length in selinux_socket_bind() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 08/63] drivers: net: xgene: Fix hardware checksum setting Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 09/63] drm: Defer disabling the vblank IRQ until the next interrupt (for instant-off) Sasha Levin
2018-03-03 22:33 ` Sasha Levin [this message]
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 12/63] ARM: dts: Adjust moxart IRQ controller and flags Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 11/63] HID: clamp input to logical range if no null state Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 13/63] batman-adv: handle race condition for claims between gateways Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 14/63] of: fix of_device_get_modalias returned length when truncating buffers Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 15/63] scsi: ipr: Fix missed EH wakeup Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 16/63] [media] media: i2c/soc_camera: fix ov6650 sensor getting wrong clock Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 18/63] sched: act_csum: don't mangle TCP and UDP GSO packets Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 17/63] timers, sched_clock: Update timeout for clock wrap Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 19/63] spi: omap2-mcspi: poll OMAP2_MCSPI_CHSTAT_RXS for PIO transfer Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 20/63] tcp: sysctl: Fix a race to avoid unexpected 0 window from space Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 22/63] mm: Fix false-positive VM_BUG_ON() in page_cache_{get,add}_speculative() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 21/63] powerpc/xmon: Fix an unexpected xmon on/off state change Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 23/63] blk-throttle: make sure expire time isn't too big Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 24/63] ARM: DRA7: hwmod_data: Prevent wait_target_disable error for usb_otg_ss Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 25/63] braille-console: Fix value returned by _braille_console_setup Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 26/63] ARM: dts: r8a7790: Correct parent of SSI[0-9] clocks Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 27/63] ARM: dts: r8a7791: " Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 28/63] powerpc: Avoid taking a data miss on every userspace instruction miss Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 30/63] reiserfs: Make cancel_old_flush() reliable Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 29/63] net/faraday: Add missing include of of.h Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 31/63] fm10k: correctly check if interface is removed Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 32/63] apparmor: Make path_max parameter readonly Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 33/63] iommu/iova: Fix underflow bug in __alloc_and_insert_iova_range Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 34/63] ARM: dts: rockchip: disable arm-global-timer for rk3188 Sasha Levin
2018-03-04 23:20   ` Alexander Kochetkov
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 35/63] video: ARM CLCD: fix dma allocation size Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 37/63] MIPS: BPF: Quit clobbering callee saved registers in JIT code Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 36/63] drm/radeon: Fail fb creation from imported dma-bufs Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 38/63] regulator: isl9305: fix array size Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 39/63] usb: gadget: dummy_hcd: Fix wrong power status bit clear/reset in dummy_hub_control() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 40/63] perf inject: Copy events when reordering events in pipe mode Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 42/63] scsi: sg: check for valid direction before starting the request Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 41/63] perf session: Don't rely on evlist in pipe mode Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 43/63] scsi: sg: close race condition in sg_remove_sfp_usercontext() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 44/63] kprobes/x86: Fix kprobe-booster not to boost far call instructions Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 45/63] kprobes/x86: Set kprobes pages read-only Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 46/63] wil6210: fix memory access violation in wil_memcpy_from/toio_32 Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 47/63] HID: elo: clear BTN_LEFT mapping Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 48/63] sched: Stop resched_cpu() from sending IPIs to offline CPUs Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 50/63] mtd: nand: fix interpretation of NAND_CMD_NONE in nand_command[_lp]() Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 49/63] net: xfrm: allow clearing socket xfrm policies Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 52/63] ARM: dts: omap3-n900: Fix the audio CODEC's reset pin Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 51/63] ARM: dts: am335x-pepper: " Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 54/63] ASoC: tlv320aic31xx: Handle inverted BCLK in non-DSP modes Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 53/63] mtd: nand: ifc: update bufnum mask for ver >= 2.0.0 Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 55/63] tools/usbip: fixes build with musl libc toolchain Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 57/63] scsi: devinfo: apply to HP XP the same flags as Hitachi VSP Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 56/63] spi: sun6i: disable/unprepare clocks on remove Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 58/63] media: cpia2: Fix a couple off by one bugs Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 60/63] mac80211: remove BUG() when interface type is invalid Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 59/63] veth: set peer GSO values Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 61/63] ASoC: nuc900: Fix a loop timeout test Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 62/63] rcutorture/configinit: Fix build directory error message Sasha Levin
2018-03-03 22:33 ` [PATCH AUTOSEL for 3.18 63/63] ima: relax requiring a file signature for new files with zero length Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180303223228.27323-10-alexander.levin@microsoft.com \
    --to=alexander.levin@microsoft.com \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mohammed@qti.qualcomm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®