linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btmtksdio: Fix spurious ownership error logs
@ 2026-09-14  9:46 Tzung-Bi Shih
  2026-09-14 11:29 ` bluez.test.bot
  2026-09-14 14:30 ` [PATCH] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ 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 related	[flat|nested] 3+ messages in thread

* RE: Bluetooth: btmtksdio: Fix spurious ownership error logs
  2026-09-14  9:46 [PATCH] Bluetooth: btmtksdio: Fix spurious ownership error logs Tzung-Bi Shih
@ 2026-09-14 11:29 ` bluez.test.bot
  2026-09-14 14:30 ` [PATCH] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-09-14 11:29 UTC (permalink / raw)
  To: linux-bluetooth, tzungbi

[-- Attachment #1: Type: text/plain, Size: 1019 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/series/1164390/

---Test result---

Test Summary:
CheckPatch                    PASS      0.68 seconds
VerifyFixes                   PASS      0.10 seconds
VerifySignedoff               PASS      0.10 seconds
GitLint                       PASS      3.39 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      29.09 seconds
CheckAllWarning               PASS      33.28 seconds
CheckSparse                   PASS      36.32 seconds
BuildKernel32                 PASS      29.03 seconds
CheckKernelLLVM               PASS      35.00 seconds
TestRunnerSetup               PASS      772.25 seconds
IncrementalBuild              PASS      26.05 seconds



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

---
Regards,
Linux Bluetooth


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

* Re: [PATCH] Bluetooth: btmtksdio: Fix spurious ownership error logs
  2026-09-14  9:46 [PATCH] Bluetooth: btmtksdio: Fix spurious ownership error logs Tzung-Bi Shih
  2026-09-14 11:29 ` bluez.test.bot
@ 2026-09-14 14:30 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2026-09-14 14:30 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: marcel, luiz.dentz, matthias.bgg, angelogioacchino.delregno,
	linux-bluetooth, linux-kernel, linux-mediatek

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon, 14 Sep 2026 09:46:31 +0000 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - Bluetooth: btmtksdio: Fix spurious ownership error logs
    https://git.kernel.org/bluetooth/bluetooth-next/c/382fe279b7de

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

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

Thread overview: 3+ 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 11:29 ` bluez.test.bot
2026-09-14 14:30 ` [PATCH] " 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;
as well as URLs for NNTP newsgroup(s).