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 ACEF7246BCD; Sat, 12 Sep 2026 09:22: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=1789204960; cv=none; b=FA5GTMmP8S2GaTA86+ZQQq9k2BXvEnOnGaoVTE8qwTrgEl46Jr0uu8RO2XCWnahYNvfb25AXDQqYD+/5V5x8fjCOB7pBGA74LtFy/hAWMImC0tXZ6qPvLVSwPsYA9+uMUUDpE26DE710QCsaRwcIadjq8u8ifN9EtraWFFop7qI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789204960; c=relaxed/simple; bh=lViEKMVWMsnno/FbS44iL54CKdxYqdbYajhPtquqRnc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c0NVV4jY4a/MP36RonQg7TeX2pqezEsY/zzXLj/ktSfEmHDPAUwSVq2QM/LLFdwLcS5rdm9zBRNCHLgWZaGUcsIMEGSi0D0NAXfX17X1PGoydcwEPIotNh86QpcfZKredG3qloXnqm7ZoCKk4JYiqGiaSYxJytB0ZeJql3O7AmA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RLSHAz87; 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="RLSHAz87" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B40881F000FF; Sat, 12 Sep 2026 09:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789204959; bh=s8aYZv2APpJZ9gO9kRFnNwLSv6JUs071NO13kVYdYUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RLSHAz87AHYMe4cYizliyd3cit7IV6wuNq522pwvwQZt31jFSgm55WD+wanoB2Q11 JWcRjC+IX6JXK7nTY2iY+nppcgcMRg6NYqk+Dpnxcrrp3SA6wZVXW2O2Y4KfS292qk aWfBq4sUTUHIVQtjSBfB+bM9P2+jJyIyhKdrn7SU= 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 7.2 1720/1815] Bluetooth: btmtk: Do not discard the subsystem reset timeout Date: Sat, 12 Sep 2026 08:57:50 +0200 Message-ID: <20260912065729.351889686@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065648.999753832@linuxfoundation.org> References: <20260912065648.999753832@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 7.2-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 dc702c0a6034d..c0ed51567ed4d 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -860,6 +860,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; @@ -958,8 +959,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); @@ -973,7 +976,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