mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btmtksdio: Fix spurious ownership error logs
@ 2026-09-14  9:46 Tzung-Bi Shih
  2026-09-14 14:30 ` patchwork-bot+bluetooth
  0 siblings, 1 reply; 2+ messages in thread
From: Tzung-Bi Shih @ 2026-09-14  9:46 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: Matthias Brugger, AngeloGioacchino Del Regno, linux-bluetooth,
	linux-kernel, linux-mediatek, tzungbi

In btmtksdio_fw_pmctrl(), if an early operation fails (like clearing
the mailbox ACK), it jumps to the `out:` label and spuriously prints
"Cannot return ownership to device".

Evaluate the ownership return errors locally to ensure the error log is
only printed if the actual ownership transaction fails.

Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
 drivers/bluetooth/btmtksdio.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index fe4ca9395aa3..c5f2967f847f 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -360,18 +360,14 @@ static int btmtksdio_fw_pmctrl(struct btmtksdio_dev *bdev)
 
 	/* Return ownership to the device */
 	sdio_writel(bdev->func, C_FW_OWN_REQ_SET, MTK_REG_CHLPCR, &err);
+	if (err == 0)
+		err = readx_poll_timeout(btmtksdio_drv_own_query, bdev, status,
+					 !(status & C_COM_DRV_OWN), 2000, 1000000);
 	if (err < 0)
-		goto out;
-
-	err = readx_poll_timeout(btmtksdio_drv_own_query, bdev, status,
-				 !(status & C_COM_DRV_OWN), 2000, 1000000);
-
+		bt_dev_err(bdev->hdev, "Cannot return ownership to device");
 out:
 	sdio_release_host(bdev->func);
 
-	if (err < 0)
-		bt_dev_err(bdev->hdev, "Cannot return ownership to device");
-
 	return err;
 }
 
-- 
2.55.0.1007.g17ff1f9808-goog


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

end of thread, other threads:[~2026-09-14 14:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-14  9:46 [PATCH] Bluetooth: btmtksdio: Fix spurious ownership error logs Tzung-Bi Shih
2026-09-14 14:30 ` patchwork-bot+bluetooth

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

all inboxes | Powered by JetHome®