Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH] cfg80211: Add HT and VHT information in start_ap
From: Malinen, Jouni @ 2016-08-16 12:34 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org, Xu, Peng
In-Reply-To: <1471330367.16783.23.camel@sipsolutions.net>

On Tue, Aug 16, 2016 at 08:52:47AM +0200, Johannes Berg wrote:
> On Mon, 2016-08-15 at 21:07 +0300, Jouni Malinen wrote:
> > From: Peng Xu <pxu@qca.qualcomm.com>
> > Add HT and VHT information in struct cfg80211_ap_settings when
> > starting ap so that driver does not need to parse IE to obtain
> > the information.
>=20
> > +enum ht_vht_support {
> > +	HT_VHT_DISABLED,
> > +	HT_VHT_ENABLED,
> > +	HT_VHT_NOT_INDICATED
> > +};
>=20
> So if you get HT_VHT_NOT_INDICATED in the driver, don't you *still*
> have to parse the IEs?

Well.. Yes, I guess one would need to do that for some time until
relevant user space is expected to have been updated to support the new
attribute.

> Arguably, cfg80211 could know itself by parsing though, so it could
> already fall back to that, no?
>=20
> But if you do that, you already need the parsing code, so then perhaps
> it would make sense to just always use the parsing in cfg80211? Or
> export a parsing function to use in driver(s)?

I guess that could be considered reasonable approach for the existing
HT and VHT cases and new attributes would obviously be significantly
easier to introduce with new extensions (need to remember to do this for
HE from the beginning..).

The parsing for these HT/VHT enabled/required is a bit strange
combination having to go over three IEs. I'm not sure a parsing function
to do so would be that nice.. The parsing code could indeed be moved to
cfg80211 so that it would not need to be duplicated into each driver
needing this, though.

--=20
Jouni Malinen                                            PGP id EFC895FA=

^ permalink raw reply

* regarding RTL8188SU
From: Sambhu R @ 2016-08-16 12:09 UTC (permalink / raw)
  To: linux-wireless

Hi,

I was following your--> https://github.com/chunkeey/rtl8192su but i couldn't install. When i execute ./install.sh i'm getting the following error.

make[1]: Entering directory '/usr/src/linux-headers-3.4.112-sun8i'
Makefile:568: /usr/src/linux-headers-3.4.112-sun8i/arch/armv7l/Makefile: No such file or directory
make[1]: *** No rule to make target '/usr/src/linux-headers-3.4.112-sun8i/arch/armv7l/Makefile'.  Stop.
make[1]: Leaving directory '/usr/src/linux-headers-3.4.112-sun8i'
Makefile:220: recipe for target 'modules' failed
make: *** [modules] Error 2
##################################################
Compile make driver error: 2
Please check error Mesg
##################################################

please help..

OS details:
Distributor ID:	Debian
Description:	Debian GNU/Linux 8.5 (jessie)
Release:	8.5
Codename:	jessie
Linux orangePi1 3.4.112-sun8i #8 SMP PREEMPT  armv7l GNU/Linux








-- Disclaimer:     The information transmitted in this email, including attachments, is intended only for the person(s) or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.Any views expressed in any message are those of the individual sender and may not necessarily reflect the views of Amrita University. If you received this in error, please contact the sender and destroy any copies of this information. 

^ permalink raw reply

* [PATCH] mwifiex: fix missing break on IEEE80211_STYPE_ACTION case
From: Colin King @ 2016-08-16 12:10 UTC (permalink / raw)
  To: Amitkumar Karwar, Nishant Sarmukadam, Kalle Valo, linux-wireless,
	netdev
  Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The IEEE80211_STYPE_ACTION case is missing a break in the switch
statement, causing it to fall through to the default case that
reports a debug message about an unknown frame subtype. Fix this
by adding in the missing break statement.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/marvell/mwifiex/util.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c
index 6681be0..18fbb96 100644
--- a/drivers/net/wireless/marvell/mwifiex/util.c
+++ b/drivers/net/wireless/marvell/mwifiex/util.c
@@ -386,6 +386,7 @@ mwifiex_parse_mgmt_packet(struct mwifiex_private *priv, u8 *payload, u16 len,
 				    "unknown public action frame category %d\n",
 				    category);
 		}
+		break;
 	default:
 		mwifiex_dbg(priv->adapter, INFO,
 		    "unknown mgmt frame subtype %#x\n", stype);
-- 
2.8.1

^ permalink raw reply related

* Re: Configuring Minstrel-Blues
From: Sven Eckelmann @ 2016-08-16 12:08 UTC (permalink / raw)
  To: Sebastian Gottschall
  Cc: Mike Mu, linux-wireless, Stanley Mui, Thomas Hühn
In-Reply-To: <f32852ed-0fee-1711-e26d-5a41f831267a@dd-wrt.com>

[-- Attachment #1: Type: text/plain, Size: 507 bytes --]

On Monday, August 15, 2016 11:48:35 PM CEST Sebastian Gottschall wrote:
[...]
> > To test, I ran iperf from the AP to a station very close by. I
> > captured the packets to look at the RSSI with and without the
> > Minstrel-Blues patches applied, but did not see any difference in
> > RSSI.
> 
> why do you think that a rate control algorithm will change the rssi?

https://www.linuxplumbersconf.org/2014/ocw/system/presentations/2439/original/Minstrel-Blues%20@LinuxPlumbers%202014.pdf

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* [ANNOUNCE] Netdev 1.2 updates (16th August, 2016)
From: Hajime Tazaki @ 2016-08-16  7:29 UTC (permalink / raw)
  To: netdev, netfilter-devel, linux-wireless, netdev-conference


Hello folks,

I hope all of you're fine.

Here is an update for coming Netdev 1.2 Tokyo.

* Summary
1) extended early-bird registration
2) paper submission deadline
3) slides submission deadline
4) newly accepted sessions

So here we go.

1) extended early bird registration deadline
Due to numerous requests, we'd like to extend the deadline
for the early bird registration of netdev 1.2 (Tokyo).

The new deadline is August 31 2016.  Please don't miss the
discount ticket - and your early registration will be
definitely helpful to prepare the conference.

http://netdevconf.org/1.2/registration.html


2) paper submission deadline
(This is only for the speakers of Talk)
If you're a speaker of talk at the conference, please be
prepared a PDF and submit to us once it's ready.

The due date is September 26, 2016.

for more information, please look at the page below.

http://netdevconf.org/1.2/submit-proposal.html


3) slides submission deadline
(This is for all of speakers including Talks, Tutorials,
BoFs, Workshops)
Please submit slide decks to us once your presentation
material is ready to go.

The due date is October 3, 2016.

for more information, please look at the page below.

http://netdevconf.org/1.2/submit-proposal.html


4) New accepted sessions

Here is the newly accepted sessions.  We will announce more
sessions once we got confirmed.

http://netdevconf.org/1.2/accepted-sessions.html

* Talk
- Implementing IPv6 Segment Routing 
  by David Lebrun

- Kernel TLS (Transport Layer Security) Socket
  by Dave Watson

- Making Linux TCP Fast
 by Yuchung Cheng, Neal Cardwell


Our sponsors:
- Platinum
Verizon, Facebook, Cumulus Networks
- Gold
Mojatatu Networks, VMWare, Google, NTT
- Silver
NetApp, IIJ, Netronome, SolarFlare, Mellanox

Twitter: https://twitter.com/netdev01
Web: http://netdevconf.org/1.2/

-- Hajime

^ permalink raw reply

* [PATCH v3] nl80211: Allow GET_INTERFACE dumps to be filtered
From: Johannes Berg @ 2016-08-16  7:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: Denis Kenzior

From: Denis Kenzior <denkenz@gmail.com>

This patch allows GET_INTERFACE dumps to be filtered based on
NL80211_ATTR_WIPHY or NL80211_ATTR_WDEV.  The documentation for
GET_INTERFACE mentions that this is possible:
"Request an interface's configuration; either a dump request on
a %NL80211_ATTR_WIPHY or ..."

However, this behavior has not been implemented until now.

Johannes: rewrite most of the patch:
 * use nl80211_dump_wiphy_parse() to also allow passing an interface
   to be able to dump its siblings
 * fix locking (must hold rtnl around using nl80211_fam.attrbuf)
 * make init self-contained instead of relying on other cb->args

Signed-off-by: Denis Kenzior <denkenz@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/nl80211.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 499785778983..95d55d2b8a0f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2525,10 +2525,33 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback *
 	int if_idx = 0;
 	int wp_start = cb->args[0];
 	int if_start = cb->args[1];
+	int filter_wiphy = -1;
 	struct cfg80211_registered_device *rdev;
 	struct wireless_dev *wdev;
 
 	rtnl_lock();
+	if (!cb->args[2]) {
+		struct nl80211_dump_wiphy_state state = {};
+		int ret;
+
+		ret = nl80211_dump_wiphy_parse(skb, cb, &state);
+		if (ret)
+			return ret;
+
+		filter_wiphy = state.filter_wiphy;
+
+		/*
+		 * if filtering, set cb->args[2] to +1 since 0 is the default
+		 * value needed to determine that parsing is necessary.
+		 */
+		if (filter_wiphy >= 0)
+			cb->args[2] = filter_wiphy + 1;
+		else
+			cb->args[2] = -1;
+	} else if (cb->args[2] > 0) {
+		filter_wiphy = cb->args[2] - 1;
+	}
+
 	list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
 		if (!net_eq(wiphy_net(&rdev->wiphy), sock_net(skb->sk)))
 			continue;
@@ -2536,6 +2559,10 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback *
 			wp_idx++;
 			continue;
 		}
+
+		if (filter_wiphy >= 0 && filter_wiphy != rdev->wiphy_idx)
+			continue;
+
 		if_idx = 0;
 
 		list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
-- 
2.8.1

^ permalink raw reply related

* Re: [PATCH v2] nl80211: Allow GET_INTERFACE dumps to be filtered
From: Johannes Berg @ 2016-08-16  7:11 UTC (permalink / raw)
  To: Denis Kenzior, linux-wireless
In-Reply-To: <1471018357-3047-1-git-send-email-denkenz@gmail.com>


>  static int nl80211_dump_interface(struct sk_buff *skb, struct
> netlink_callback *cb)
>  {
> -	int wp_idx = 0;
> -	int if_idx = 0;
> -	int wp_start = cb->args[0];
> -	int if_start = cb->args[1];
>  	struct cfg80211_registered_device *rdev;
>  	struct wireless_dev *wdev;
> +	unsigned int wp_idx = 0;
> +	unsigned int if_idx;
> +	static struct dump_interface_context static_ctx;
> +	struct dump_interface_context *ctx = cb->args[0];
> +
> +	if (!ctx) {
> +		int ret;
> +
> +		static_ctx.wp_start = 0;
> +		static_ctx.if_start = 0;
> +		static_ctx.filter_wiphy = -1;
> +
> +		ret = nl80211_dump_interface_parse(skb, cb,
> +						   &static_ctx.filte
> r_wiphy);
> +		if (ret)
> +			return ret;
> +
> +		ctx = &static_ctx;
> +		cb->args[0] = ctx;

You can't do this, multiple applications are allowed to dump at the
same time. I think I'll take your previous patch and adjust it a bit.

johannes

^ permalink raw reply

* Re: [PATCH] cfg80211: Add HT and VHT information in start_ap
From: Johannes Berg @ 2016-08-16  6:52 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: linux-wireless, Peng Xu
In-Reply-To: <1471284424-12142-1-git-send-email-jouni@qca.qualcomm.com>

On Mon, 2016-08-15 at 21:07 +0300, Jouni Malinen wrote:
> From: Peng Xu <pxu@qca.qualcomm.com>
> 
> Add HT and VHT information in struct cfg80211_ap_settings when
> starting ap so that driver does not need to parse IE to obtain
> the information.

> +enum ht_vht_support {
> +	HT_VHT_DISABLED,
> +	HT_VHT_ENABLED,
> +	HT_VHT_NOT_INDICATED
> +};

So if you get HT_VHT_NOT_INDICATED in the driver, don't you *still*
have to parse the IEs?

Arguably, cfg80211 could know itself by parsing though, so it could
already fall back to that, no?

But if you do that, you already need the parsing code, so then perhaps
it would make sense to just always use the parsing in cfg80211? Or
export a parsing function to use in driver(s)?

> @@ -719,6 +729,11 @@ struct cfg80211_ap_settings {
>  	bool p2p_opp_ps;
>  	const struct cfg80211_acl_data *acl;
>  	bool pbss;
> +	enum ht_vht_support ht_enabled;
> +	enum ht_vht_support vht_enabled;
> +	enum ht_vht_support require_ht;
> +	enum ht_vht_support require_vht;
> +

(nit - extra blank line)

johannes

^ permalink raw reply

* Re: [BUGFIX PATCH 1/2] brcmfmac: Check rtnl_lock is locked when removing interface
From: Masami Hiramatsu @ 2016-08-16  2:27 UTC (permalink / raw)
  To: Arend Van Spriel
  Cc: Rafał Miłecki, Kalle Valo, Masami Hiramatsu, Franky Lin,
	Hante Meuleman, Pieter-Paul Giesberts,
	linux-wireless@vger.kernel.org,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	Network Development, Linux Kernel Mailing List
In-Reply-To: <15e43df4-b8cc-8612-472e-80634cf27cac@broadcom.com>

On Mon, 15 Aug 2016 23:44:05 +0200
Arend Van Spriel <arend.vanspriel@broadcom.com> wrote:

> 
> 
> On 15-8-2016 13:52, Rafał Miłecki wrote:
> > On 15 August 2016 at 12:57, Kalle Valo <kvalo@codeaurora.org> wrote:
> >> Rafał Miłecki <zajec5@gmail.com> writes:
> >>
> >>>> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> >>>
> >>> Fixes: a63b09872c1d ("brcmfmac: delete interface directly in code that sent fw request")
> >>> Acked-by: Rafał Miłecki <rafal@milecki.pl>
> >>>
> >>> Kalle: I'm acking this as bugfix for 4.8 release.
> >>
> >> Ok. I'll wait few days for more comments before I apply this.

Thanks!

> > 
> > Sure.
> > 
> > 
> >> (I assume you are talking only about patch 1)
> > 
> > Yes, I'll leave mutex vs. spinlock to the experts :)
> 
> Don't know who the experts are. Surely not me :-p
> 
> I made an uneducated design decision using a mutex for this. The
> reasoning for using a regular spinlock make sense. So I will go and ack
> that patch.

As far as I can see, that change is very local and
at least my environment it works well :)

Regards,

> 
> Regards,
> Arend


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply

* Re: Configuring Minstrel-Blues
From: Sebastian Gottschall @ 2016-08-15 21:48 UTC (permalink / raw)
  To: Mike Mu, linux-wireless; +Cc: Stanley Mui
In-Reply-To: <CAGTDyhHOxwTiXtsWuy1cLq+eraikTs9McS0kUBXS2W6B09CwgQ@mail.gmail.com>

Am 15.08.2016 um 23:41 schrieb Mike Mu:
> Hi Linux-Wireless,
>
> I am trying to enable Minstrel-Blues for the ath9k chipset that's used
> in Google Fiber's access points. I applied the patches in
> https://github.com/thuehn/Minstrel-Blues/tree/master/src onto our
> backports-20160122 tree, with some unsuspicious merge conflicts, and
> built an image.
>
> To test, I ran iperf from the AP to a station very close by. I
> captured the packets to look at the RSSI with and without the
> Minstrel-Blues patches applied, but did not see any difference in
> RSSI.
why do you think that a rate control algorithm will change the rssi?
> Is there anything I need to configure first to make it work? Is it
> possible that I'm missing a patch that's not in backports-20160122?
>
> Thanks!
> Mike
>


-- 
Mit freundlichen Grüssen / Regards

Sebastian Gottschall / CTO

NewMedia-NET GmbH - DD-WRT
Firmensitz:  Berliner Ring 101, 64625 Bensheim
Registergericht: Amtsgericht Darmstadt, HRB 25473
Geschäftsführer: Peter Steinhäuser, Christian Scheele
http://www.dd-wrt.com
email: s.gottschall@dd-wrt.com
Tel.: +496251-582650 / Fax: +496251-5826565

^ permalink raw reply

* Re: [BUGFIX PATCH 2/2] brcmfmac: Change vif_event_lock to spinlock
From: Arend Van Spriel @ 2016-08-15 21:46 UTC (permalink / raw)
  To: Masami Hiramatsu, Franky Lin, Hante Meuleman, Kalle Valo,
	Pieter-Paul Giesberts, Rafał Miłecki
  Cc: linux-wireless, brcm80211-dev-list.pdl, netdev, linux-kernel
In-Reply-To: <147125407193.9434.3055117303208933493.stgit@devbox>

On 15-8-2016 11:41, Masami Hiramatsu wrote:
> Change vif_event_lock to spinlock from mutex, since this lock is
> used in wait_event_timeout() via vif_event_equals(). This caused
> a warning report as below.
> 
> As far as I can see, this lock protects regions where updating
> structure members, not function calls. Also, since those
> regions are not called from interrupt handlers (of course, it
> was a mutex), spin_lock is used instead of spin_lock_irqsave.
> 
> [  186.678550] ------------[ cut here ]------------
> [  186.678556] WARNING: CPU: 2 PID: 7140 at /home/mhiramat/ksrc/linux/kernel/sched/core.c:7545 __might_sleep+0x7c/0x80
> [  186.678560] do not call blocking ops when !TASK_RUNNING; state=2 set at [<ffffffff980d9090>] prepare_to_wait_event+0x60/0x100
> [  186.678560] Modules linked in: brcmfmac xt_CHECKSUM rfcomm ipt_MASQUERADE nf_nat_masquerade_ipv4 xt_addrtype br_netfilter xt_tcpudp ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_raw ip6table_security ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_filter ip6_tables iptable_raw iptable_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_filter ip_tables x_tables bnep nls_iso8859_1 i2c_designware_platform i2c_designware_core snd_hda_codec_hdmi snd_hda_codec_realtek dcdbas snd_hda_codec_generic snd_hda_intel snd_hda_codec intel_rapl snd_hda_core x86_pkg_temp_thermal intel_powerclamp coretemp
> [  186.678594]  snd_pcm crct10dif_pclmul crc32_pclmul aesni_intel aes_x86_64 joydev glue_helper snd_hwdep lrw gf128mul uvcvideo ablk_helper snd_seq_midi cryptd snd_seq_midi_event snd_rawmidi videobuf2_vmalloc videobuf2_memops snd_seq input_leds videobuf2_v4l2 cfg80211 videobuf2_core snd_timer videodev serio_raw btusb snd_seq_device media btrtl rtsx_pci_ms snd mei_me memstick hid_multitouch mei soundcore brcmutil idma64 virt_dma intel_lpss_pci processor_thermal_device intel_soc_dts_iosf hci_uart btbcm btqca btintel bluetooth int3403_thermal dell_smo8800 intel_lpss_acpi intel_lpss int3402_thermal int340x_thermal_zone intel_hid mac_hid int3400_thermal shpchp sparse_keymap acpi_pad acpi_thermal_rel acpi_als kfifo_buf industrialio kvm_intel kvm irqbypass parport_pc ppdev lp parport autofs4 btrfs xor raid6_pq
> [  186.678631]  usbhid nouveau ttm i915 rtsx_pci_sdmmc mxm_wmi i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops psmouse drm ahci rtsx_pci nvme nvme_core libahci i2c_hid hid pinctrl_sunrisepoint video wmi pinctrl_intel fjes [last unloaded: brcmfmac]
> [  186.678646] CPU: 2 PID: 7140 Comm: wpa_supplicant Not tainted 4.8.0-rc1+ #8
> [  186.678647] Hardware name: Dell Inc. XPS 15 9550/0N7TVV, BIOS 01.02.00 04/07/2016
> [  186.678648]  0000000000000000 ffff9d8c64b5b900 ffffffff98442f23 ffff9d8c64b5b950
> [  186.678651]  0000000000000000 ffff9d8c64b5b940 ffffffff9808b22b 00001d790000000d
> [  186.678653]  ffffffff98c75e78 000000000000026c 0000000000000000 ffff9d8c2706d058
> [  186.678655] Call Trace:
> [  186.678659]  [<ffffffff98442f23>] dump_stack+0x85/0xc2
> [  186.678666]  [<ffffffff9808b22b>] __warn+0xcb/0xf0
> [  186.678668]  [<ffffffff9808b29f>] warn_slowpath_fmt+0x4f/0x60
> [  186.678671]  [<ffffffff980d9090>] ? prepare_to_wait_event+0x60/0x100
> [  186.678672]  [<ffffffff980d9090>] ? prepare_to_wait_event+0x60/0x100
> [  186.678674]  [<ffffffff980b922c>] __might_sleep+0x7c/0x80
> [  186.678680]  [<ffffffff988b0853>] mutex_lock_nested+0x33/0x3b0
> [  186.678682]  [<ffffffff980e5d8d>] ? trace_hardirqs_on+0xd/0x10
> [  186.678689]  [<ffffffffc0c57d2d>] brcmf_cfg80211_wait_vif_event+0xcd/0x130 [brcmfmac]
> [  186.678691]  [<ffffffff980d9190>] ? wake_atomic_t_function+0x60/0x60
> [  186.678697]  [<ffffffffc0c628e9>] brcmf_p2p_del_vif+0xf9/0x220 [brcmfmac]
> [  186.678702]  [<ffffffffc0c57fab>] brcmf_cfg80211_del_iface+0x21b/0x270 [brcmfmac]
> [  186.678716]  [<ffffffffc0b0539e>] nl80211_del_interface+0xfe/0x3a0 [cfg80211]
> [  186.678718]  [<ffffffff987ca335>] genl_family_rcv_msg+0x1b5/0x370
> [  186.678720]  [<ffffffff980e5d8d>] ? trace_hardirqs_on+0xd/0x10
> [  186.678721]  [<ffffffff987ca56d>] genl_rcv_msg+0x7d/0xb0
> [  186.678722]  [<ffffffff987ca4f0>] ? genl_family_rcv_msg+0x370/0x370
> [  186.678724]  [<ffffffff987c9a47>] netlink_rcv_skb+0x97/0xb0
> [  186.678726]  [<ffffffff987ca168>] genl_rcv+0x28/0x40
> [  186.678727]  [<ffffffff987c93c3>] netlink_unicast+0x1d3/0x2f0
> [  186.678729]  [<ffffffff987c933b>] ? netlink_unicast+0x14b/0x2f0
> [  186.678731]  [<ffffffff987c97cb>] netlink_sendmsg+0x2eb/0x3a0
> [  186.678733]  [<ffffffff9876dad8>] sock_sendmsg+0x38/0x50
> [  186.678734]  [<ffffffff9876e4df>] ___sys_sendmsg+0x27f/0x290
> [  186.678737]  [<ffffffff9828b935>] ? mntput_no_expire+0x5/0x3f0
> [  186.678739]  [<ffffffff9828b9be>] ? mntput_no_expire+0x8e/0x3f0
> [  186.678741]  [<ffffffff9828b935>] ? mntput_no_expire+0x5/0x3f0
> [  186.678743]  [<ffffffff9828bd44>] ? mntput+0x24/0x40
> [  186.678744]  [<ffffffff98267830>] ? __fput+0x190/0x200
> [  186.678746]  [<ffffffff9876f125>] __sys_sendmsg+0x45/0x80
> [  186.678748]  [<ffffffff9876f172>] SyS_sendmsg+0x12/0x20
> [  186.678749]  [<ffffffff988b5680>] entry_SYSCALL_64_fastpath+0x23/0xc1
> [  186.678751]  [<ffffffff980e2b8f>] ? trace_hardirqs_off_caller+0x1f/0xc0
> [  186.678752] ---[ end trace e224d66c5d8408b5 ]---

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
>  .../broadcom/brcm80211/brcmfmac/cfg80211.c         |   26 ++++++++++----------
>  .../broadcom/brcm80211/brcmfmac/cfg80211.h         |    2 +-
>  2 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> index 2628d5e..5db56a7 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -5635,7 +5635,7 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp,
>  		  ifevent->action, ifevent->flags, ifevent->ifidx,
>  		  ifevent->bsscfgidx);
>  
> -	mutex_lock(&event->vif_event_lock);
> +	spin_lock(&event->vif_event_lock);
>  	event->action = ifevent->action;
>  	vif = event->vif;
>  
> @@ -5643,7 +5643,7 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp,
>  	case BRCMF_E_IF_ADD:
>  		/* waiting process may have timed out */
>  		if (!cfg->vif_event.vif) {
> -			mutex_unlock(&event->vif_event_lock);
> +			spin_unlock(&event->vif_event_lock);
>  			return -EBADF;
>  		}
>  
> @@ -5654,24 +5654,24 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp,
>  			ifp->ndev->ieee80211_ptr = &vif->wdev;
>  			SET_NETDEV_DEV(ifp->ndev, wiphy_dev(cfg->wiphy));
>  		}
> -		mutex_unlock(&event->vif_event_lock);
> +		spin_unlock(&event->vif_event_lock);
>  		wake_up(&event->vif_wq);
>  		return 0;
>  
>  	case BRCMF_E_IF_DEL:
> -		mutex_unlock(&event->vif_event_lock);
> +		spin_unlock(&event->vif_event_lock);
>  		/* event may not be upon user request */
>  		if (brcmf_cfg80211_vif_event_armed(cfg))
>  			wake_up(&event->vif_wq);
>  		return 0;
>  
>  	case BRCMF_E_IF_CHANGE:
> -		mutex_unlock(&event->vif_event_lock);
> +		spin_unlock(&event->vif_event_lock);
>  		wake_up(&event->vif_wq);
>  		return 0;
>  
>  	default:
> -		mutex_unlock(&event->vif_event_lock);
> +		spin_unlock(&event->vif_event_lock);
>  		break;
>  	}
>  	return -EINVAL;
> @@ -5792,7 +5792,7 @@ static void wl_deinit_priv(struct brcmf_cfg80211_info *cfg)
>  static void init_vif_event(struct brcmf_cfg80211_vif_event *event)
>  {
>  	init_waitqueue_head(&event->vif_wq);
> -	mutex_init(&event->vif_event_lock);
> +	spin_lock_init(&event->vif_event_lock);
>  }
>  
>  static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
> @@ -6691,9 +6691,9 @@ static inline bool vif_event_equals(struct brcmf_cfg80211_vif_event *event,
>  {
>  	u8 evt_action;
>  
> -	mutex_lock(&event->vif_event_lock);
> +	spin_lock(&event->vif_event_lock);
>  	evt_action = event->action;
> -	mutex_unlock(&event->vif_event_lock);
> +	spin_unlock(&event->vif_event_lock);
>  	return evt_action == action;
>  }
>  
> @@ -6702,10 +6702,10 @@ void brcmf_cfg80211_arm_vif_event(struct brcmf_cfg80211_info *cfg,
>  {
>  	struct brcmf_cfg80211_vif_event *event = &cfg->vif_event;
>  
> -	mutex_lock(&event->vif_event_lock);
> +	spin_lock(&event->vif_event_lock);
>  	event->vif = vif;
>  	event->action = 0;
> -	mutex_unlock(&event->vif_event_lock);
> +	spin_unlock(&event->vif_event_lock);
>  }
>  
>  bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg)
> @@ -6713,9 +6713,9 @@ bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg)
>  	struct brcmf_cfg80211_vif_event *event = &cfg->vif_event;
>  	bool armed;
>  
> -	mutex_lock(&event->vif_event_lock);
> +	spin_lock(&event->vif_event_lock);
>  	armed = event->vif != NULL;
> -	mutex_unlock(&event->vif_event_lock);
> +	spin_unlock(&event->vif_event_lock);
>  
>  	return armed;
>  }
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
> index 7d77f86..8889832 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
> @@ -227,7 +227,7 @@ struct escan_info {
>   */
>  struct brcmf_cfg80211_vif_event {
>  	wait_queue_head_t vif_wq;
> -	struct mutex vif_event_lock;
> +	spinlock_t vif_event_lock;
>  	u8 action;
>  	struct brcmf_cfg80211_vif *vif;
>  };
> 

^ permalink raw reply

* Re: [BUGFIX PATCH 1/2] brcmfmac: Check rtnl_lock is locked when removing interface
From: Arend Van Spriel @ 2016-08-15 21:44 UTC (permalink / raw)
  To: Rafał Miłecki, Kalle Valo
  Cc: Masami Hiramatsu, Franky Lin, Hante Meuleman,
	Pieter-Paul Giesberts, linux-wireless@vger.kernel.org,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	Network Development, Linux Kernel Mailing List
In-Reply-To: <CACna6ryuN_qDrVwAbS5P9mfhjMwv2hNeTqEzTQ=WxvP1V=zHXA@mail.gmail.com>



On 15-8-2016 13:52, Rafał Miłecki wrote:
> On 15 August 2016 at 12:57, Kalle Valo <kvalo@codeaurora.org> wrote:
>> Rafał Miłecki <zajec5@gmail.com> writes:
>>
>>>> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
>>>
>>> Fixes: a63b09872c1d ("brcmfmac: delete interface directly in code that sent fw request")
>>> Acked-by: Rafał Miłecki <rafal@milecki.pl>
>>>
>>> Kalle: I'm acking this as bugfix for 4.8 release.
>>
>> Ok. I'll wait few days for more comments before I apply this.
> 
> Sure.
> 
> 
>> (I assume you are talking only about patch 1)
> 
> Yes, I'll leave mutex vs. spinlock to the experts :)

Don't know who the experts are. Surely not me :-p

I made an uneducated design decision using a mutex for this. The
reasoning for using a regular spinlock make sense. So I will go and ack
that patch.

Regards,
Arend

^ permalink raw reply

* Configuring Minstrel-Blues
From: Mike Mu @ 2016-08-15 21:41 UTC (permalink / raw)
  To: linux-wireless; +Cc: Stanley Mui

Hi Linux-Wireless,

I am trying to enable Minstrel-Blues for the ath9k chipset that's used
in Google Fiber's access points. I applied the patches in
https://github.com/thuehn/Minstrel-Blues/tree/master/src onto our
backports-20160122 tree, with some unsuspicious merge conflicts, and
built an image.

To test, I ran iperf from the AP to a station very close by. I
captured the packets to look at the RSSI with and without the
Minstrel-Blues patches applied, but did not see any difference in
RSSI.

Is there anything I need to configure first to make it work? Is it
possible that I'm missing a patch that's not in backports-20160122?

Thanks!
Mike

^ permalink raw reply

* [PATCH] cfg80211: Add HT and VHT information in start_ap
From: Jouni Malinen @ 2016-08-15 18:07 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Peng Xu, Jouni Malinen

From: Peng Xu <pxu@qca.qualcomm.com>

Add HT and VHT information in struct cfg80211_ap_settings when
starting ap so that driver does not need to parse IE to obtain
the information.

Signed-off-by: Peng Xu <pxu@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
---
 include/net/cfg80211.h       | 15 +++++++++++++++
 include/uapi/linux/nl80211.h | 16 ++++++++++++++++
 net/wireless/nl80211.c       | 28 ++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 9c23f4d3..6292d35 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -676,6 +676,12 @@ struct cfg80211_acl_data {
 	struct mac_address mac_addrs[];
 };
 
+enum ht_vht_support {
+	HT_VHT_DISABLED,
+	HT_VHT_ENABLED,
+	HT_VHT_NOT_INDICATED
+};
+
 /**
  * struct cfg80211_ap_settings - AP configuration
  *
@@ -700,6 +706,10 @@ struct cfg80211_acl_data {
  *	MAC address based access control
  * @pbss: If set, start as a PCP instead of AP. Relevant for DMG
  *	networks.
+ * @ht_enabled: if HT capability is enabled/disabled/not indicated
+ * @vht_enabled: if VHT capability is enabled/disabled/not indicated
+ * @require_ht: require stations to support HT PHY
+ * @require_vht: require stations to support VHT PHY
  */
 struct cfg80211_ap_settings {
 	struct cfg80211_chan_def chandef;
@@ -719,6 +729,11 @@ struct cfg80211_ap_settings {
 	bool p2p_opp_ps;
 	const struct cfg80211_acl_data *acl;
 	bool pbss;
+	enum ht_vht_support ht_enabled;
+	enum ht_vht_support vht_enabled;
+	enum ht_vht_support require_ht;
+	enum ht_vht_support require_vht;
+
 };
 
 /**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 2206941..3ce88ff 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1867,6 +1867,17 @@ enum nl80211_commands {
  * @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is
  *	used to pull the stored data for mesh peer in power save state.
  *
+ * @NL80211_ATTR_HT_ENABLED: u8 value to indicate if HT capability is enabled.
+ *	0=disabled, 1=enabled, not being included as being no value available
+ * @NL80211_ATTR_VHT_ENABLED: u8 value to indicate if VHT capability is enabled.
+ *	0=disabled, 1=enabled, not being included as being no value available
+ * @NL80211_ATTR_REQUIRE_HT: u8 value to require stations to support HT phy.
+ *	0=not required, 1=required, not being included as being no value
+ *	available
+ * @NL80211_ATTR_REQUIRE_VHT: u8 value to require stations to support VHT phy.
+ *	0=not required, 1=required, not being included as being no value
+ *	available
+ *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2261,6 +2272,11 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_MESH_PEER_AID,
 
+	NL80211_ATTR_HT_ENABLED,
+	NL80211_ATTR_VHT_ENABLED,
+	NL80211_ATTR_REQUIRE_HT,
+	NL80211_ATTR_REQUIRE_VHT,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4997857..5f66abf 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -409,6 +409,10 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
 		.len = VHT_MUMIMO_GROUPS_DATA_LEN
 	},
 	[NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR] = { .len = ETH_ALEN },
+	[NL80211_ATTR_HT_ENABLED] { .type = NLA_U8 },
+	[NL80211_ATTR_VHT_ENABLED] { .type = NLA_U8 },
+	[NL80211_ATTR_REQUIRE_HT] { .type = NLA_U8 },
+	[NL80211_ATTR_REQUIRE_VHT] { .type = NLA_U8 },
 };
 
 /* policy for the key attributes */
@@ -3557,6 +3561,30 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
 			return PTR_ERR(params.acl);
 	}
 
+	if (info->attrs[NL80211_ATTR_HT_ENABLED])
+		params.ht_enabled = nla_get_u8(
+			info->attrs[NL80211_ATTR_HT_ENABLED]);
+	else
+		params.ht_enabled = HT_VHT_NOT_INDICATED;
+
+	if (info->attrs[NL80211_ATTR_VHT_ENABLED])
+		params.vht_enabled = nla_get_u8(
+			info->attrs[NL80211_ATTR_VHT_ENABLED]);
+	else
+		params.vht_enabled = HT_VHT_NOT_INDICATED;
+
+	if (info->attrs[NL80211_ATTR_REQUIRE_HT])
+		params.require_ht = nla_get_u8(
+			info->attrs[NL80211_ATTR_REQUIRE_HT]);
+	else
+		params.require_ht = HT_VHT_NOT_INDICATED;
+
+	if (info->attrs[NL80211_ATTR_REQUIRE_VHT])
+		params.require_vht = nla_get_u8(
+			info->attrs[NL80211_ATTR_REQUIRE_VHT]);
+	else
+		params.require_vht = HT_VHT_NOT_INDICATED;
+
 	wdev_lock(wdev);
 	err = rdev_start_ap(rdev, dev, &params);
 	if (!err) {
-- 
1.9.1


^ permalink raw reply related

* [PATCH] ath9k: Fix beacon configuration assertion failure
From: Ioan-Adrian Ratiu @ 2016-08-15 15:00 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, ath9k-devel, ath9k-devel, linux-kernel

commit cfda2d8e2314 ("ath9k: Fix beacon configuration for
addition/removal of interfaces") reworked beacon configs to happen at
IF changes and missed cases when NL80211_IFTYPE_STATION has no beacons
with the corresponding values iter_data.primary_beacon_vif == 0 and
iter_data.nbcnvifs == 0 in ath9k_calculate_summary_state(), thus
calling ath9k_beacon_config() with null and giving the below warning.

Fix this by calling beacon config only when a beacon actually exists,
i.e. by checking iter_data.beacons which should be set only inside
ath9k_vif_iter_set_beacon() (the line "iter_data.beacons = true;" in
ath9k_calculate_summary_state() is a bug in above rework commit).

[   16.910537] ------------[ cut here ]------------
[   16.910549] WARNING: CPU: 2 PID: 6 at drivers/net/wireless/ath/ath9k/beacon.c:642 ath9k_beacon_config+0x12c/0x130 [ath9k]
[   16.910551] Modules linked in: intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel hid_generic aesni_intel usbhid hid aes_x86_64 joydev mousedev arc4 lrw ath9k dell_laptop ath9k_common ath9k_hw ath mac80211 gf128mul glue_helper ablk_helper dell_smbios input_leds cryptd led_class snd_hda_codec_hdmi psmouse cfg80211 serio_raw atkbd snd_hda_codec_realtek libps2 rfkill r8169 sr_mod snd_hda_codec_generic dcdbas cdrom mii snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core i8042 snd_pcm snd_timer serio ac xhci_pci xhci_hcd battery i2c_i801 tpm_tis pcspkr tpm_tis_core evdev shpchp lpc_ich i2c_smbus tpm sch_fq_codel ip_tables x_tables
[   16.910620] CPU: 2 PID: 6 Comm: kworker/u16:0 Not tainted 4.8.0-rc1-next-20160815-g118253a #1
[   16.910621] Hardware name: Dell Inc. Inspiron 3521/018DYG, BIOS A14 07/31/2015
[   16.910648] Workqueue: phy0 ieee80211_iface_work [mac80211]
[   16.910652]  0000000000000000 ffff880159f13630 ffffffff813140f0 0000000000000000
[   16.910657]  0000000000000000 ffff880159f13670 ffffffff8106b22b 0000028200000202
[   16.910661]  ffff880156bc1500 0000000000000000 ffff880153cc8018 ffff880153cc8018
[   16.910666] Call Trace:
[   16.910674]  [<ffffffff813140f0>] dump_stack+0x63/0x83
[   16.910678]  [<ffffffff8106b22b>] __warn+0xcb/0xf0
[   16.910682]  [<ffffffff8106b31d>] warn_slowpath_null+0x1d/0x20
[   16.910690]  [<ffffffffa02fceec>] ath9k_beacon_config+0x12c/0x130 [ath9k]
[   16.910696]  [<ffffffffa03010f6>] ath9k_calculate_summary_state+0xf6/0x350 [ath9k]
[   16.910703]  [<ffffffffa0301b46>] ath9k_bss_info_changed+0x186/0x1a0 [ath9k]
[   16.910720]  [<ffffffffa025dd71>] ieee80211_bss_info_change_notify+0xb1/0x200 [mac80211]
[   16.910737]  [<ffffffffa02c088c>] ieee80211_assoc_success+0x677/0xdeb [mac80211]
[   16.910746]  [<ffffffff810adea2>] ? up+0x32/0x50
[   16.910751]  [<ffffffff810bcf3b>] ? wake_up_klogd+0x3b/0x50
[   16.910755]  [<ffffffff810bd489>] ? console_unlock+0x539/0x5f0
[   16.910760]  [<ffffffff810bd794>] ? vprintk_emit+0x254/0x490
[   16.910765]  [<ffffffff810bdb3f>] ? vprintk_default+0x1f/0x30
[   16.910769]  [<ffffffff8114854d>] ? printk+0x48/0x50
[   16.910788]  [<ffffffffa02ad0c2>] ieee80211_rx_mgmt_assoc_resp+0x152/0x4c0 [mac80211]
[   16.910807]  [<ffffffffa02ade3f>] ieee80211_sta_rx_queued_mgmt+0x18f/0x840 [mac80211]
[   16.910813]  [<ffffffff810d0a40>] ? lock_timer_base.isra.2+0x80/0xa0
[   16.910817]  [<ffffffff810ad896>] ? cpuacct_charge+0x86/0xa0
[   16.910822]  [<ffffffff8109d8e7>] ? update_curr+0xb7/0x160
[   16.910827]  [<ffffffff8109e54c>] ? dequeue_entity+0x24c/0xa20
[   16.910831]  [<ffffffff8109f2e3>] ? dequeue_task_fair+0x5c3/0x960
[   16.910848]  [<ffffffffa02735b4>] ? ieee80211_iface_work+0xd4/0x410 [mac80211]
[   16.910865]  [<ffffffffa0273775>] ieee80211_iface_work+0x295/0x410 [mac80211]
[   16.910870]  [<ffffffff81090537>] ? finish_task_switch+0x77/0x1e0
[   16.910875]  [<ffffffff810832d5>] process_one_work+0x1e5/0x470
[   16.910880]  [<ffffffff810835a8>] worker_thread+0x48/0x4e0
[   16.910885]  [<ffffffff81083560>] ? process_one_work+0x470/0x470
[   16.910888]  [<ffffffff81088f09>] kthread+0xc9/0xe0
[   16.910894]  [<ffffffff81028723>] ? __switch_to+0x2c3/0x610
[   16.910899]  [<ffffffff8173a67f>] ret_from_fork+0x1f/0x40
[   16.910902]  [<ffffffff81088e40>] ? kthread_create_on_node+0x40/0x40
[   16.910904] ---[ end trace aa169ad4461f2f18 ]---

Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
---
 drivers/net/wireless/ath/ath9k/main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index a394622..3c6f413 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1154,7 +1154,6 @@ void ath9k_calculate_summary_state(struct ath_softc *sc,
 		bool changed = (iter_data.primary_sta != ctx->primary_sta);
 
 		if (iter_data.primary_sta) {
-			iter_data.beacons = true;
 			ath9k_set_assoc_state(sc, iter_data.primary_sta,
 					      changed);
 			ctx->primary_sta = iter_data.primary_sta;
@@ -1166,10 +1165,12 @@ void ath9k_calculate_summary_state(struct ath_softc *sc,
 			if (ath9k_hw_mci_is_enabled(sc->sc_ah))
 				ath9k_mci_update_wlan_channels(sc, true);
 		}
+	} else if (iter_data.beacons) {
+		sc->nbcnvifs = iter_data.nbcnvifs;
+		ath9k_beacon_config(sc, iter_data.primary_beacon_vif,
+				    iter_data.beacons);
 	}
-	sc->nbcnvifs = iter_data.nbcnvifs;
-	ath9k_beacon_config(sc, iter_data.primary_beacon_vif,
-			    iter_data.beacons);
+
 	ath9k_hw_set_interrupts(ah);
 
 	if (ah->slottime != iter_data.slottime) {
-- 
2.9.2


^ permalink raw reply related

* [PATCH] ath10k: fix memory leak on caldata on error exit path
From: Colin King @ 2016-08-15 13:46 UTC (permalink / raw)
  To: Kalle Valo, ath10k, linux-wireless, netdev; +Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

caldata is not being free'd on the error exit path, causing
a memory leak. kfree it to fix the leak.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/ath/ath10k/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 9a22c47..886337c 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2725,6 +2725,7 @@ static int ath10k_pci_hif_fetch_cal_eeprom(struct ath10k *ar, void **data,
 	return 0;
 
 err_free:
+	kfree(caldata);
 	kfree(data);
 
 	return -EINVAL;
-- 
2.8.1


^ permalink raw reply related

* Re: [BUGFIX PATCH 1/2] brcmfmac: Check rtnl_lock is locked when removing interface
From: Rafał Miłecki @ 2016-08-15 11:52 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Masami Hiramatsu, Arend van Spriel, Franky Lin, Hante Meuleman,
	Pieter-Paul Giesberts, linux-wireless@vger.kernel.org,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	Network Development, Linux Kernel Mailing List
In-Reply-To: <87wpjib8pb.fsf@kamboji.qca.qualcomm.com>

On 15 August 2016 at 12:57, Kalle Valo <kvalo@codeaurora.org> wrote:
> Rafał Miłecki <zajec5@gmail.com> writes:
>
>>> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
>>
>> Fixes: a63b09872c1d ("brcmfmac: delete interface directly in code that sent fw request")
>> Acked-by: Rafał Miłecki <rafal@milecki.pl>
>>
>> Kalle: I'm acking this as bugfix for 4.8 release.
>
> Ok. I'll wait few days for more comments before I apply this.

Sure.


> (I assume you are talking only about patch 1)

Yes, I'll leave mutex vs. spinlock to the experts :)

-- 
Rafał

^ permalink raw reply

* Re: [PATCH v2] RANDOM: ATH9K RNG delivers zero bits of entropy
From: Kalle Valo @ 2016-08-15 11:01 UTC (permalink / raw)
  To: Pan, Miaoqing
  Cc: Stephan Mueller, Ted Tso, Sepehrdad, Pouyan,
	herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org,
	linux-crypto@vger.kernel.org, ath9k-devel,
	linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org,
	Jason Cooper
In-Reply-To: <657897b90b8344eeab10d7a0f604988d@aptaiexm02f.ap.qualcomm.com>

"Pan, Miaoqing" <miaoqing@qti.qualcomm.com> writes:

> The entropy was evaluated by crypto expert, the analysis report show
> the ADC with at least 10bits and up to 22 bits of min-entropy for a 32
> bits value, we conservatively assume the min-entropy is 10 bits out of
> 32 bits, so that's why set entropy quality to 320/1024 = 10/32. Also
> we have explained in the commit message why can't use the HW RNG
> framework.
>
> Otherwise, your patch will cause high CPU load, as continuously read
> ADC data if entropy bits under write_wakeup_threshold.

Please don't top post, it breaks patchwork which is extremely annoying
for me:

https://patchwork.kernel.org/patch/9266265/

https://patchwork.kernel.org/patch/9266617/

-- 
Kalle Valo

^ permalink raw reply

* Re: [BUGFIX PATCH 1/2] brcmfmac: Check rtnl_lock is locked when removing interface
From: Kalle Valo @ 2016-08-15 10:57 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Masami Hiramatsu, Arend van Spriel, Franky Lin, Hante Meuleman,
	Pieter-Paul Giesberts, linux-wireless, brcm80211-dev-list.pdl,
	netdev, linux-kernel
In-Reply-To: <5bb6e373-e110-b1ac-6f65-fdf2f9f059fc@gmail.com>

Rafał Miłecki <zajec5@gmail.com> writes:

>> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
>
> Fixes: a63b09872c1d ("brcmfmac: delete interface directly in code that sent fw request")
> Acked-by: Rafał Miłecki <rafal@milecki.pl>
>
> Kalle: I'm acking this as bugfix for 4.8 release.

Ok. I'll wait few days for more comments before I apply this.

(I assume you are talking only about patch 1)

-- 
Kalle Valo

^ permalink raw reply

* Re: [BUGFIX PATCH 1/2] brcmfmac: Check rtnl_lock is locked when removing interface
From: Rafał Miłecki @ 2016-08-15 10:41 UTC (permalink / raw)
  To: Masami Hiramatsu, Arend van Spriel, Franky Lin, Hante Meuleman,
	Kalle Valo, Pieter-Paul Giesberts
  Cc: linux-wireless, brcm80211-dev-list.pdl, netdev, linux-kernel
In-Reply-To: <147125405701.9434.12911635695339175773.stgit@devbox>

On 08/15/2016 11:40 AM, Masami Hiramatsu wrote:
> Check rtnl_lock is locked in brcmf_p2p_ifp_removed() by passing
> rtnl_locked flag. Actually the caller brcmf_del_if() checks whether
> the rtnl_lock is locked, but doesn't pass it to brcmf_p2p_ifp_removed().
>
> Without this fix, wpa_supplicant goes softlockup with rtnl_lock
> holding (this means all other process using netlink are locked up too)
>
> e.g.
> [ 4495.876627] INFO: task wpa_supplicant:7307 blocked for more than 10 seconds.
> [ 4495.876632]       Tainted: G        W       4.8.0-rc1+ #8
> [ 4495.876635] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> [ 4495.876638] wpa_supplicant  D ffff974c647b39a0     0  7307      1 0x00000000
> [ 4495.876644]  ffff974c647b39a0 0000000000000000 ffff974c00000000 ffff974c7dc59c58
> [ 4495.876651]  ffff974c6b7417c0 ffff974c645017c0 ffff974c647b4000 ffffffff86f16c08
> [ 4495.876657]  ffff974c645017c0 0000000000000246 00000000ffffffff ffff974c647b39b8
> [ 4495.876664] Call Trace:
> [ 4495.876671]  [<ffffffff868aeccc>] schedule+0x3c/0x90
> [ 4495.876676]  [<ffffffff868af065>] schedule_preempt_disabled+0x15/0x20
> [ 4495.876682]  [<ffffffff868b0996>] mutex_lock_nested+0x176/0x3b0
> [ 4495.876686]  [<ffffffff867a2067>] ? rtnl_lock+0x17/0x20
> [ 4495.876690]  [<ffffffff867a2067>] rtnl_lock+0x17/0x20
> [ 4495.876720]  [<ffffffffc0ae9a5d>] brcmf_p2p_ifp_removed+0x4d/0x70 [brcmfmac]
> [ 4495.876741]  [<ffffffffc0aebde6>] brcmf_remove_interface+0x196/0x1b0 [brcmfmac]
> [ 4495.876760]  [<ffffffffc0ae9901>] brcmf_p2p_del_vif+0x111/0x220 [brcmfmac]
> [ 4495.876777]  [<ffffffffc0adefab>] brcmf_cfg80211_del_iface+0x21b/0x270 [brcmfmac]
> [ 4495.876820]  [<ffffffffc097b39e>] nl80211_del_interface+0xfe/0x3a0 [cfg80211]
> [ 4495.876825]  [<ffffffff867ca335>] genl_family_rcv_msg+0x1b5/0x370
> [ 4495.876832]  [<ffffffff860e5d8d>] ? trace_hardirqs_on+0xd/0x10
> [ 4495.876836]  [<ffffffff867ca56d>] genl_rcv_msg+0x7d/0xb0
> [ 4495.876839]  [<ffffffff867ca4f0>] ? genl_family_rcv_msg+0x370/0x370
> [ 4495.876846]  [<ffffffff867c9a47>] netlink_rcv_skb+0x97/0xb0
> [ 4495.876849]  [<ffffffff867ca168>] genl_rcv+0x28/0x40
> [ 4495.876854]  [<ffffffff867c93c3>] netlink_unicast+0x1d3/0x2f0
> [ 4495.876860]  [<ffffffff867c933b>] ? netlink_unicast+0x14b/0x2f0
> [ 4495.876866]  [<ffffffff867c97cb>] netlink_sendmsg+0x2eb/0x3a0
> [ 4495.876870]  [<ffffffff8676dad8>] sock_sendmsg+0x38/0x50
> [ 4495.876874]  [<ffffffff8676e4df>] ___sys_sendmsg+0x27f/0x290
> [ 4495.876882]  [<ffffffff8628b935>] ? mntput_no_expire+0x5/0x3f0
> [ 4495.876888]  [<ffffffff8628b9be>] ? mntput_no_expire+0x8e/0x3f0
> [ 4495.876894]  [<ffffffff8628b935>] ? mntput_no_expire+0x5/0x3f0
> [ 4495.876899]  [<ffffffff8628bd44>] ? mntput+0x24/0x40
> [ 4495.876904]  [<ffffffff86267830>] ? __fput+0x190/0x200
> [ 4495.876909]  [<ffffffff8676f125>] __sys_sendmsg+0x45/0x80
> [ 4495.876914]  [<ffffffff8676f172>] SyS_sendmsg+0x12/0x20
> [ 4495.876918]  [<ffffffff868b5680>] entry_SYSCALL_64_fastpath+0x23/0xc1
> [ 4495.876924]  [<ffffffff860e2b8f>] ? trace_hardirqs_off_caller+0x1f/0xc0

This is probably caused by my commit:
a63b09872c1d ("brcmfmac: delete interface directly in code that sent fw request")
https://git.kernel.org/cgit/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=a63b09872c1dc0ce0da3628647da67a112b484bf

I changed condition for calling brcmf_remove_interface and it seems it broke P2P. Unfortunately I couldn't fully test my change due to firmware not supporting P2P.

I did similar fix for error path for P2P with commit
b50ddfa8530e ("brcmfmac: fix lockup when removing P2P interface after event timeout")
https://git.kernel.org/cgit/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=b50ddfa8530e9b5f52e873fdd6ff04f327a88799
so your change looks like a proper follow-up.


> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>

Fixes: a63b09872c1d ("brcmfmac: delete interface directly in code that sent fw request")
Acked-by: Rafał Miłecki <rafal@milecki.pl>

Kalle: I'm acking this as bugfix for 4.8 release.

^ permalink raw reply

* Re: [PATCH] ath9k: fix AR5416 access GPIO warning
From: Valo, Kalle @ 2016-08-15 10:16 UTC (permalink / raw)
  To: miaoqing@codeaurora.org
  Cc: linux-wireless@vger.kernel.org, ath9k-devel, s.l-h@gmx.de
In-Reply-To: <1470296914-9152-1-git-send-email-miaoqing@codeaurora.org>

<miaoqing@codeaurora.org> writes:

> From: Miaoqing Pan <miaoqing@codeaurora.org>
>
> The warning was seen on AR5416 chip, which invoke ath9k_hw_gio_get()
> before the GPIO initialized correctly.
>
>     WARNING: CPU: 1 PID: 1159 at ~/drivers/net/wireless/ath/ath9k/hw.c:2776 ath9k_hw_gpio_get+0x148/0x1a0 [ath9k_hw]
>     ...
>     CPU: 1 PID: 1159 Comm: systemd-udevd Not tainted 4.7.0-rc7-aptosid-amd64 #1 aptosid 4.7~rc7-1~git92.slh.3
>     Hardware name:                  /DH67CL, BIOS BLH6710H.86A.0160.2012.1204.1156 12/04/2012
>       0000000000000286 00000000f912d633 ffffffff81290fd3 0000000000000000
>       0000000000000000 ffffffff81063fd4 ffff88040c6dc018 0000000000000000
>       0000000000000002 0000000000000000 0000000000000100 ffff88040c6dc018
>     Call Trace:
>       [<ffffffff81290fd3>] ? dump_stack+0x5c/0x79
>       [<ffffffff81063fd4>] ? __warn+0xb4/0xd0
>       [<ffffffffa0668fb8>] ? ath9k_hw_gpio_get+0x148/0x1a0 [ath9k_hw]
>
> Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>

As discussed in the previous thread I'll add:

Reported-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: <stable@vger.kernel.org> # 4.7+

I'm also planning to queue this to 4.8.

-- 
Kalle Valo

^ permalink raw reply

* [BUGFIX PATCH 2/2] brcmfmac: Change vif_event_lock to spinlock
From: Masami Hiramatsu @ 2016-08-15  9:41 UTC (permalink / raw)
  To: Arend van Spriel, Franky Lin, Hante Meuleman, Kalle Valo,
	Pieter-Paul Giesberts, Rafał Miłecki
  Cc: linux-wireless, brcm80211-dev-list.pdl, netdev, linux-kernel
In-Reply-To: <147125403645.9434.8008546579326856373.stgit@devbox>

Change vif_event_lock to spinlock from mutex, since this lock is
used in wait_event_timeout() via vif_event_equals(). This caused
a warning report as below.

As far as I can see, this lock protects regions where updating
structure members, not function calls. Also, since those
regions are not called from interrupt handlers (of course, it
was a mutex), spin_lock is used instead of spin_lock_irqsave.

[  186.678550] ------------[ cut here ]------------
[  186.678556] WARNING: CPU: 2 PID: 7140 at /home/mhiramat/ksrc/linux/kernel/sched/core.c:7545 __might_sleep+0x7c/0x80
[  186.678560] do not call blocking ops when !TASK_RUNNING; state=2 set at [<ffffffff980d9090>] prepare_to_wait_event+0x60/0x100
[  186.678560] Modules linked in: brcmfmac xt_CHECKSUM rfcomm ipt_MASQUERADE nf_nat_masquerade_ipv4 xt_addrtype br_netfilter xt_tcpudp ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_raw ip6table_security ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_filter ip6_tables iptable_raw iptable_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_filter ip_tables x_tables bnep nls_iso8859_1 i2c_designware_platform i2c_designware_core snd_hda_codec_hdmi snd_hda_codec_realtek dcdbas snd_hda_codec_generic snd_hda_intel snd_hda_codec intel_rapl snd_hda_core x86_pkg_temp_thermal intel_powerclamp coretemp
[  186.678594]  snd_pcm crct10dif_pclmul crc32_pclmul aesni_intel aes_x86_64 joydev glue_helper snd_hwdep lrw gf128mul uvcvideo ablk_helper snd_seq_midi cryptd snd_seq_midi_event snd_rawmidi videobuf2_vmalloc videobuf2_memops snd_seq input_leds videobuf2_v4l2 cfg80211 videobuf2_core snd_timer videodev serio_raw btusb snd_seq_device media btrtl rtsx_pci_ms snd mei_me memstick hid_multitouch mei soundcore brcmutil idma64 virt_dma intel_lpss_pci processor_thermal_device intel_soc_dts_iosf hci_uart btbcm btqca btintel bluetooth int3403_thermal dell_smo8800 intel_lpss_acpi intel_lpss int3402_thermal int340x_thermal_zone intel_hid mac_hid int3400_thermal shpchp sparse_keymap acpi_pad acpi_thermal_rel acpi_als kfifo_buf industrialio kvm_intel kvm irqbypass parport_pc ppdev lp parport autofs4 btrfs xor raid6_pq
[  186.678631]  usbhid nouveau ttm i915 rtsx_pci_sdmmc mxm_wmi i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops psmouse drm ahci rtsx_pci nvme nvme_core libahci i2c_hid hid pinctrl_sunrisepoint video wmi pinctrl_intel fjes [last unloaded: brcmfmac]
[  186.678646] CPU: 2 PID: 7140 Comm: wpa_supplicant Not tainted 4.8.0-rc1+ #8
[  186.678647] Hardware name: Dell Inc. XPS 15 9550/0N7TVV, BIOS 01.02.00 04/07/2016
[  186.678648]  0000000000000000 ffff9d8c64b5b900 ffffffff98442f23 ffff9d8c64b5b950
[  186.678651]  0000000000000000 ffff9d8c64b5b940 ffffffff9808b22b 00001d790000000d
[  186.678653]  ffffffff98c75e78 000000000000026c 0000000000000000 ffff9d8c2706d058
[  186.678655] Call Trace:
[  186.678659]  [<ffffffff98442f23>] dump_stack+0x85/0xc2
[  186.678666]  [<ffffffff9808b22b>] __warn+0xcb/0xf0
[  186.678668]  [<ffffffff9808b29f>] warn_slowpath_fmt+0x4f/0x60
[  186.678671]  [<ffffffff980d9090>] ? prepare_to_wait_event+0x60/0x100
[  186.678672]  [<ffffffff980d9090>] ? prepare_to_wait_event+0x60/0x100
[  186.678674]  [<ffffffff980b922c>] __might_sleep+0x7c/0x80
[  186.678680]  [<ffffffff988b0853>] mutex_lock_nested+0x33/0x3b0
[  186.678682]  [<ffffffff980e5d8d>] ? trace_hardirqs_on+0xd/0x10
[  186.678689]  [<ffffffffc0c57d2d>] brcmf_cfg80211_wait_vif_event+0xcd/0x130 [brcmfmac]
[  186.678691]  [<ffffffff980d9190>] ? wake_atomic_t_function+0x60/0x60
[  186.678697]  [<ffffffffc0c628e9>] brcmf_p2p_del_vif+0xf9/0x220 [brcmfmac]
[  186.678702]  [<ffffffffc0c57fab>] brcmf_cfg80211_del_iface+0x21b/0x270 [brcmfmac]
[  186.678716]  [<ffffffffc0b0539e>] nl80211_del_interface+0xfe/0x3a0 [cfg80211]
[  186.678718]  [<ffffffff987ca335>] genl_family_rcv_msg+0x1b5/0x370
[  186.678720]  [<ffffffff980e5d8d>] ? trace_hardirqs_on+0xd/0x10
[  186.678721]  [<ffffffff987ca56d>] genl_rcv_msg+0x7d/0xb0
[  186.678722]  [<ffffffff987ca4f0>] ? genl_family_rcv_msg+0x370/0x370
[  186.678724]  [<ffffffff987c9a47>] netlink_rcv_skb+0x97/0xb0
[  186.678726]  [<ffffffff987ca168>] genl_rcv+0x28/0x40
[  186.678727]  [<ffffffff987c93c3>] netlink_unicast+0x1d3/0x2f0
[  186.678729]  [<ffffffff987c933b>] ? netlink_unicast+0x14b/0x2f0
[  186.678731]  [<ffffffff987c97cb>] netlink_sendmsg+0x2eb/0x3a0
[  186.678733]  [<ffffffff9876dad8>] sock_sendmsg+0x38/0x50
[  186.678734]  [<ffffffff9876e4df>] ___sys_sendmsg+0x27f/0x290
[  186.678737]  [<ffffffff9828b935>] ? mntput_no_expire+0x5/0x3f0
[  186.678739]  [<ffffffff9828b9be>] ? mntput_no_expire+0x8e/0x3f0
[  186.678741]  [<ffffffff9828b935>] ? mntput_no_expire+0x5/0x3f0
[  186.678743]  [<ffffffff9828bd44>] ? mntput+0x24/0x40
[  186.678744]  [<ffffffff98267830>] ? __fput+0x190/0x200
[  186.678746]  [<ffffffff9876f125>] __sys_sendmsg+0x45/0x80
[  186.678748]  [<ffffffff9876f172>] SyS_sendmsg+0x12/0x20
[  186.678749]  [<ffffffff988b5680>] entry_SYSCALL_64_fastpath+0x23/0xc1
[  186.678751]  [<ffffffff980e2b8f>] ? trace_hardirqs_off_caller+0x1f/0xc0
[  186.678752] ---[ end trace e224d66c5d8408b5 ]---

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 .../broadcom/brcm80211/brcmfmac/cfg80211.c         |   26 ++++++++++----------
 .../broadcom/brcm80211/brcmfmac/cfg80211.h         |    2 +-
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 2628d5e..5db56a7 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -5635,7 +5635,7 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp,
 		  ifevent->action, ifevent->flags, ifevent->ifidx,
 		  ifevent->bsscfgidx);
 
-	mutex_lock(&event->vif_event_lock);
+	spin_lock(&event->vif_event_lock);
 	event->action = ifevent->action;
 	vif = event->vif;
 
@@ -5643,7 +5643,7 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp,
 	case BRCMF_E_IF_ADD:
 		/* waiting process may have timed out */
 		if (!cfg->vif_event.vif) {
-			mutex_unlock(&event->vif_event_lock);
+			spin_unlock(&event->vif_event_lock);
 			return -EBADF;
 		}
 
@@ -5654,24 +5654,24 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp,
 			ifp->ndev->ieee80211_ptr = &vif->wdev;
 			SET_NETDEV_DEV(ifp->ndev, wiphy_dev(cfg->wiphy));
 		}
-		mutex_unlock(&event->vif_event_lock);
+		spin_unlock(&event->vif_event_lock);
 		wake_up(&event->vif_wq);
 		return 0;
 
 	case BRCMF_E_IF_DEL:
-		mutex_unlock(&event->vif_event_lock);
+		spin_unlock(&event->vif_event_lock);
 		/* event may not be upon user request */
 		if (brcmf_cfg80211_vif_event_armed(cfg))
 			wake_up(&event->vif_wq);
 		return 0;
 
 	case BRCMF_E_IF_CHANGE:
-		mutex_unlock(&event->vif_event_lock);
+		spin_unlock(&event->vif_event_lock);
 		wake_up(&event->vif_wq);
 		return 0;
 
 	default:
-		mutex_unlock(&event->vif_event_lock);
+		spin_unlock(&event->vif_event_lock);
 		break;
 	}
 	return -EINVAL;
@@ -5792,7 +5792,7 @@ static void wl_deinit_priv(struct brcmf_cfg80211_info *cfg)
 static void init_vif_event(struct brcmf_cfg80211_vif_event *event)
 {
 	init_waitqueue_head(&event->vif_wq);
-	mutex_init(&event->vif_event_lock);
+	spin_lock_init(&event->vif_event_lock);
 }
 
 static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
@@ -6691,9 +6691,9 @@ static inline bool vif_event_equals(struct brcmf_cfg80211_vif_event *event,
 {
 	u8 evt_action;
 
-	mutex_lock(&event->vif_event_lock);
+	spin_lock(&event->vif_event_lock);
 	evt_action = event->action;
-	mutex_unlock(&event->vif_event_lock);
+	spin_unlock(&event->vif_event_lock);
 	return evt_action == action;
 }
 
@@ -6702,10 +6702,10 @@ void brcmf_cfg80211_arm_vif_event(struct brcmf_cfg80211_info *cfg,
 {
 	struct brcmf_cfg80211_vif_event *event = &cfg->vif_event;
 
-	mutex_lock(&event->vif_event_lock);
+	spin_lock(&event->vif_event_lock);
 	event->vif = vif;
 	event->action = 0;
-	mutex_unlock(&event->vif_event_lock);
+	spin_unlock(&event->vif_event_lock);
 }
 
 bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg)
@@ -6713,9 +6713,9 @@ bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg)
 	struct brcmf_cfg80211_vif_event *event = &cfg->vif_event;
 	bool armed;
 
-	mutex_lock(&event->vif_event_lock);
+	spin_lock(&event->vif_event_lock);
 	armed = event->vif != NULL;
-	mutex_unlock(&event->vif_event_lock);
+	spin_unlock(&event->vif_event_lock);
 
 	return armed;
 }
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
index 7d77f86..8889832 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
@@ -227,7 +227,7 @@ struct escan_info {
  */
 struct brcmf_cfg80211_vif_event {
 	wait_queue_head_t vif_wq;
-	struct mutex vif_event_lock;
+	spinlock_t vif_event_lock;
 	u8 action;
 	struct brcmf_cfg80211_vif *vif;
 };


^ permalink raw reply related

* [BUGFIX PATCH 1/2] brcmfmac: Check rtnl_lock is locked when removing interface
From: Masami Hiramatsu @ 2016-08-15  9:40 UTC (permalink / raw)
  To: Arend van Spriel, Franky Lin, Hante Meuleman, Kalle Valo,
	Pieter-Paul Giesberts, Rafał Miłecki
  Cc: linux-wireless, brcm80211-dev-list.pdl, netdev, linux-kernel
In-Reply-To: <147125403645.9434.8008546579326856373.stgit@devbox>

Check rtnl_lock is locked in brcmf_p2p_ifp_removed() by passing
rtnl_locked flag. Actually the caller brcmf_del_if() checks whether
the rtnl_lock is locked, but doesn't pass it to brcmf_p2p_ifp_removed().

Without this fix, wpa_supplicant goes softlockup with rtnl_lock
holding (this means all other process using netlink are locked up too)

e.g.
[ 4495.876627] INFO: task wpa_supplicant:7307 blocked for more than 10 seconds.
[ 4495.876632]       Tainted: G        W       4.8.0-rc1+ #8
[ 4495.876635] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 4495.876638] wpa_supplicant  D ffff974c647b39a0     0  7307      1 0x00000000
[ 4495.876644]  ffff974c647b39a0 0000000000000000 ffff974c00000000 ffff974c7dc59c58
[ 4495.876651]  ffff974c6b7417c0 ffff974c645017c0 ffff974c647b4000 ffffffff86f16c08
[ 4495.876657]  ffff974c645017c0 0000000000000246 00000000ffffffff ffff974c647b39b8
[ 4495.876664] Call Trace:
[ 4495.876671]  [<ffffffff868aeccc>] schedule+0x3c/0x90
[ 4495.876676]  [<ffffffff868af065>] schedule_preempt_disabled+0x15/0x20
[ 4495.876682]  [<ffffffff868b0996>] mutex_lock_nested+0x176/0x3b0
[ 4495.876686]  [<ffffffff867a2067>] ? rtnl_lock+0x17/0x20
[ 4495.876690]  [<ffffffff867a2067>] rtnl_lock+0x17/0x20
[ 4495.876720]  [<ffffffffc0ae9a5d>] brcmf_p2p_ifp_removed+0x4d/0x70 [brcmfmac]
[ 4495.876741]  [<ffffffffc0aebde6>] brcmf_remove_interface+0x196/0x1b0 [brcmfmac]
[ 4495.876760]  [<ffffffffc0ae9901>] brcmf_p2p_del_vif+0x111/0x220 [brcmfmac]
[ 4495.876777]  [<ffffffffc0adefab>] brcmf_cfg80211_del_iface+0x21b/0x270 [brcmfmac]
[ 4495.876820]  [<ffffffffc097b39e>] nl80211_del_interface+0xfe/0x3a0 [cfg80211]
[ 4495.876825]  [<ffffffff867ca335>] genl_family_rcv_msg+0x1b5/0x370
[ 4495.876832]  [<ffffffff860e5d8d>] ? trace_hardirqs_on+0xd/0x10
[ 4495.876836]  [<ffffffff867ca56d>] genl_rcv_msg+0x7d/0xb0
[ 4495.876839]  [<ffffffff867ca4f0>] ? genl_family_rcv_msg+0x370/0x370
[ 4495.876846]  [<ffffffff867c9a47>] netlink_rcv_skb+0x97/0xb0
[ 4495.876849]  [<ffffffff867ca168>] genl_rcv+0x28/0x40
[ 4495.876854]  [<ffffffff867c93c3>] netlink_unicast+0x1d3/0x2f0
[ 4495.876860]  [<ffffffff867c933b>] ? netlink_unicast+0x14b/0x2f0
[ 4495.876866]  [<ffffffff867c97cb>] netlink_sendmsg+0x2eb/0x3a0
[ 4495.876870]  [<ffffffff8676dad8>] sock_sendmsg+0x38/0x50
[ 4495.876874]  [<ffffffff8676e4df>] ___sys_sendmsg+0x27f/0x290
[ 4495.876882]  [<ffffffff8628b935>] ? mntput_no_expire+0x5/0x3f0
[ 4495.876888]  [<ffffffff8628b9be>] ? mntput_no_expire+0x8e/0x3f0
[ 4495.876894]  [<ffffffff8628b935>] ? mntput_no_expire+0x5/0x3f0
[ 4495.876899]  [<ffffffff8628bd44>] ? mntput+0x24/0x40
[ 4495.876904]  [<ffffffff86267830>] ? __fput+0x190/0x200
[ 4495.876909]  [<ffffffff8676f125>] __sys_sendmsg+0x45/0x80
[ 4495.876914]  [<ffffffff8676f172>] SyS_sendmsg+0x12/0x20
[ 4495.876918]  [<ffffffff868b5680>] entry_SYSCALL_64_fastpath+0x23/0xc1
[ 4495.876924]  [<ffffffff860e2b8f>] ? trace_hardirqs_off_caller+0x1f/0xc0

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 .../wireless/broadcom/brcm80211/brcmfmac/core.c    |    2 +-
 .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c |    8 +++++---
 .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.h |    2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index 8d16f02..65e8c87 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -743,7 +743,7 @@ static void brcmf_del_if(struct brcmf_pub *drvr, s32 bsscfgidx,
 		 * serious troublesome side effects. The p2p module will clean
 		 * up the ifp if needed.
 		 */
-		brcmf_p2p_ifp_removed(ifp);
+		brcmf_p2p_ifp_removed(ifp, rtnl_locked);
 		kfree(ifp);
 	}
 }
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index 66f942f..de19c7c 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -2297,7 +2297,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev)
 	return err;
 }
 
-void brcmf_p2p_ifp_removed(struct brcmf_if *ifp)
+void brcmf_p2p_ifp_removed(struct brcmf_if *ifp, bool rtnl_locked)
 {
 	struct brcmf_cfg80211_info *cfg;
 	struct brcmf_cfg80211_vif *vif;
@@ -2306,9 +2306,11 @@ void brcmf_p2p_ifp_removed(struct brcmf_if *ifp)
 	vif = ifp->vif;
 	cfg = wdev_to_cfg(&vif->wdev);
 	cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL;
-	rtnl_lock();
+	if (!rtnl_locked)
+		rtnl_lock();
 	cfg80211_unregister_wdev(&vif->wdev);
-	rtnl_unlock();
+	if (!rtnl_locked)
+		rtnl_unlock();
 	brcmf_free_vif(vif);
 }
 
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h
index a3bd18c..8ce9447 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h
@@ -155,7 +155,7 @@ struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name,
 int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev);
 int brcmf_p2p_ifchange(struct brcmf_cfg80211_info *cfg,
 		       enum brcmf_fil_p2p_if_types if_type);
-void brcmf_p2p_ifp_removed(struct brcmf_if *ifp);
+void brcmf_p2p_ifp_removed(struct brcmf_if *ifp, bool rtnl_locked);
 int brcmf_p2p_start_device(struct wiphy *wiphy, struct wireless_dev *wdev);
 void brcmf_p2p_stop_device(struct wiphy *wiphy, struct wireless_dev *wdev);
 int brcmf_p2p_scan_prep(struct wiphy *wiphy,


^ permalink raw reply related

* [BUGFIX PATCH 0/2] Bugfixes for brcmfmac
From: Masami Hiramatsu @ 2016-08-15  9:40 UTC (permalink / raw)
  To: Arend van Spriel, Franky Lin, Hante Meuleman, Kalle Valo,
	Pieter-Paul Giesberts, Rafał Miłecki
  Cc: linux-wireless, brcm80211-dev-list.pdl, netdev, linux-kernel

Hi,

Here are 2 patches for fixing bugs which I recently faced on my PC.

There are 2 bugs I've hit on brcmfmac, one issue was critical,
the other was just found when I investigated the first issue.

1) when I shutdown or reboot my pc with wifi, it always stopped
 when disabling networking. I tried to just disable wifi and saw
 task hung up messages on dmesg.
 All those taskes were blocked on rtnl_lock according to the
 stacktrace, and found a suspicious task in the list. Actually
 the wpa_supplicant is blocked while stopping the interface.

2) I also tried to get more information about that and enabled
 DEBUG_ATOMIC_SLEEP and got another warning in brcmfmac. That
 warned a mutex (which can yeild/sleep) is held in !TASK_RUNNING
 state. I've found a mutex is held when in wait_event_timeout()
 condition parameter.

I traced the source code and found that #1 was caused by double
locking of rtnl_lock in brcmfmac driver, because it doesn't
check the rtnl_lock is already held in a path (actually, other
paths checked that). So I fixed it by checking rtnl_locked and
skip locking rtnl_lock. It works, but not seems the best way
to fix, since original code (rtnl_lock locking around
cfg80211_unregister_wdev) itself looks add-hoc. Anyway, since
I don't have any knowladge of this subsystem, I'd like to ask
maintainer's help.

To fix #2 issue, I've checked the mutex (vif_event_lock) in
struct brcmf_cfg80211_vif_event just protect updating other
members and can be replaced by a spinlock because in the
protected regions are not involving any scheduler related
code.


Thank you,
---

Masami Hiramatsu (2):
      brcmfmac: Check rtnl_lock is locked when removing interface
      brcmfmac: Change vif_event_lock to spinlock


 .../broadcom/brcm80211/brcmfmac/cfg80211.c         |   26 ++++++++++----------
 .../broadcom/brcm80211/brcmfmac/cfg80211.h         |    2 +-
 .../wireless/broadcom/brcm80211/brcmfmac/core.c    |    2 +-
 .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c |    8 ++++--
 .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.h |    2 +-
 5 files changed, 21 insertions(+), 19 deletions(-)

--
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply

* RE: [PATCH] brcmfmac: shut down AP and set IBSS mode only on primary interface
From: Wright Feng @ 2016-08-15  8:11 UTC (permalink / raw)
  To: Kalle Valo, Arend Van Spriel
  Cc: brcm80211-dev-list.pdl@broadcom.com, franky.lin@broadcom.com,
	hante.meuleman@broadcom.com, pieterpg@broadcom.com, Chi-Hsien Lin,
	linux-wireless@vger.kernel.org
In-Reply-To: <871t1qe9u3.fsf@kamboji.qca.qualcomm.com>

Hi Kalle and Arend,

> -----Original Message-----
> From: Kalle Valo [mailto:kvalo@codeaurora.org]
> Sent: Monday, August 15, 2016 4:05 PM
> To: Arend Van Spriel <arend.vanspriel@broadcom.com>
> Cc: Wright Feng <wefe@cypress.com>; brcm80211-dev-
> list.pdl@broadcom.com; franky.lin@broadcom.com;
> hante.meuleman@broadcom.com; pieterpg@broadcom.com; Chi-Hsien Lin
> <chln@cypress.com>; linux-wireless@vger.kernel.org
> Subject: Re: [PATCH] brcmfmac: shut down AP and set IBSS mode only on
> primary interface
>
> Arend Van Spriel <arend.vanspriel@broadcom.com> writes:
>
> >> This message and any attachments may contain Cypress (or its
> >> subsidiaries) confidential information. If it has been received in
> >> error, please advise the sender and immediately delete this message.
> >
> > Is there any way for you to get rid of this foot note. It may keep
> > Kalle from taking this patch.
>
> Correct. I'll automatically drop patches with these kind of notices.
I've removed the foot note and sent the [PATCH v2] to you on 8/11.
Is that okay to you?
>
> --
> Kalle Valo

This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox