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 4800912CDA5; Sun, 7 Jun 2026 10:34:11 +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=1780828452; cv=none; b=g05ZXe0+v569gH5VkBtCxAqjiK/UBNAv4s4ZHXXiSkQDVdFSZ3YGvLIrpcBloB2iBAkqtX8W3gAfN+rFc/yYK6u9eiuefemjLQIWAQSHSiY2MFLaTA2GVv82ZaxlTKqm9SOP8+umlSyJ1qtw361jR7tjtcPn3fiVo4Qyvlm3OHQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780828452; c=relaxed/simple; bh=6OCilophEIHUpoRH48neu2mYotDRu+Qkn8q3tlei2K8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ifCrvrJdCZ2cy+FO3J3TFaFVaDo1KX330ZegA4f21q5tz5FCW4hxdmlNuLH0Q8cunaLMghq6MyO/jpEOkS6lFBlg5NGpAl3r9EZqK37eb0BMnhffPLyuco2V1dM3KJWBzg7bEcZL1HHo2T0eMsVJvB2GoteOcPLDjhOI8GJRS5A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Rqi9V8nP; 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="Rqi9V8nP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 232101F00893; Sun, 7 Jun 2026 10:34:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780828451; bh=GbIB+PNazU5g8Fa4kph1LzNL5Wey/704joyZzd6LkgI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Rqi9V8nPKOgeQ7PBZGFyBUffn+eHV4V5xMpiCMU13fkWyCsCOJNtWd7lgKQ9OO65p V4AdoK2Gha+UbbSBFW8nQrKFW/jSV/q5uEYOOEbBC5DY1IcUW7mYuVBg6RTWu1ERKY ZXHazkUYmjKL1gsuVoCNThc/3RgrQ4hda5pdHeFs= 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 6.12 139/307] Bluetooth: btusb: Allow firmware re-download when version matches Date: Sun, 7 Jun 2026 11:58:56 +0200 Message-ID: <20260607095732.837928183@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095727.647295505@linuxfoundation.org> References: <20260607095727.647295505@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.12-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 @@ -3430,7 +3430,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;