Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btmtksdio: Do not fail probe on wakeup init failure
@ 2026-08-25  8:43 Gongwei Li
  2026-08-25  9:32 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Gongwei Li @ 2026-08-25  8:43 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: Matthias Brugger, AngeloGioacchino Del Regno, Mark Chen,
	Sean Wang, linux-bluetooth, linux-kernel, linux-arm-kernel,
	linux-mediatek, Gongwei Li

From: Gongwei Li <ligongwei@kylinos.cn>

devm_device_init_wakeup() merely marks the device as wakeup-capable;
it is only consulted later through device_may_wakeup() in the ->wakeup
callback to decide whether wake-on-bluetooth can be used.  When it
fails, the controller itself still works normally and only the ability
to wake up the system is lost.  Therefore the failure is not fatal for
probe(), which is why the existing code only logs the error instead of
bailing out.

However, the negative error code returned by devm_device_init_wakeup()
is never cleared, so if the subsequent devm_gpiod_get_optional()
succeeds, probe() ends up returning the stale error even though
probing actually succeeded and the HCI device has already been
registered.  The SDIO core then wrongly treats the function as broken
and unbinds the driver.

Make the non-fatal semantics explicit: clear the error after logging
it and keep probing.

Fixes: ce64b3e94919 ("Bluetooth: mt7921s: Support wake on bluetooth")
Signed-off-by: Gongwei Li <ligongwei@kylinos.cn>
---
 drivers/bluetooth/btmtksdio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index 63d81341bd94..c918202f6c3a 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -1454,8 +1454,11 @@ static int btmtksdio_probe(struct sdio_func *func,
 	pm_runtime_put_noidle(bdev->dev);
 
 	err = devm_device_init_wakeup(bdev->dev);
-	if (err)
+	if (err) {
+		/* failure is not fatal, keep probing */
 		bt_dev_err(hdev, "failed to initialize device wakeup");
+		err = 0;
+	}
 
 	restore_node = false;
 	if (!of_device_is_compatible(bdev->dev->of_node, "mediatek,mt7921s-bluetooth")) {
-- 
2.25.1


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

* RE: Bluetooth: btmtksdio: Do not fail probe on wakeup init failure
  2026-08-25  8:43 [PATCH] Bluetooth: btmtksdio: Do not fail probe on wakeup init failure Gongwei Li
@ 2026-08-25  9:32 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-08-25  9:32 UTC (permalink / raw)
  To: linux-bluetooth, 13875017792

[-- Attachment #1: Type: text/plain, Size: 1181 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1151352

---Test result---

Test Summary:
CheckPatch                    PASS      0.61 seconds
VerifyFixes                   PASS      0.09 seconds
VerifySignedoff               PASS      0.09 seconds
GitLint                       PASS      0.24 seconds
SubjectPrefix                 PASS      0.08 seconds
BuildKernel                   PASS      28.84 seconds
CheckAllWarning               PASS      31.20 seconds
CheckSparse                   PASS      29.27 seconds
BuildKernel32                 PASS      26.97 seconds
CheckKernelLLVM               SKIP      0.00 seconds
TestRunnerSetup               PASS      518.92 seconds
IncrementalBuild              PASS      26.89 seconds

Details
##############################
Test: CheckKernelLLVM - SKIP
Desc: Build kernel with LLVM + context analysis
Output:
Clang not found


https://github.com/bluez/bluetooth-next/pull/651

---
Regards,
Linux Bluetooth


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

end of thread, other threads:[~2026-08-25  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25  8:43 [PATCH] Bluetooth: btmtksdio: Do not fail probe on wakeup init failure Gongwei Li
2026-08-25  9:32 ` bluez.test.bot

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