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>] [day] [month] [year] [list]
Message-ID: <20251209120559.2991698-1-chris.lu@mediatek.com>
Date: Tue, 9 Dec 2025 20:05:59 +0800
From: Chris Lu <chris.lu@...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>, Will Lee <will-cy.Lee@...iatek.com>,
	SS Wu <ss.wu@...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>, Chris Lu <chris.lu@...iatek.com>
Subject: [PATCH v1] Bluetooth: btmtk: Trigger reset on firmware download failure

Initiate reset flow if MT79xx series BT failed to download firmware when
doing setup.
If driver is not able to get event after reset in the first section of
btmtk_usb_setup, the protocol is deemed unuable and driver will return to
prevent from repeatedly executing resets.

Signed-off-by: Chris Lu <chris.lu@...iatek.com>
---
 drivers/bluetooth/btmtk.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
index a8c520dc09e1..8b1443b9e9cf 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -1333,7 +1333,7 @@ int btmtk_usb_setup(struct hci_dev *hdev)
 						btmtk_usb_hci_wmt_sync);
 		if (err < 0) {
 			bt_dev_err(hdev, "Failed to set up firmware (%d)", err);
-			return err;
+			goto reset_fw;
 		}
 
 		/* It's Device EndPoint Reset Option Register */
@@ -1353,7 +1353,7 @@ int btmtk_usb_setup(struct hci_dev *hdev)
 		err = btmtk_usb_hci_wmt_sync(hdev, &wmt_params);
 		if (err < 0) {
 			bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err);
-			return err;
+			goto reset_fw;
 		}
 
 		hci_set_msft_opcode(hdev, 0xFD30);
@@ -1444,6 +1444,13 @@ int btmtk_usb_setup(struct hci_dev *hdev)
 	}
 	kfree_skb(skb);
 
+reset_fw:
+	if (btmtk_data->reset_sync) {
+		bt_dev_err(hdev, "Mediatek do firmware reset");
+		btmtk_reset_sync(hdev);
+		return err;
+	}
+
 done:
 	rettime = ktime_get();
 	delta = ktime_sub(rettime, calltime);
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ