On 22 March 2016 at 21:24, Arend van Spriel <arend.vanspriel@xxxxxxxxxxxx> wrote: > On 22-3-2016 7:36, Rafał Miłecki wrote: >> On 3 March 2016 at 23:37, Rafał Miłecki <zajec5@xxxxxxxxx> wrote: >>> brcmfmac in general is not capable of removing interfaces. If you take >>> a look at brcmf_cfg80211_del_iface implementation, you'll see it >>> returns -EOPNOTSUPP (except for p2p interfaces). >>> >>> However there is problem in handling NL80211_CMD_STOP_AP (with the >>> brcmf_cfg80211_stop_ap callback). Current implementation calls >>> brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1) >>> if mbss support is enabled/used. >>> >>> Above call results in firmware generating BRCMF_E_LINK event. This >>> event is handled with the following forward-traced functions chain: >>> 1) brcmf_notify_connect_status >>> 2) brcmf_notify_connect_status_ap >>> 3) brcmf_remove_interface >>> 4) brcmf_del_if >>> 5) brcmf_net_detach >>> 6) unregister_netdev >>> >>> So the result of NL80211_CMD_STOP_AP is interface being removed. The >>> problem with this behavior is that interface can't be recreated after >>> that: >>> # iw phy phy1 interface add wlan1-1 type __ap >>> [ 3602.929199] brcmfmac: brcmf_ap_add_vif: timeout occurred >>> command failed: I/O error (-5) >>> >>> I hit this problem when trying to restart hostapd using BCM43602 and 2 BSSes. >>> >>> Could you analyze this problem and see if you see some way of solving >>> this problem, please? >> >> Hi, any ideas / help regarding this issue? > > Restarting hostapd obviously is a valid scenario. My guess is we would > need to avoid interface removal in brcmf_notify_connect_status_ap. But > first I would like to know in which state the firmware is upon > brcmf_ap_add_vif. Can you provide a full log with FWCON debug level enabled? Sure, hope it helps! -- Rafał
1) modprobe [ 155.446674] usbcore: registered new interface driver brcmfmac [ 155.452530] pci 0000:00:00.0: enabling device (0140 -> 0142) [ 155.458207] brcmfmac 0000:01:00.0: enabling device (0140 -> 0142) [ 155.822283] brcmfmac 0000:01:00.0: Direct firmware load for brcm/brcmfmac4366b-pcie.txt failed with error -2 [ 155.832177] brcmfmac 0000:01:00.0: Falling back to user helper [ 155.843965] firmware brcm!brcmfmac4366b-pcie.txt: firmware_loading_store: map pages failed [ 156.129238] brcmfmac: brcmf_pcie_bus_console_init Console: base 3ffcf0, buf 3fbce8, size 16384 [ 156.131866] brcmfmac: CONSOLE: 000000.000 initvars_cis_pci: Not CIS format [ 156.131898] brcmfmac: CONSOLE: 000000.000 srom rev:0 [ 156.131940] brcmfmac: CONSOLE: 000000.000 initvars_srom_pci, SROM CRC Error [ 156.131979] brcmfmac: CONSOLE: 000000.000 Setting clocks to 800/400/200 [ 156.132032] brcmfmac: CONSOLE: 000000.000 si_set_bb_vcofreq_frac: only work on 4360, 4350 [ 156.132061] brcmfmac: CONSOLE: 000000.000 Enabling D-cache [ 156.132095] brcmfmac: CONSOLE: 026738.568 gic_dist_init max_irq 64 [ 156.132143] brcmfmac: CONSOLE: 026738.569 c_init: Watchdog reset bit set, clearing [ 156.132157] brcmfmac: CONSOLE: 026738.569 [ 156.132228] brcmfmac: CONSOLE: RTE (PCIE-MSG_BUF) 10.10.69.3309 (r610991) on BCM4366 r3 @ 40.0/200.0/800.0MHz [ 156.132286] brcmfmac: CONSOLE: 026738.569 nvram_init: called again without calling nvram_exit() [ 156.132327] brcmfmac: CONSOLE: 026738.569 initvars_cis_pci: Not CIS format [ 156.132349] brcmfmac: CONSOLE: 026738.601 srom rev:0 [ 156.132391] brcmfmac: CONSOLE: 026738.601 initvars_srom_pci, SROM CRC Error [ 156.132438] brcmfmac: CONSOLE: 026738.601 allocating a max of 511 rxcplid buffers [ 156.132486] brcmfmac: CONSOLE: 026738.601 pciemsgbuf0: Broadcom PCIE MSGBUF driver [ 156.132543] brcmfmac: CONSOLE: 026738.601 nvram_init: called again without calling nvram_exit() [ 156.132584] brcmfmac: CONSOLE: 026738.601 initvars_cis_pci: Not CIS format [ 156.132606] brcmfmac: CONSOLE: 026738.634 srom rev:0 [ 156.132649] brcmfmac: CONSOLE: 026738.634 initvars_srom_pci, SROM CRC Error [ 156.132699] brcmfmac: CONSOLE: 026738.634 wlc_ucode_download: wl0: Loading non-MU ucode [ 156.132755] brcmfmac: CONSOLE: 026738.634 reclaim section 0: Returned 216 bytes to the heap [ 156.132795] brcmfmac: CONSOLE: 026738.634 initvars_cis_pci: Not CIS format [ 156.132819] brcmfmac: CONSOLE: 026738.667 srom rev:0 [ 156.132860] brcmfmac: CONSOLE: 026738.667 initvars_srom_pci, SROM CRC Error [ 156.132909] brcmfmac: CONSOLE: 026738.667 wlc_bmac_attach, deviceid 0x43c4 nbands 1 [ 156.132969] brcmfmac: CONSOLE: 026738.672 ipxotp_init: mapping otpbase at 0x18007000 to 0x18007000 [ 156.133076] brcmfmac: CONSOLE: 026738.673 wl0: wlc_bmac_attach: chiprev 3 corerev 64 cccap 0x58400009 maccap 0xf0018705 band 2.4G, phy_type 11 phy_rev 32 [ 156.133135] brcmfmac: CONSOLE: 026738.673 enable 1: q0 frmcnt 0, wrdcnt 0, q1 frmcnt 0, wrdcnt 0 [ 156.133194] brcmfmac: CONSOLE: 026738.673 enable 1: q0 frmcnt 0, wrdcnt 0, q1 frmcnt 0, wrdcnt 0 [ 156.133243] brcmfmac: CONSOLE: 026738.674 wl0: wlc_stf_txcore_shmem_write: No clock [ 156.133302] brcmfmac: CONSOLE: 026738.675 wl0: wlc_ampdu_tx_set: AGG Mode = MAC+AQM txmaxpkts 512 [ 156.133377] brcmfmac: CONSOLE: 026738.676 wl0: Broadcom BCM4366 802.11 Wireless Controller 10.10.69.3309 (r610991) [ 156.133425] brcmfmac: CONSOLE: 026738.676 SPLITRX_MODE_2 enabled : tcmsegsize 160 [ 156.133462] brcmfmac: CONSOLE: 026738.676 TCAM: 512 used: 135 exceed:0 [ 156.133520] brcmfmac: CONSOLE: 026738.676 reclaim section 1: Returned 177368 bytes to the heap [ 156.133554] brcmfmac: CONSOLE: 026738.677 ThreadX v5.6 initialized [ 156.133590] brcmfmac: CONSOLE: [ 156.133853] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Jan 8 2016 12:54:07 version 10.10.69.3309 (r610991) FWID 01-c47a91a4 [ 156.147122] brcmfmac: CONSOLE: 026738.713 wl0: wlc_enable_probe_req: state down, deferring setting of host flags [ 156.152537] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30) [ 156.161409] brcmfmac: CONSOLE: 026738.727 wl0: wlc_enable_probe_req: state down, deferring setting of host flags [ 156.161666] brcmfmac: CONSOLE: 026738.727 wl0: wlc_enable_probe_req: state down, deferring setting of host flags [ 156.162437] pci 0001:00:00.0: enabling device (0140 -> 0142) [ 156.168160] brcmfmac 0001:01:00.0: enabling device (0140 -> 0142) [ 156.331808] brcmfmac 0001:01:00.0: Direct firmware load for brcm/brcmfmac4366b-pcie.txt failed with error -2 [ 156.341714] brcmfmac 0001:01:00.0: Falling back to user helper [ 156.353306] firmware brcm!brcmfmac4366b-pcie.txt: firmware_loading_store: map pages failed [ 156.639236] brcmfmac: brcmf_pcie_bus_console_init Console: base 3ffcf0, buf 3fbce8, size 16384 [ 156.641854] brcmfmac: CONSOLE: 000000.000 initvars_cis_pci: Not CIS format [ 156.641886] brcmfmac: CONSOLE: 000000.000 srom rev:0 [ 156.641928] brcmfmac: CONSOLE: 000000.000 initvars_srom_pci, SROM CRC Error [ 156.641967] brcmfmac: CONSOLE: 000000.000 Setting clocks to 800/400/200 [ 156.642020] brcmfmac: CONSOLE: 000000.000 si_set_bb_vcofreq_frac: only work on 4360, 4350 [ 156.642049] brcmfmac: CONSOLE: 000000.000 Enabling D-cache [ 156.642083] brcmfmac: CONSOLE: 026738.568 gic_dist_init max_irq 64 [ 156.642131] brcmfmac: CONSOLE: 026738.569 c_init: Watchdog reset bit set, clearing [ 156.642145] brcmfmac: CONSOLE: 026738.569 [ 156.642213] brcmfmac: CONSOLE: RTE (PCIE-MSG_BUF) 10.10.69.3309 (r610991) on BCM4366 r3 @ 40.0/200.0/800.0MHz [ 156.642271] brcmfmac: CONSOLE: 026738.569 nvram_init: called again without calling nvram_exit() [ 156.642312] brcmfmac: CONSOLE: 026738.569 initvars_cis_pci: Not CIS format [ 156.642334] brcmfmac: CONSOLE: 026738.601 srom rev:0 [ 156.642376] brcmfmac: CONSOLE: 026738.601 initvars_srom_pci, SROM CRC Error [ 156.642422] brcmfmac: CONSOLE: 026738.601 allocating a max of 511 rxcplid buffers [ 156.642470] brcmfmac: CONSOLE: 026738.601 pciemsgbuf0: Broadcom PCIE MSGBUF driver [ 156.642527] brcmfmac: CONSOLE: 026738.601 nvram_init: called again without calling nvram_exit() [ 156.642568] brcmfmac: CONSOLE: 026738.601 initvars_cis_pci: Not CIS format [ 156.642590] brcmfmac: CONSOLE: 026738.633 srom rev:0 [ 156.642632] brcmfmac: CONSOLE: 026738.633 initvars_srom_pci, SROM CRC Error [ 156.642683] brcmfmac: CONSOLE: 026738.634 wlc_ucode_download: wl0: Loading non-MU ucode [ 156.642738] brcmfmac: CONSOLE: 026738.634 reclaim section 0: Returned 216 bytes to the heap [ 156.642778] brcmfmac: CONSOLE: 026738.634 initvars_cis_pci: Not CIS format [ 156.642800] brcmfmac: CONSOLE: 026738.667 srom rev:0 [ 156.642841] brcmfmac: CONSOLE: 026738.667 initvars_srom_pci, SROM CRC Error [ 156.642890] brcmfmac: CONSOLE: 026738.667 wlc_bmac_attach, deviceid 0x43c5 nbands 1 [ 156.642949] brcmfmac: CONSOLE: 026738.675 ipxotp_init: mapping otpbase at 0x18007000 to 0x18007000 [ 156.643054] brcmfmac: CONSOLE: 026738.675 wl0: wlc_bmac_attach: chiprev 3 corerev 64 cccap 0x58400009 maccap 0xf0018705 band 5G, phy_type 11 phy_rev 32 [ 156.643113] brcmfmac: CONSOLE: 026738.675 enable 1: q0 frmcnt 0, wrdcnt 0, q1 frmcnt 0, wrdcnt 0 [ 156.643172] brcmfmac: CONSOLE: 026738.675 enable 1: q0 frmcnt 0, wrdcnt 0, q1 frmcnt 0, wrdcnt 0 [ 156.643220] brcmfmac: CONSOLE: 026738.676 wl0: wlc_stf_txcore_shmem_write: No clock [ 156.643280] brcmfmac: CONSOLE: 026738.677 wl0: wlc_ampdu_tx_set: AGG Mode = MAC+AQM txmaxpkts 512 [ 156.643353] brcmfmac: CONSOLE: 026738.679 wl0: Broadcom BCM4366 802.11 Wireless Controller 10.10.69.3309 (r610991) [ 156.643401] brcmfmac: CONSOLE: 026738.679 SPLITRX_MODE_2 enabled : tcmsegsize 160 [ 156.643438] brcmfmac: CONSOLE: 026738.679 TCAM: 512 used: 135 exceed:0 [ 156.643495] brcmfmac: CONSOLE: 026738.679 reclaim section 1: Returned 177368 bytes to the heap [ 156.643529] brcmfmac: CONSOLE: 026738.680 ThreadX v5.6 initialized [ 156.643564] brcmfmac: CONSOLE: [ 156.643839] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Jan 8 2016 12:54:07 version 10.10.69.3309 (r610991) FWID 01-c47a91a4 [ 156.657096] brcmfmac: CONSOLE: 026738.709 wl0: wlc_enable_probe_req: state down, deferring setting of host flags [ 156.671363] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30) [ 156.679350] brcmfmac: CONSOLE: 026738.732 wl0: wlc_enable_probe_req: state down, deferring setting of host flags [ 156.679543] brcmfmac: CONSOLE: 026738.732 wl0: wlc_enable_probe_req: state down, deferring setting of host flags 2) hostapd [ 168.539516] brcmfmac: CONSOLE: 026750.572 wl0: wl_open [ 168.539577] brcmfmac: CONSOLE: 026750.573 wlc_ucode_download: wl0: Loading non-MU ucode [ 168.539622] brcmfmac: CONSOLE: 026750.574 wl0: CORE INIT : nfifo 6 mu_tx_enab 0 [ 168.539700] brcmfmac: CONSOLE: 026750.574 wl0: CORE INIT : mode 2 pktclassify 1 rxsplit 0 hdr conve 0 DMA_CT Disabled [ 168.539772] brcmfmac: CONSOLE: 026750.587 wl0: wlc_enable_probe_req: state down, deferring setting of host flags [ 168.539832] brcmfmac: CONSOLE: 026750.588 enable 1: q0 frmcnt 0, wrdcnt 0, q1 frmcnt 0, wrdcnt 0 [ 168.541546] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready [ 168.548945] device wlan1 entered promiscuous mode [ 168.555693] brcmfmac: CONSOLE: 026750.604 wl0: bc/mc deauth_reason on STA BSS? [ 168.637607] brcmfmac: CONSOLE: 026750.671 wl0: wl_open [ 168.637665] brcmfmac: CONSOLE: 026750.672 wlc_ucode_download: wl0: Loading non-MU ucode [ 168.637710] brcmfmac: CONSOLE: 026750.673 wl0: CORE INIT : nfifo 6 mu_tx_enab 0 [ 168.637787] brcmfmac: CONSOLE: 026750.673 wl0: CORE INIT : mode 2 pktclassify 1 rxsplit 0 hdr conve 0 DMA_CT Disabled [ 168.637858] brcmfmac: CONSOLE: 026750.686 wl0: wlc_enable_probe_req: state down, deferring setting of host flags [ 168.637917] brcmfmac: CONSOLE: 026750.686 enable 1: q0 frmcnt 0, wrdcnt 0, q1 frmcnt 0, wrdcnt 0 [ 168.646511] brcmfmac: CONSOLE: 026750.695 wl0: link up (wl0) [ 168.646513] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready [ 168.646632] br-lan: port 2(wlan1) entered forwarding state [ 168.646665] br-lan: port 2(wlan1) entered forwarding state [ 168.668259] device wlan1-1 entered promiscuous mode [ 168.674240] IPv6: ADDRCONF(NETDEV_UP): wlan1-1: link is not ready [ 168.680458] br-lan: port 3(wlan1-1) entered forwarding state [ 168.686216] br-lan: port 3(wlan1-1) entered forwarding state [ 168.759844] brcmfmac: CONSOLE: 026750.808 wl0: wl_open [ 168.765898] brcmfmac: CONSOLE: 026750.814 wl0: link up (wl0.2) [ 168.765961] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1-1: link becomes ready [ 169.929714] brcmfmac: CONSOLE: 026751.686 pciedev_send_ltr:Giving up:0x302 [ 170.649221] br-lan: port 2(wlan1) entered forwarding state [ 170.689217] br-lan: port 3(wlan1-1) entered forwarding state 3) killall hostapd [ 234.424528] device wlan1-1 left promiscuous mode [ 234.429453] br-lan: port 3(wlan1-1) entered disabled state [ 234.842185] brcmfmac: CONSOLE: 026816.727 wl0: link down (wl0) [ 234.842224] brcmfmac: CONSOLE: 026816.727 wl0: link down (wl0.2) [ 235.409533] device wlan1 left promiscuous mode [ 235.414059] br-lan: port 2(wlan1) entered disabled state [ 235.846072] brcmfmac: CONSOLE: 026817.714 wl0: wl_open [ 235.846131] brcmfmac: CONSOLE: 026817.714 wlc_ucode_download: wl0: Loading non-MU ucode [ 235.846176] brcmfmac: CONSOLE: 026817.716 wl0: CORE INIT : nfifo 6 mu_tx_enab 0 [ 235.846254] brcmfmac: CONSOLE: 026817.716 wl0: CORE INIT : mode 2 pktclassify 1 rxsplit 0 hdr conve 0 DMA_CT Disabled [ 235.846327] brcmfmac: CONSOLE: 026817.729 wl0: wlc_enable_probe_req: state down, deferring setting of host flags [ 235.846385] brcmfmac: CONSOLE: 026817.729 enable 1: q0 frmcnt 0, wrdcnt 0, q1 frmcnt 0, wrdcnt 0 4) iw phy phy1 interface add wlan1-1 type __ap [ 256.819225] brcmfmac: brcmf_ap_add_vif: timeout occurred