Repository navigation
wifi: brcmfmac: skip 500 ms down delay when not connected - #3169
Conversation
DjDeveloperr
left a comment
There was a problem hiding this comment.
Audited full diff at 043eb2b: having brcmf_link_down() return whether WLC_DISASSOC was actually sent and gating the 500 ms brcmf_delay() in both __brcmf_cfg80211_down() and brcmf_cfg80211_suspend() on that return value cleanly skips the redundant rtnl_lock sleep when already disconnected while preserving the wait whenever a disassoc event is expected. Verified checkpatch clean and J616s live results.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Host tests (tools/asahi/brcmf-suspend-tests.py) fail to compile the generated controls.c after changing brcmf_link_down() from void to bool:
error: statement requires expression of scalar type ('void' invalid) at if (brcmf_link_down(vif, WLAN_REASON_UNSPECIFIED, true)).
Please update the brcmf_link_down() stub in tools/asahi/brcmf-suspend-tests.py to return bool so host-tests passes cleanly (and once green, this will also need a second hardware generation test row for the shared brcmfmac path).
Both __brcmf_cfg80211_down() and brcmf_cfg80211_suspend() check BRCMF_VIF_STATUS_READY, call brcmf_link_down(), and then unconditionally sleep 500 ms via brcmf_delay(500) so wpa_supplicant can process the firmware DISASSOC event. When wpa_supplicant has already disconnected before bringing the interface down (as on every normal shutdown/reboot and suspend), BRCMF_VIF_STATUS_CONNECTED is already clear and brcmf_link_down() sends no WLC_DISASSOC to firmware, making the 500 ms sleep under rtnl_lock() pure delay. Return whether brcmf_link_down() actually sent WLC_DISASSOC and only sleep 500 ms when it did. Signed-off-by: Jonathan Goyvaerts <[email protected]>
043eb2b to
6662295
Compare
|
Amended at |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Stub fix in tools/asahi/brcmf-suspend-tests.py matches the new bool brcmf_link_down() signature cleanly, and the PR body now tracks the missing second-generation row. Holding merge until host-tests completes green and a second Mac generation row is posted.
|
|
What
Both
__brcmf_cfg80211_down()andbrcmf_cfg80211_suspend()checkBRCMF_VIF_STATUS_READY, callbrcmf_link_down(), and then unconditionally sleep 500 ms viabrcmf_delay(500)underrtnl_lock()sowpa_supplicantcan process the firmwareDISASSOCevent.When
wpa_supplicanthas already disconnected before bringing the interface down (as on every normal shutdown, reboot, and suspend),BRCMF_VIF_STATUS_CONNECTEDis already clear andbrcmf_link_down()sends noWLC_DISASSOCcommand to firmware, making the 500 ms sleep pure delay.Return whether
brcmf_link_down()actually sentWLC_DISASSOCand only sleep 500 ms when it did, and update thebrcmf_link_down()stub intools/asahi/brcmf-suspend-tests.pyto match theboolreturn type.Tested: J616s (MacBook Pro 16-inch M4 Pro, T6040) at 6662295 on 7.3.0-m4.190:
scripts/checkpatch.pl --strict0 errors / 0 warnings;python3 tools/asahi/brcmf-suspend-tests.py37/37 controls pass; booted live on J616s, verified 500 ms removed from interface teardown when already disconnected, Wi-Fi association, reconnect, and interface down/up clean with 0 kernel errors.Not yet: hardware test row from a second Mac generation (shared
brcmfmacpath).Risk: two-way · all Macs with Broadcom
brcmfmacWi-Fi