Skip to contentSkip to conversation

Bluetooth: hci_qca: Fix WCN3950 missing regulator release

PATCH In review Stanislavs Nilovs 3 participants 3 messages Oct 27 – Oct 28

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: hci_qca: Fix WCN3950 missing regulator release

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")
---
 drivers/bluetooth/hci_qca.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/bluetooth/hci_qca.c +3 -0
index 7089e9b639b2..e22e2269efd7 100644
@@ -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:
Signature · 1 line
2.53.0
#1 lore raw

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/1194889/

---Test result---

Test Summary:

CheckPatch                    PASS      0.64 seconds
VerifyFixes                   PASS      0.09 seconds
VerifySignedoff               PASS      0.10 seconds
GitLint                       PASS      0.27 seconds
SubjectPrefix                 PASS      0.09 seconds
BuildKernel                   PASS      27.86 seconds
CheckAllWarning               PASS      31.78 seconds
CheckSparse                   PASS      34.58 seconds
BuildKernel32                 PASS      28.11 seconds
CheckKernelLLVM               PASS      39.30 seconds
TestRunnerSetup               PASS      655.40 seconds
IncrementalBuild              PASS      26.65 seconds

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

---
Regards,
Linux Bluetooth

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Stanislavs Nilovs
Quoted 11 lines · Stanislavs Nilovs

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.

Quoted 7 lines

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")

---