[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e8480933f01de26143d466b69ab5d0fa70e84ace.1637360076.git.objelf@gmail.com>
Date: Sat, 20 Nov 2021 06:25:46 +0800
From: <sean.wang@...iatek.com>
To: <marcel@...tmann.org>, <johan.hedberg@...il.com>
CC: <Mark-YW.Chen@...iatek.com>, <sean.wang@...iatek.com>,
<Soul.Huang@...iatek.com>, <YN.Chen@...iatek.com>,
<Leon.Yen@...iatek.com>, <Eric-SY.Chang@...iatek.com>,
<Deren.Wu@...iatek.com>, <km.lin@...iatek.com>,
<robin.chiu@...iatek.com>, <Eddie.Chen@...iatek.com>,
<ch.yeh@...iatek.com>, <posh.sun@...iatek.com>,
<ted.huang@...iatek.com>, <Eric.Liang@...iatek.com>,
<Stella.Chang@...iatek.com>, <Tom.Chou@...iatek.com>,
<steve.lee@...iatek.com>, <jsiuda@...gle.com>,
<frankgor@...gle.com>, <jemele@...gle.com>,
<abhishekpandit@...gle.com>, <michaelfsun@...gle.com>,
<mcchou@...omium.org>, <shawnku@...gle.com>,
<linux-bluetooth@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>,
Mark-yw Chen <mark-yw.chen@...iatek.com>
Subject: [PATCH 4/4] Bluetooth: btmtksdio: add support of processing firmware coredump and log
From: Sean Wang <sean.wang@...iatek.com>
Add support of processing the firmware coredump and log for the diagnostic
purpose.
Co-developed-by: Mark-yw Chen <mark-yw.chen@...iatek.com>
Signed-off-by: Mark-yw Chen <mark-yw.chen@...iatek.com>
Signed-off-by: Sean Wang <sean.wang@...iatek.com>
---
drivers/bluetooth/btmtksdio.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index cae1fcd15512..adf9c89648cc 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -324,8 +324,29 @@ static int btmtksdio_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
return err;
}
+static int btmtksdio_recv_acl(struct hci_dev *hdev, struct sk_buff *skb)
+{
+ struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
+ u16 handle = le16_to_cpu(hci_acl_hdr(skb)->handle);
+
+ switch (handle) {
+ case 0xfc6f:
+ /* Firmware dump from device: when the firmware hangs, the
+ * device can no longer suspend and thus disable auto-suspend.
+ */
+ pm_runtime_forbid(bdev->dev);
+ fallthrough;
+ case 0x05ff:
+ case 0x05fe:
+ /* Firmware debug logging */
+ return hci_recv_diag(hdev, skb);
+ }
+
+ return hci_recv_frame(hdev, skb);
+}
+
static const struct h4_recv_pkt mtk_recv_pkts[] = {
- { H4_RECV_ACL, .recv = hci_recv_frame },
+ { H4_RECV_ACL, .recv = btmtksdio_recv_acl },
{ H4_RECV_SCO, .recv = hci_recv_frame },
{ H4_RECV_EVENT, .recv = btmtksdio_recv_event },
};
--
2.25.1
Powered by blists - more mailing lists