Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0EC5242D65; Sat, 12 Sep 2026 11:23:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789212220; cv=none; b=V6pOw1T5eFFn5yJjWcOHkiDWasfNAv6X/ImSs2cnb9ThqqCXNnq4J7T7XtcbftfJr0sjVTVq6OQFsaQsTk9WDHlEy9LcsD8OnvYaJL4B3bh/9389MfBUI8hRhKlxAHJA5MoJuCLJdRTJp1yxpNi4gdfR8ECX/t95k4O5cdZRb4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789212220; c=relaxed/simple; bh=DMnj/pZ5NZLZpCrmfPC+6iJpCPm67Lluuda1A317sIY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bOSWzqJXktxRcu02g1VYmGOBW5eYET64WSvo6J8KLztSxbOtYtIzMusn7AAAme1K6UfymK9y356jVLMru1vp4rgtSYX7QnzdZdyC87ryJXm41MLKkvMTvgxgncAWTX1VxtQNyK2ODiEzGvUKlDIYnqK/Tk11c6TjogZ5GsTqnww= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=tTCNme1I; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="tTCNme1I" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66E291F000FF; Sat, 12 Sep 2026 11:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789212219; bh=4OfD7lN/dbk1pAshSoRo4yqCjUGnBNy+Eqce1c5Z6Lg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tTCNme1IakVefTXyL209Qwzif1F+kCRrxxI/d9jZnugc89T8hzWsc91usL6NbWv66 2O52An1zNC/UDmcHdxRDQpnirKgZTuDIShvpEjzJOwCrESCEC+JDN68ih8EpB2heS3 NswsOsZHi8OjDq5LvQvM+mnjY+3sr/Wod3mW8W0A= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ismail Tarim , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.18 1393/1518] Bluetooth: btmtk: Do not discard the subsystem reset timeout Date: Sat, 12 Sep 2026 08:59:22 +0200 Message-ID: <20260912065655.060844010@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ismail Tarim [ Upstream commit 21b50c24843b51f88ac4316dd470d2803da0c42f ] When the MTK_BT_RST_DONE poll times out, btmtk_usb_subsys_reset() logs "Reset timeout" and keeps the error in err, but err is then overwritten by the return value of the following btmtk_usb_id_get() call, so the timeout is never reported to the caller. Commit 25b6d7593a3a ("Bluetooth: btmtk: introduce btmtk reset work") discarded the return value of the chip id read, so the function returned the timeout error as intended. Commit 3dcb122b3064 ("Bluetooth: btusb: mediatek: return error for failed reg access") started assigning err at that call and silently dropped it. Keep the timeout in a separate variable and return it, restoring the original behaviour without changing the control flow. Fixes: 3dcb122b3064 ("Bluetooth: btusb: mediatek: return error for failed reg access") Signed-off-by: Ismail Tarim Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- drivers/bluetooth/btmtk.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index 5ea6a0fcee625..a4e3f258bcf47 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -848,6 +848,7 @@ static u32 btmtk_usb_reset_done(struct hci_dev *hdev) int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id) { + int reset_err = 0; u32 val; int err; @@ -946,8 +947,10 @@ int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id) err = readx_poll_timeout(btmtk_usb_reset_done, hdev, val, val & MTK_BT_RST_DONE, 20000, 1000000); - if (err < 0) + if (err < 0) { bt_dev_err(hdev, "Reset timeout"); + reset_err = err; + } if (dev_id == 0x7922) { err = btmtk_usb_uhw_reg_write(hdev, MTK_UDMA_INT_STA_BT, 0x000000FF); @@ -961,7 +964,7 @@ int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id) return err ? err : -ENODEV; } - return err; + return reset_err; } EXPORT_SYMBOL_GPL(btmtk_usb_subsys_reset); -- 2.53.0