From mboxrd@z Thu Jan 1 00:00:00 1970 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 04EB8320A37; Sun, 7 Jun 2026 10:24:41 +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=1780827883; cv=none; b=UMnK9wbI22Yc46isqw520oKJdfZel1hz/Ep6vN53pmsCYPfTGFSlIh9p7bzq/eZq0CUIs1A+HcDwxKILekyNMoqzrh4EYbI8Et5MaiAe+jUcJsq06JKmBTVCJewHaBTQ3tMO5iTL5KGiy+1YvV5pEaJmw4YOXv4Tiytl940HjlY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780827883; c=relaxed/simple; bh=XM8Pp6K7iobiPWjclT1VG4+QG+j0Tjcww82LcdywdBM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aq8o+Vi3yO794dU9fkHxm3zZliopbX65QEvsaZMIUzCqweWgkWQWp+cUlbptb2gMEr9OplyY3GS8W8/6DEHTmMoXqUEP+gYUGg3sdps4QAO5Zi2oYWOlro/R8EZNTEvhOXt90vJOm/sSsFO0+LCPy/3VIqru/gDqwwj26ApoNa0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ee4x86qN; 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="Ee4x86qN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2D901F00893; Sun, 7 Jun 2026 10:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780827881; bh=LFE0HbCf3PhKMTALLocTHkAV9zqIX94N6X+gx5V8r0o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ee4x86qNyabTS8E2dBxzRlkkG51mIU91P3gLbk0gVsesg3FZXW5LenVDRU3WJx6BT sZ/WTToVYN3nZH7Nx4S2yI0hKkhkcRlZ2m5MsoWFNGdpB1qbQcs74ShwOszRhPMbik nij88SMfC6R5kSWMHvPmlPEKVtxZNdJdFQjiVs3A= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shuai Zhang , Luiz Augusto von Dentz Subject: [PATCH 7.0 134/332] Bluetooth: btusb: Allow firmware re-download when version matches Date: Sun, 7 Jun 2026 11:58:23 +0200 Message-ID: <20260607095733.018202142@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095728.031258202@linuxfoundation.org> References: <20260607095728.031258202@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.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shuai Zhang commit 82855073c1081732656734b74d7d1d5e4cfd0da7 upstream. The Bluetooth host decides whether to download firmware by reading the controller firmware download completion flag and firmware version information. If a USB error occurs during the firmware download process (for example due to a USB disconnect), the download is aborted immediately. An incomplete firmware transfer does not cause the controller to set the download completion flag, but the firmware version information may be updated at an early stage of the download process. In this case, after USB reconnection, the host attempts to re-download the firmware because the download completion flag is not set. However, since the controller reports the same firmware version as the target firmware, the download is skipped. This ultimately results in the firmware not being properly updated on the controller. This change removes the restriction that skips firmware download when the versions are equal. It covers scenarios where the USB connection can be disconnected at any time and ensures that firmware download can be retriggered after USB reconnection, allowing the Bluetooth firmware to be correctly and completely updated. Fixes: 3267c884cefa ("Bluetooth: btusb: Add support for QCA ROME chipset family") Cc: stable@vger.kernel.org Signed-off-by: Shuai Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman --- drivers/bluetooth/btusb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -3511,7 +3511,13 @@ static int btusb_setup_qca_load_rampatch "firmware rome 0x%x build 0x%x", rver_rom, rver_patch, ver_rom, ver_patch); - if (rver_rom != ver_rom || rver_patch <= ver_patch) { + /* Allow rampatch when the patch version equals the firmware version. + * A firmware download may be aborted by a transient USB error (e.g. + * disconnect) after the controller updates version info but before + * completion. + * Allowing equal versions enables re-flashing during recovery. + */ + if (rver_rom != ver_rom || rver_patch < ver_patch) { bt_dev_err(hdev, "rampatch file version did not match with firmware"); err = -EINVAL; goto done;