Devicetree
 help / color / mirror / Atom feed
From: "Jérôme Pouiller" <jerome.pouiller@silabs.com>
To: linux-wireless@vger.kernel.org, devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-devel@silabs.com,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Lukas Stockmann" <lukas.stockmann@siemens.com>,
	"Gerard Salvatella" <gerard.salvatella@siemens.com>,
	"Jérôme Pouiller" <jerome.pouiller@silabs.com>
Subject: [PATCH wireless-next 0/2] wifi: wfx: fix possible device hang during init
Date: Mon, 31 Aug 2026 18:40:11 +0200	[thread overview]
Message-ID: <20260831164056.47683-1-jerome.pouiller@silabs.com> (raw)

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.

[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        | 31 ++++++++++++-------
 4 files changed, 27 insertions(+), 14 deletions(-)

-- 
2.47.3


             reply	other threads:[~2026-08-31 16:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 16:40 Jérôme Pouiller [this message]
2026-08-31 16:40 ` [PATCH wireless-next 1/2] wifi: wfx: fix possible device hang during init Jérôme Pouiller
2026-08-31 19:23   ` sashiko-bot
2026-08-31 19:35     ` Jérôme Pouiller
2026-08-31 16:40 ` [PATCH wireless-next 2/2] dt-bindings: net: wireless: wfx: discourage OOB IRQ with SDIO Jérôme Pouiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260831164056.47683-1-jerome.pouiller@silabs.com \
    --to=jerome.pouiller@silabs.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gerard.salvatella@siemens.com \
    --cc=johannes@sipsolutions.net \
    --cc=krzk+dt@kernel.org \
    --cc=linux-devel@silabs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lukas.stockmann@siemens.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox