bes2600: reset firmware state on wsm_join_confirm failure #12
Reference in New Issue
Block a user
Delete Branch "bes2600/wsm-join-confirm-reset"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes besser#25.
Problem
When
wsm_join_confirm()returns status 1 (firmware-rejected JOIN), the driver clears its bookkeeping but does not reset the firmware. A rapid second JOIN attempt — e.g. wpa_supplicant retrying after thePREV_AUTH_NOT_VALIDdeauth mac80211 emits to clean up — hits an inconsistent firmware context, causingbes2600_sdio_read_rx_batchSDIO error followed by thewifi_force_close/tx_loop_set_enableWARN_ONcascade.Reproduced 2026-05-21 on pkgrel=5 (per-series reconstruction), boot -1: two consecutive JOIN failures to the wohnzimmer 5 GHz AP (
c0:25:06:e6:5b:32) 10 minutes apart, the second triggering the full cascade.cw1200 ancestor
drivers/net/wireless/st/cw1200/sta.c,cw1200_join_work()lines 1339-1344:cw1200 queues
unjoin_workon join failure.cw1200_do_unjoin()callswsm_reset()whenjoin_status == STA, which in cw1200's call sequence is the usual state after a failed JOIN (prior association existed).bes2600 divergence requiring direct wsm_reset
bes2600_unjoin_work()gates itswsm_resetcall onpriv->join_status != BES2600_JOIN_STATUS_PASSIVE. After a failed JOIN in bes2600,join_statusstays PASSIVE (it is only set to STA in the success branch). Queuingunjoin_workalone therefore skips the reset.This PR therefore does both halves of the fix:
Direct
wsm_reset(hw_priv, &join_fail_reset, priv->if_id)in the failure path, compensating for the PASSIVE gate inbes2600_unjoin_work(). Contract:wsm_resettakes onlywsm_cmd_lock;conf_lockheld here is compatible;wsm_oper_unlockwas already called insidewsm_join_confirm()beforewsm_join()returned-EINVAL.queue_work(workqueue, &priv->unjoin_work)instead of directwsm_unlock_tx(). Serialises the next association attempt through the workqueue so it cannot race against any lingering firmware-side effects. Ifunjoin_workis already queued, release TX immediately, matching cw1200'sTx lock still heldcomment.Testing
Soak test pending — branch
bes2600/wsm-join-confirm-resetto be integrated into the next per-series build iteration. Acceptance:wsm_join_confirm ret 1may still occur (firmware-side reject is independent), but nobes2600_sdio_read_rx_batch sdio read errorand nowifi_force_closecascade following itMobian flavor (this branch, on top of
cleanups) and danctnix flavor (bes2600/join-confirm-failure-reseton top ofbes2600/besser-danctnix-v3) are bit-identical except for the surrounding context per the dual-tree-flavors convention.References
drivers/net/wireless/st/cw1200/sta.c:1339-1344f70b826de75645dcb4b015a44cd4f785, kernel log 07:53-08:04Signed-off-by: Claude (noether) claude@reauktion.de