lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231228092014.23184-1-peter.tsao@mediatek.com>
Date: Thu, 28 Dec 2023 17:20:14 +0800
From: Peter Tsao <peter.tsao@...iatek.com>
To: Marcel Holtmann <marcel@...tmann.org>, Johan Hedberg
	<johan.hedberg@...il.com>, Luiz Von Dentz <luiz.dentz@...il.com>
CC: Sean Wang <sean.wang@...iatek.com>, Deren Wu <deren.Wu@...iatek.com>,
	Chris Lu <chris.lu@...iatek.com>, Aaron Hou <aaron.hou@...iatek.com>, Steve
 Lee <steve.lee@...iatek.com>, linux-bluetooth
	<linux-bluetooth@...r.kernel.org>, linux-kernel
	<linux-kernel@...r.kernel.org>, linux-mediatek
	<linux-mediatek@...ts.infradead.org>, Peter Tsao <peter.tsao@...iatek.com>
Subject: [PATCH] Bluetooth: btusb: Fix MT7925 fail to send download patch command

Write the register 0x18011100[1] = 1 to avoid the device enter sleep
state during download patch flow on specific platform.

Error log:
Bluetooth: hci0: Execution of wmt command timed out
Bluetooth: hci0: Failed to send wmt patch dwnld (-110)
Bluetooth: hci0: Failed to set up firmware (-110)

Signed-off-by: Peter Tsao <peter.tsao@...iatek.com>
---
 drivers/bluetooth/btmtk.h | 3 +++
 drivers/bluetooth/btusb.c | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btmtk.h b/drivers/bluetooth/btmtk.h
index 56f5502baadf..8b582077a01f 100644
--- a/drivers/bluetooth/btmtk.h
+++ b/drivers/bluetooth/btmtk.h
@@ -22,6 +22,9 @@
 #define MT7921_DLSTATUS 0x7c053c10
 #define BT_DL_STATE BIT(1)
 
+#define MT7925_SLPPROT 0x18011100
+#define SLPPROT_BYPASS BIT(1)
+
 #define MTK_COREDUMP_SIZE		(1024 * 1000)
 #define MTK_COREDUMP_END		"coredump end"
 #define MTK_COREDUMP_END_LEN		(sizeof(MTK_COREDUMP_END))
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 7835170b1d66..842fda0527db 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3120,9 +3120,13 @@ static int btusb_mtk_setup(struct hci_dev *hdev)
 	case 0x7668:
 		fwname = FIRMWARE_MT7668;
 		break;
+	case 0x7925:
+		btusb_mtk_uhw_reg_read(data, MT7925_SLPPROT, &val);
+		val |= SLPPROT_BYPASS;
+		btusb_mtk_uhw_reg_write(data, MT7925_SLPPROT, val);
+		fallthrough;
 	case 0x7922:
 	case 0x7961:
-	case 0x7925:
 		if (dev_id == 0x7925)
 			snprintf(fw_bin_name, sizeof(fw_bin_name),
 				 "mediatek/mt%04x/BT_RAM_CODE_MT%04x_1_%x_hdr.bin",
-- 
2.18.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ