mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_qca: Fix WCN3950 missing regulator release
@ 2026-10-27 19:36 Stanislavs Nilovs
  2026-10-28 10:08 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Stanislavs Nilovs @ 2026-10-27 19:36 UTC (permalink / raw)
  To: brgl, marcel, luiz.dentz, lumag
  Cc: linux-bluetooth, linux-arm-msm, linux-kernel

hci_qca driver is missing release of power regulators when module is
powered off or serial device is removed. This issue is most noticeable
during system shutdown, since the regulator core is firing a warning
backtrace that regulator to be freed still has enable_count.

The issue was found with the help of Claude Opus 5 (Anthropic), which
was asked to review drivers/bluetooth/hci_qca.c for the appearing
regulator warning backtrace during system shutdown. The fix itself was
generated by the tool and reviewed by me by applying it, building the
code and verifying issue is not reproduced anymore.

Tested on real hardware, but not on Linux's master branch. Driver was
backported to Linux 5.15 for internal testing and this is when the issue
was noticed.

Fixes: d5712c511cb3 ("Bluetooth: qca: add WCN3950 support")
Signed-off-by: Stanislavs Nilovs <valorcool@gmail.com>
---
 drivers/bluetooth/hci_qca.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 7089e9b639b2..e22e2269efd7 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -2247,6 +2247,7 @@ static void qca_power_off(struct hci_uart *hu)
 	power = qcadev->bt_power;
 
 	switch (soc_type) {
+	case QCA_WCN3950:
 	case QCA_WCN3988:
 	case QCA_WCN3990:
 	case QCA_WCN3991:
@@ -2271,6 +2272,7 @@ static void qca_power_off(struct hci_uart *hu)
         }
 
 	switch (soc_type) {
+	case QCA_WCN3950:
 	case QCA_WCN3988:
 	case QCA_WCN3990:
 	case QCA_WCN3991:
@@ -2582,6 +2584,7 @@ static void qca_serdev_remove(struct serdev_device *serdev)
 	struct qca_power *power = qcadev->bt_power;
 
 	switch (qcadev->btsoc_type) {
+	case QCA_WCN3950:
 	case QCA_WCN3988:
 	case QCA_WCN3990:
 	case QCA_WCN3991:
-- 
2.53.0


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

end of thread, other threads:[~2026-10-28 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 19:36 [PATCH] Bluetooth: hci_qca: Fix WCN3950 missing regulator release Stanislavs Nilovs
2026-10-28 10:08 ` Bartosz Golaszewski

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®