Devicetree
 help / color / mirror / Atom feed
* [PATCH wireless-next v2 0/2] wifi: wfx: fix possible device hang during init
@ 2026-09-01  8:33 Jérôme Pouiller
  2026-09-01  8:33 ` [PATCH wireless-next v2 1/2] " Jérôme Pouiller
  2026-09-01  8:33 ` [PATCH wireless-next v2 2/2] dt-bindings: net: wireless: wfx: discourage OOB IRQ with SDIO Jérôme Pouiller
  0 siblings, 2 replies; 9+ messages in thread
From: Jérôme Pouiller @ 2026-09-01  8:33 UTC (permalink / raw)
  To: linux-wireless, devicetree
  Cc: linux-kernel, linux-devel, Johannes Berg, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Lukas Stockmann,
	Gerard Salvatella, Jérôme Pouiller

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(-)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-09-03 10:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01  8:33 [PATCH wireless-next v2 0/2] wifi: wfx: fix possible device hang during init Jérôme Pouiller
2026-09-01  8:33 ` [PATCH wireless-next v2 1/2] " Jérôme Pouiller
2026-09-01  8:50   ` sashiko-bot
2026-09-01 10:02     ` Jérôme Pouiller
2026-09-01 10:43   ` Sverdlin, Alexander
2026-09-01 12:40     ` Sverdlin, Alexander
2026-09-01 14:15     ` Jérôme Pouiller
2026-09-01  8:33 ` [PATCH wireless-next v2 2/2] dt-bindings: net: wireless: wfx: discourage OOB IRQ with SDIO Jérôme Pouiller
2026-09-03 10:29   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox