wifi: wfx: fix possible device hang during init
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 5 repliesIn review
- v12 patches 1 replySuperseded
Changes in v2 from the cover letter
- Subscribe IRQ before wfx_init_device(). So it avoids possible race between IRQ enable and IRQ subscription (reported by sashiko-bot)
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | wifi: wfx: fix possible device hang during initdrivers/ drivers/ drivers/ | +26 | 4 replies | |
| 2/2 | dt-bindings: net: wireless: wfx: discourage OOB IRQ with SDIODocumentation/ | +3 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Alexander Sverdlin | Krzysztof Kozlowski |
|---|---|---|
| 1/2 | R-b T-b | |
| 2/2 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH wireless-next v2 0/2] wifi: wfx: fix possible device hang during init
The WFxxx devices provide an SDIO interface. Besides the usual in-band SDIO IRQ, they also support an out-of-band (OOB) IRQ line declared in the Device Tree.
The OOB IRQ line is not usable until the device has been configured by the PDS file. Therefore, since commit f00dc1d789e1c ("staging: wfx: poll IRQ during init"), the driver polls the control register during the first exchanges with the device instead of relying on an IRQ. To keep the code simpler, this polling was applied unconditionally, including when an IRQ was readily available (in-band SDIO IRQ and SPI).
Unfortunately, this polling is unsafe. Commit 57aa557f110d9 ("staging:
wfx: introduce a way to poll IRQ") already mentioned that an IRQ could be lost if it fires while the host reads the control register. A recent analysis shows the consequences are worse than documented: the device itself gets stuck and stops answering subsequent commands. Only pulling the reset pin and rebinding the device recovers it.
Since the polling only happens during the two first exchanges, the issue is rare. It was caught by user while binding/rebinding the device in a loop for a few hours.
Patch 1 restricts the polling to the case where it is actually required (SDIO with OOB IRQ). The bus driver now tells wfx_probe() whether polling is necessary; in every other case the IRQ is subscribed before the first exchange and the racy path is never taken. This makes the vast majority of the integrations safe.
The SDIO + OOB IRQ combination remains affected. There is no way to fix it in software: polling is the only way to bootstrap that setup. Note that nobody reported using it in the last 6 years.
Patch 2 documents this hardware limitation in the binding, so that new designs do not pick this configuration.
v2:
- Subscribe IRQ before wfx_init_device(). So it avoids possible race between IRQ enable and IRQ subscription (reported by sashiko-bot)
[Copilot generated the introduction letter and reviewed the code]
Jérôme Pouiller (2):
wifi: wfx: fix possible device hang during init
dt-bindings: net: wireless: wfx: discourage OOB IRQ with SDIO
.../bindings/net/wireless/silabs,wfx.yaml | 3 ++ drivers/net/wireless/silabs/wfx/bh.c | 6 ++-- drivers/net/wireless/silabs/wfx/bus_sdio.c | 1 + drivers/net/wireless/silabs/wfx/main.c | 34 ++++++++++++------- 4 files changed, 29 insertions(+), 15 deletions(-)
Signature · 1 line
2.47.3