[PATCH wireless-next 2/2] wifi: wfx: fix error code on unsupported firmware
From: Jérôme Pouiller
Date: Sun Sep 06 2026 - 16:51:10 EST
The 'secure link' feature is not supported by upstream (the reference
code relies on mbedTLS to implement it, which is not an option for the
Linux kernel).
If the firmware enforce the 'secure link' feature, wfx_probe() exits
early. However, err still holds the value returned by the previous call
to wait_for_completion_timeout(), which is the number of jiffies left
before the timeout, hence strictly positive (the zero case is handled
just above).
wfx_probe() therefore returns a positive value. The bus probe functions
forward it as-is and the driver core negates it (see really_probe()).
The device does not get bound, which is the expected outcome, but the
reported error code is a meaningless negative jiffies count instead of
an errno.
Return -EOPNOTSUPP, as already done a few lines above when the firmware
API version is not supported.
Copilot reviewed the code and wrote some parts of the log.
Reported-by: Alexander Sverdlin <alexander.sverdlin@xxxxxxxxxxx>
Closes: https://lore.kernel.org/all/cc4de4e40e3ca50e7288be2b9067802576567c25.camel@xxxxxxxxxxx/
Assisted-by: Copilot:claude-opus-5
Signed-off-by: Jérôme Pouiller <jerome.pouiller@xxxxxxxxxx>
---
drivers/net/wireless/silabs/wfx/main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/silabs/wfx/main.c b/drivers/net/wireless/silabs/wfx/main.c
index b6fd9d4c1f5fc..16d5b51f6f03a 100644
--- a/drivers/net/wireless/silabs/wfx/main.c
+++ b/drivers/net/wireless/silabs/wfx/main.c
@@ -411,6 +411,7 @@ int wfx_probe(struct wfx_dev *wdev)
if (wdev->hw_caps.link_mode == SEC_LINK_ENFORCED) {
dev_err(wdev->dev, "chip require secure_link, but can't negotiate it\n");
+ err = -EOPNOTSUPP;
goto irq_unsubscribe;
}
--
2.47.3