2018-11-04 19:12:43

by Stijn Tintel

[permalink] [raw]
Subject: 7f9a3e150ec7d breaks brcmfmac with modparam roamoff=1

Hi,

Commit 7f9a3e150ec7d3596386449c15aefb59904a1266 (nl80211: Update ERP
info using NL80211_CMD_UPDATE_CONNECT_PARAMS) breaks brcmfmac with
modparam roamoff=1, which disables WIPHY_FLAG_SUPPORTS_FW_ROAM:

# modprobe brcmfmac roamoff=0

[  325.775805] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[  325.783904] brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43430-sdio for chip BCM43430/1
[  325.975239] brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43430-sdio for chip BCM43430/1
[  326.004488] brcmfmac mmc1:0001:1: Direct firmware load for
brcm/brcmfmac43430-sdio.clm_blob failed with error -2
[  326.035141] brcmfmac mmc1:0001:1: Falling back to user helper
[  326.083138] firmware brcm!brcmfmac43430-sdio.clm_blob:
firmware_loading_store: map pages failed
[  326.108380] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available
(err=-11), device may have limited channels available
[  326.139047] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1
wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
[  326.229364] usbcore: registered new interface driver brcmfmac
[  326.311507] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  327.556310] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

# modprobe brcmfmac roamoff=1

[  258.807271] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[  258.815347] brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43430-sdio for chip BCM43430/1
[  259.006572] brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43430-sdio for chip BCM43430/1
[  259.035893] brcmfmac mmc1:0001:1: Direct firmware load for
brcm/brcmfmac43430-sdio.clm_blob failed with error -2
[  259.066544] brcmfmac mmc1:0001:1: Falling back to user helper
[  259.114713] firmware brcm!brcmfmac43430-sdio.clm_blob:
firmware_loading_store: map pages failed
[  259.140192] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available
(err=-11), device may have limited channels available
[  259.171226] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1
wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
[  259.220697] ------------[ cut here ]------------
[  259.240131] WARNING: CPU: 0 PID: 50 at
/home/build/lede/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/linux-brcm2708_bcm2708/backports-4.19-rc5-1/net/wireless/core.c:736
wiphy_register+0x280/0xa58 [cfg80211]
[  259.274067] Modules linked in: brcmfmac(+) pppoe ppp_async pppox
ppp_generic nf_conntrack_ipv6 lzo iptable_nat ipt_REJECT ipt_MASQUERADE
ftdi_sio cfg80211 xt_time xt_tcpudp xt_state xt_policy xt_nat
xt_multiport xt_mark xt_mac xt_limit xt_esp xt_conntrack xt_comment
xt_TCPMSS xt_REDIRECT xt_LOG wireguard vc4 usbserial usbhid slhc rfcomm
nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4
nf_nat_ipv4 nf_nat nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4
nf_conntrack_rtcache nf_conntrack lzo_decompress lzo_compress
iptable_mangle iptable_filter ipt_ah ip_tables hidp hid_generic hci_uart
drm_kms_helper crc_ccitt compat cdc_acm btusb btintel brcmutil bnep
bluetooth spi_bcm2835aux spi_bcm2835 tcp_bbr sch_teql em_nbyte sch_codel
sch_prio sch_pie act_ipt em_meta sch_gred sch_dsmark cls_basic
[  259.394694]  em_cmp em_text sch_sfq act_police sch_fq sch_multiq
sch_red act_skbedit act_mirred em_u32 cls_u32 cls_tcindex cls_flow
cls_route cls_fw sch_tbf sch_htb sch_hfsc sch_ingress snd_bcm2835 hid
evdev i2c_bcm2835 i2c_bcm2708 dht11 kfifo_buf industrialio i2c_dev
xt_set ip_set_list_set ip_set_hash_netiface ip_set_hash_netport
ip_set_hash_netnet ip_set_hash_net ip_set_hash_netportnet
ip_set_hash_mac ip_set_hash_ipportnet ip_set_hash_ipportip
ip_set_hash_ipport ip_set_hash_ipmark ip_set_hash_ip ip_set_bitmap_port
ip_set_bitmap_ipmac ip_set_bitmap_ip ip_set nfnetlink ip6t_REJECT
nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter
ip6_tables x_tables ip6_vti ip_vti ip6_udp_tunnel udp_tunnel ipcomp6
xfrm6_tunnel xfrm6_mode_tunnel xfrm6_mode_transport xfrm6_mode_beet esp6
ah6 ipcomp xfrm4_tunnel xfrm4_mode_tunnel xfrm4_mode_transport
xfrm4_mode_beet esp4 ah4 ip6_tunnel tunnel6 tunnel4 ip_tunnel
snd_compress snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_rawmidi
snd_seq_device snd_hwdep snd soundcore af_key xfrm_user xfrm_ipcomp
xfrm_algo cifs nls_utf8 regmap_spi regmap_i2c ecdh_generic
sha256_generic sha1_generic drbg md5 md4 kpp hmac echainiv ecb
des_generic deflate zlib_inflate zlib_deflate cmac cbc authenc drm
i2c_core dma_shared_buffer vfat fat nls_iso8859_1 nls_cp437 aead
cryptomgr crypto_null [last unloaded: brcmfmac]
[  259.637110] CPU: 0 PID: 50 Comm: kworker/0:2 Tainted: G       
W       4.9.135 #0
[  259.662647] Hardware name: BCM2835
[  259.683981] Workqueue: events request_firmware_work_func
[  259.707357] [<c0016938>] (unwind_backtrace) from [<c0013474>]
(show_stack+0x10/0x14)
[  259.733223] [<c0013474>] (show_stack) from [<c001e810>]
(__warn+0xd0/0xfc)
[  259.758312] [<c001e810>] (__warn) from [<c001e934>]
(warn_slowpath_null+0x20/0x28)
[  259.784151] [<c001e934>] (warn_slowpath_null) from [<bf754ca0>]
(wiphy_register+0x280/0xa58 [cfg80211])
[  259.812011] [<bf754ca0>] (wiphy_register [cfg80211]) from
[<bf8b0bc8>] (brcmf_cfg80211_attach+0x8e8/0xf80 [brcmfmac])
[  259.841249] [<bf8b0bc8>] (brcmf_cfg80211_attach [brcmfmac]) from
[<bf8ba1b8>] (brcmf_attach+0x1c0/0x49c [brcmfmac])
[  259.870194] [<bf8ba1b8>] (brcmf_attach [brcmfmac]) from [<bf8c391c>]
(brcmf_sdio_firmware_callback+0x4fc/0xab0 [brcmfmac])
[  259.899691] [<bf8c391c>] (brcmf_sdio_firmware_callback [brcmfmac])
from [<bf8bb028>] (brcmf_fw_request_done+0x23c/0x2dc [brcmfmac])
[  259.929894] [<bf8bb028>] (brcmf_fw_request_done [brcmfmac]) from
[<c0272e60>] (request_firmware_work_func+0x48/0x88)
[  259.958526] [<c0272e60>] (request_firmware_work_func) from
[<c0032ad0>] (process_one_work+0x204/0x398)
[  259.985650] [<c0032ad0>] (process_one_work) from [<c0032f38>]
(worker_thread+0x2d4/0x508)
[  260.011322] [<c0032f38>] (worker_thread) from [<c0037ccc>]
(kthread+0xe0/0xf8)
[  260.035705] [<c0037ccc>] (kthread) from [<c000f8f0>]
(ret_from_fork+0x14/0x24)
[  260.059731] ---[ end trace 35f416b283ba7dba ]---
[  260.080748] brcmfmac: brcmf_cfg80211_attach: Could not register wiphy
device (-22)
[  260.104550] brcmfmac: brcmf_bus_started: failed: -12
[  260.125334] brcmfmac: brcmf_attach: dongle is not responding: err=-12
[  260.151068] brcmfmac: brcmf_sdio_firmware_callback: brcmf_attach failed
[  263.922867] usbcore: registered new interface driver brcmfmac

Stijn



2018-11-05 08:35:12

by Arend Van Spriel

[permalink] [raw]
Subject: Re: 7f9a3e150ec7d breaks brcmfmac with modparam roamoff=1

On 11/4/2018 8:04 PM, Stijn Tintel wrote:
> [ 259.240131] WARNING: CPU: 0 PID: 50 at
> /home/build/lede/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/linux-brcm2708_bcm2708/backports-4.19-rc5-1/net/wireless/core.c:736
> wiphy_register+0x280/0xa58 [cfg80211]
> [ 259.274067] Modules linked in: brcmfmac(+) pppoe ppp_async pppox

Hi Stijn,

Thanks for the report. The code fails on the check below:

diff --git a/net/wireless/core.c b/net/wireless/core.c
index c0fd8a85e7f7..5fe35aafdd9c 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -725,6 +725,10 @@ int wiphy_register(struct wiphy *wiphy)
(!rdev->ops->set_pmk || !rdev->ops->del_pmk)))
return -EINVAL;

+ if (WARN_ON(!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_FW_ROAM) &&
+ rdev->ops->update_connect_params))
+ return -EINVAL;
+
if (wiphy->addresses)
memcpy(wiphy->perm_addr, wiphy->addresses[0].addr, ETH_ALEN);

It seemed to makes sense to me at the time to have this check and I
would say it still does. So I probably need to fix brcmfmac for this.

Regards,
Arend