Skip to contentSkip to conversation

Enable subsystem restart for Qualcomm bluetooth chip wcn3990.

PATCH In review Balakrishna Godavarthi 1 participant 3 messages Jul 9, 2018

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

cover Enable subsystem restart for Qualcomm bluetooth chip wcn3990.

In many platforms Bluetooth chip wcn3990 is a discrete chip connected via UART lines to app processor. if the chip goes into bad state i.e. into hard fault exception routine, which will not further respond to any commands from HOST via UART. In that case wcn3390 will intimate HOST by generating hardware error. Host stack will initiate a close and reopen of the hci driver. Prior to sending hard ware error, wcn3990 has a capability of sending the RAM dump i.e. memory dump of the BT chip. this will help us to fix stability issues of the SoC. We at QCA driver read the dump packets and store via devcoredump().
We perform restart after collecting the ram dump of the SoC.

Harish Bandi (1):
Bluetooth: hci_qca: Sub system restart support for WCN3990

 drivers/bluetooth/btqca.h   |   8 ++
 drivers/bluetooth/hci_qca.c | 261 ++++++++++++++++++++++++++++++++++++
 2 files changed, 269 insertions(+)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw

PATCH 1/1 Bluetooth: hci_qca: Sub system restart support for WCN3990

From: Harish Bandi <[email protected]>

This patch enables subsystem restart support(SSR) for Qualcomm Bluetooth Chip wcn3990. Subsystem restart is used to mitigate user experience interruption within SoC or fusion targets.
Those interruptions often come from a faulty subsystem with either SW errors or HWDOG BITE. Without subsystem restart architecture and solution, it requires system reboot if any faulty system occurs. However, subsystem restart doesn’t include RPM subsystem which controls the power state machine. If RRM crashes, the entire system will still reboot.

We will collect the ramdump of BT SoC before rebooting the HCI layer. System ramdump is a useful feature for helping debug. Before restarting a subsystem or a process running on a subsystem, it is often required to request either a subsystem or a process to perform proper cache dump and software failure reason into a memory buffer which application processor can retrieve afterwards. SW developers can often provide initial investigation by looking into that debugging information.

---
 drivers/bluetooth/btqca.h   |   8 ++
 drivers/bluetooth/hci_qca.c | 261 ++++++++++++++++++++++++++++++++++++
 2 files changed, 269 insertions(+)
drivers/bluetooth/btqca.h +8 -0
index 0c01f375fe83..4c9e3ae38961 100644
@@ -40,6 +40,14 @@
 #define QCA_WCN3990_POWERON_PULSE	0xFC
 #define QCA_WCN3990_POWEROFF_PULSE	0xC0
 
+#define QCA_SSR_SOCCRASH_BYTE        (0xfb)
+#define QCA_BT_CONTROLLER_LOG        (0x01)
+#define QCA_BT_MESSAGE_TYPE_MEM_DUMP (0x08)
+#define QCA_BT_MEM_DUMP_HEADER_SIZE  (4)
+#define QCA_BT_MEM_DUMP_PACKET_SIZE  (256)
+
+
+
 enum qca_bardrate {
 	QCA_BAUDRATE_115200 	= 0,
 	QCA_BAUDRATE_57600,
drivers/bluetooth/hci_qca.c +261 -0

341 lines not on this page · raw message

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#2 lore raw
In reply to Balakrishna Godavarthi

Forgot to add this patch is on top of
Following patches. Which are under review

https://patchwork.kernel.org/patch/10510029/
https://patchwork.kernel.org/patch/10510031/
https://patchwork.kernel.org/patch/10510037/
https://patchwork.kernel.org/patch/10510045/
https://patchwork.kernel.org/patch/10510033/
https://patchwork.kernel.org/patch/10510051/
https://patchwork.kernel.org/patch/10510047/

Quoted 18 lines · Balakrishna Godavarthi

In many platforms Bluetooth chip wcn3990 is a discrete chip connected via UART lines to app processor. if the chip goes into bad state i.e. into hard fault exception routine, which will not further respond to any commands from HOST via UART. In that case wcn3390 will intimate HOST by generating hardware error. Host stack will initiate a close and reopen of the hci driver. Prior to sending hard ware error, wcn3990 has a capability of sending the RAM dump i.e. memory dump of the BT chip. this will help us to fix stability issues of the SoC. We at QCA driver read the dump packets and store via devcoredump().
We perform restart after collecting the ram dump of the SoC.

Harish Bandi (1):
Bluetooth: hci_qca: Sub system restart support for WCN3990

 drivers/bluetooth/btqca.h   |   8 ++
 drivers/bluetooth/hci_qca.c | 261 ++++++++++++++++++++++++++++++++++++
 2 files changed, 269 insertions(+)
Signature · 2 lines
Regards
Balakrishna.