Bluetooth: qca: Disable SoC debug logging for WCN3990
PATCH 1/1 Bluetooth: qca: Disable SoC debug logging for WCN3990
Unless the host turns it off, the WCN3990 firmware sends debug logs to the host as ACL packets on handle 0x2EDC. hci_qca passes them on as diagnostic packets, which the core copies to the monitor socket and then frees. On a OnePlus 6T (SoC version 0x40010214, ROM version 0x0201) that is a packet of about 490 bytes every seven seconds on average, for as long as the controller is up.
The driver already turns this logging off after the firmware download for WCN3950 and WCN3991. Do the same for WCN3990.
Tested on a OnePlus 6T. With the crbtfw21.tlv rampatch from the OnePlus firmware, no diagnostic packets arrive any more. The controller also accepts the command with the crbtfw21.tlv from linux-firmware.
An AI assistant helped find and test this change and drafted this message.
---
Notes:
Test details (OnePlus 6T, crnv21.bin from the OnePlus firmware, counts from btmon):
- v7.2.10 with the postmarketOS sdm845 patches, OnePlus crbtfw21.tlv:
87 diagnostic packets in a ten-minute capture started a minute after boot without this patch, none with it.
- bluetooth-next (31333770a468), same firmware, btmon from boot: 42 in the first seven minutes without this patch, none with it; the command succeeded at every setup. Plain bluetooth-next hangs this phone after about seven minutes with or without this patch, hence the shorter window.
- v7.2.10 with linux-firmware's crbtfw21.tlv (its only WCN3990 rampatch): the controller returns success for the command (btmon during setup; not a ten-minute run).
Not tested on other WCN3990 boards.
drivers/bluetooth/btqca.c | 1 + 1 file changed, 1 insertion(+)
drivers/bluetooth/btqca.c +1 -0
@@ -944,6 +944,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,case QCA_QCA2066 :case QCA_QCA6390 :case QCA_WCN3950 : +case QCA_WCN3990 :case QCA_WCN3991 :case QCA_WCN6750 :case QCA_WCN6855 :
base-commit: a063a00e6cd9e354aa6d67a154a0527951d7f881
Signature · 1 line
2.56.0
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/1203508/
---Test result---
Test Summary:
CheckPatch PASS 0.64 seconds VerifyFixes PASS 0.10 seconds VerifySignedoff PASS 0.23 seconds GitLint FAIL 0.33 seconds SubjectPrefix PASS 0.19 seconds BuildKernel PASS 29.58 seconds CheckAllWarning PASS 33.34 seconds CheckSparse PASS 35.53 seconds BuildKernel32 PASS 29.84 seconds CheckKernelLLVM PASS 30.21 seconds TestRunnerSetup PASS 701.08 seconds IncrementalBuild PASS 36.27 seconds
Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
Bluetooth: qca: Disable SoC debug logging for WCN3990
26: B2 Line has trailing whitespace: " "
38: B2 Line has trailing whitespace: " "
https://github.com/bluez/bluetooth-next/pull/1073
---
Regards,
Linux Bluetooth
Quoted 14 lines · Hex Lindqvist
Unless the host turns it off, the WCN3990 firmware sends debug logs to the host as ACL packets on handle
0x2EDC.hci_qcapasses them on as diagnostic packets, which the core copies to the monitor socket and then frees. On a OnePlus 6T (SoC version0x40010214, ROM version0x0201) that is a packet of about 490 bytes every seven seconds on average, for as long as the controller is up.The driver already turns this logging off after the firmware download for WCN3950 and WCN3991. Do the same for WCN3990.
Tested on a OnePlus 6T. With the crbtfw21.tlv rampatch from the OnePlus firmware, no diagnostic packets arrive any more. The controller also accepts the command with the crbtfw21.tlv from linux-firmware.
Quoted 5 lines
An AI assistant helped find and test this change and drafted this message.
Signed-off-by Hex Lindqvist <[email protected]>---
Dear Hex,
Thank you for your patch.
Am 05.11.26 um 21:19 schrieb Hex Lindqvist:
Quoted 6 lines
Unless the host turns it off, the WCN3990 firmware sends debug logs to the host as ACL packets on handle
0x2EDC.hci_qcapasses them on as diagnostic packets, which the core copies to the monitor socket and then frees. On a OnePlus 6T (SoC version0x40010214, ROM version0x0201) that is a packet of about 490 bytes every seven seconds on average, for as long as the controller is up.
Does Linux log anything about this? Maybe, also paste an excerpt from btmon capture?
Quoted 6 lines
The driver already turns this logging off after the firmware download for WCN3950 and WCN3991. Do the same for WCN3990.
Tested on a OnePlus 6T. With the crbtfw21.tlv rampatch from the OnePlus firmware, no diagnostic packets arrive any more. The controller also accepts the command with the crbtfw21.tlv from linux-firmware.
Both firmware file names are the same. What is the difference?
Quoted 32 lines
An AI assistant helped find and test this change and drafted this message.
Signed-off-by Hex Lindqvist <[email protected]>---
Notes:
Test details (OnePlus 6T, crnv21.bin from the OnePlus firmware, counts from btmon):- v7.2.10 with the postmarketOS sdm845 patches, OnePlus crbtfw21.tlv:
87 diagnostic packets in a ten-minute capture started a minute after boot without this patch, none with it.
- bluetooth-next (31333770a468), same firmware, btmon from boot: 42 in the first seven minutes without this patch, none with it; the command succeeded at every setup. Plain bluetooth-next hangs this phone after about seven minutes with or without this patch, hence the shorter window.
- v7.2.10 with linux-firmware's crbtfw21.tlv (its only WCN3990 rampatch): the controller returns success for the command (btmon during setup; not a ten-minute run).Not tested on other WCN3990 boards.
drivers/bluetooth/btqca.c | 1 + 1 file changed, 1 insertion(+)drivers/bluetooth/btqca.c +0
-0
drivers/bluetooth/btqca.c int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, · line 950
Quoted 7 lines
drivers/bluetooth/btqca.c +1
-0@@ -944,6 +944,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,case QCA_QCA2066 :case QCA_QCA6390 :case QCA_WCN3950 : +case QCA_WCN3990 :case QCA_WCN3991 :case QCA_WCN6750 :case QCA_WCN6855 :
The diff looks good.
Kind regards,
Paul
Quoted 2 lines · Paul Menzel
Does Linux log anything about this? Maybe, also paste an excerpt from btmon capture?
No, Linux logs nothing; the packets only show up in btmon:
= Vendor Diagnostic (len 492) [hci0] 0.761331
dc 2e e8 01 e4 01 03 00 0a ff 10 04 01 00 55 53 ..............US
= Vendor Diagnostic (len 481) [hci0] 11.334015
dc 2e dd 01 d9 01 04 00 0a ff 10 04 01 00 51 d3 ..............Q.I will add this to the commit message in v2.
Quoted 1 line
Both firmware file names are the same. What is the difference?
They are different builds with the same file name:
OnePlus: BTFM.CHE.2.1.4.c2-00002-QCACHROMZ-2.184841.1
(216380 bytes, built Jan 3 2019, shipped with OxygenOS)
linux-firmware: BTFM.CHE.2.1.3.c7-00024-QCACHROM-1
(177060 bytes, built Dec 4 2018)Both TLV headers report the same ROM build (0x0201) and patch version (0x0002), so only the build label tells them apart. The controller returns the OnePlus label when asked with EDL_GET_BUILD_INFO_CMD; btqca does not send that for WCN3990, so it is not in the kernel log.
Thank you for the review.
Hex