All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] Bluetooth: btmtksdio: Fix runtime PM leak in btmtksdio_reset()
@ 2026-09-15  3:51 Wentao Liang
  2026-09-15  7:28 ` [1/4] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2026-09-15  3:51 UTC (permalink / raw)
  To: angelogioacchino.delregno
  Cc: chih-yin.chiang, linux-arm-kernel, linux-bluetooth, linux-kernel,
	linux-mediatek, luiz.dentz, marcel, mark-yw.chen, matthias.bgg,
	sean.wang, lkml, Wentao Liang, stable

btmtksdio_reset() takes a runtime PM reference with
pm_runtime_get_sync(bdev->dev), which leaves the device's usage
count incremented even when it fails.  However, when the reset has
already been started (BTMTKSDIO_HW_RESET_ACTIVE is found set by
test_and_set_bit()), the function returns early without dropping
that reference, leaking it on every concurrent reset request.

Add a pm_runtime_put_noidle() on the early-exit path to keep the
usage count balanced.

Fixes: 8fafe702253d ("Bluetooth: mt7921s: support bluetooth reset mechanism")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/bluetooth/btmtksdio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index 5b0fab7b89b5..243215a81fa7 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -1280,8 +1280,10 @@ static void btmtksdio_reset(struct hci_dev *hdev)
 
 	pm_runtime_get_sync(bdev->dev);
 
-	if (test_and_set_bit(BTMTKSDIO_HW_RESET_ACTIVE, &bdev->tx_state))
+	if (test_and_set_bit(BTMTKSDIO_HW_RESET_ACTIVE, &bdev->tx_state)) {
+		pm_runtime_put_noidle(bdev->dev);
 		return;
+	}
 
 	sdio_claim_host(bdev->func);
 
-- 
2.34.1


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

* RE: [1/4] Bluetooth: btmtksdio: Fix runtime PM leak in btmtksdio_reset()
  2026-09-15  3:51 [PATCH 1/4] Bluetooth: btmtksdio: Fix runtime PM leak in btmtksdio_reset() Wentao Liang
@ 2026-09-15  7:28 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-09-15  7:28 UTC (permalink / raw)
  To: linux-bluetooth, vulab

[-- 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/1165045/

---Test result---

Test Summary:
CheckPatch                    PASS      1.31 seconds
VerifyFixes                   PASS      0.11 seconds
VerifySignedoff               PASS      0.17 seconds
GitLint                       PASS      0.60 seconds
SubjectPrefix                 PASS      0.20 seconds
BuildKernel                   PASS      28.31 seconds
CheckAllWarning               PASS      32.38 seconds
CheckSparse                   PASS      35.52 seconds
BuildKernel32                 PASS      29.13 seconds
CheckKernelLLVM               PASS      33.74 seconds
TestRunnerSetup               PASS      730.24 seconds
IncrementalBuild              PASS      28.47 seconds



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

---
Regards,
Linux Bluetooth


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

end of thread, other threads:[~2026-09-15  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15  3:51 [PATCH 1/4] Bluetooth: btmtksdio: Fix runtime PM leak in btmtksdio_reset() Wentao Liang
2026-09-15  7:28 ` [1/4] " bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.