public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches
@ 2026-01-08  7:43 Shuai Zhang
  2026-01-08  9:15 ` [v1] " bluez.test.bot
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Shuai Zhang @ 2026-01-08  7:43 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: linux-bluetooth, linux-kernel, linux-arm-msm, cheng.jiang,
	quic_chezhou, wei.deng, jinwang.li, mengshi.wu, shuai.zhang

Since USB can disconnect at any time, if it disconnects during
the BT firmware download, the BT controller firmware version may still
be updated even without completing the download.

When USB reconnects, the BT host detects the same version as in the
firmware file, which prevents the firmware from being downloaded again.

Therefore, remove the equality check to ensure that after
USB reconnection, the BT host can still download the firmware.

Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
---
 drivers/bluetooth/btusb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 646de80c7..991064a25 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3503,7 +3503,10 @@ static int btusb_setup_qca_load_rampatch(struct hci_dev *hdev,
 		    "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 if version is greater than or equal to firmware version.
+	 * Equal versions are acceptable for re-flashing or recovery scenarios.
+	 */
+	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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: [v1] Bluetooth: btusb: Allow firmware re-download when version matches
  2026-01-08  7:43 [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches Shuai Zhang
@ 2026-01-08  9:15 ` bluez.test.bot
  2026-01-19 11:45 ` [PATCH v1] " Shuai Zhang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2026-01-08  9:15 UTC (permalink / raw)
  To: linux-bluetooth, shuai.zhang

[-- Attachment #1: Type: text/plain, Size: 2833 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1039730

---Test result---

Test Summary:
CheckPatch                    PENDING   0.46 seconds
GitLint                       PENDING   0.37 seconds
SubjectPrefix                 PASS      0.08 seconds
BuildKernel                   PASS      26.03 seconds
CheckAllWarning               PASS      28.43 seconds
CheckSparse                   PASS      31.81 seconds
BuildKernel32                 PASS      25.58 seconds
TestRunnerSetup               PASS      560.38 seconds
TestRunner_l2cap-tester       PASS      28.72 seconds
TestRunner_iso-tester         FAIL      68.50 seconds
TestRunner_bnep-tester        PASS      6.32 seconds
TestRunner_mgmt-tester        FAIL      121.81 seconds
TestRunner_rfcomm-tester      PASS      9.50 seconds
TestRunner_sco-tester         FAIL      14.78 seconds
TestRunner_ioctl-tester       PASS      10.59 seconds
TestRunner_mesh-tester        FAIL      12.42 seconds
TestRunner_smp-tester         PASS      8.61 seconds
TestRunner_userchan-tester    PASS      6.65 seconds
IncrementalBuild              PENDING   0.82 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
BUG: KASAN: slab-use-after-free in le_read_features_complete+0x7e/0x2b0
Total: 141, Passed: 141 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 494, Passed: 489 (99.0%), Failed: 1, Not Run: 4

Failed Test Cases
Read Exp Feature - Success                           Failed       0.124 seconds
##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:
WARNING: possible circular locking dependency detected
BUG: sleeping function called from invalid context at net/core/sock.c:3782
Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0

Failed Test Cases
Mesh - Send cancel - 1                               Timed out    2.780 seconds
Mesh - Send cancel - 2                               Timed out    1.994 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches
  2026-01-08  7:43 [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches Shuai Zhang
  2026-01-08  9:15 ` [v1] " bluez.test.bot
@ 2026-01-19 11:45 ` Shuai Zhang
  2026-03-05  8:08 ` Shuai Zhang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Shuai Zhang @ 2026-01-19 11:45 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: linux-bluetooth, linux-kernel, linux-arm-msm, cheng.jiang,
	quic_chezhou, wei.deng, jinwang.li, mengshi.wu

Hi

On 1/8/2026 3:43 PM, Shuai Zhang wrote:
> Since USB can disconnect at any time, if it disconnects during
> the BT firmware download, the BT controller firmware version may still
> be updated even without completing the download.
>
> When USB reconnects, the BT host detects the same version as in the
> firmware file, which prevents the firmware from being downloaded again.
>
> Therefore, remove the equality check to ensure that after
> USB reconnection, the BT host can still download the firmware.
>
> Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
> ---
>   drivers/bluetooth/btusb.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 646de80c7..991064a25 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -3503,7 +3503,10 @@ static int btusb_setup_qca_load_rampatch(struct hci_dev *hdev,
>   		    "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 if version is greater than or equal to firmware version.
> +	 * Equal versions are acceptable for re-flashing or recovery scenarios.
> +	 */
> +	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;


Kindly let me know if there are any updates.


Kindly, regard

Shuai


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches
  2026-01-08  7:43 [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches Shuai Zhang
  2026-01-08  9:15 ` [v1] " bluez.test.bot
  2026-01-19 11:45 ` [PATCH v1] " Shuai Zhang
@ 2026-03-05  8:08 ` Shuai Zhang
  2026-03-13 12:16 ` Shuai Zhang
  2026-03-13 16:06 ` Dmitry Baryshkov
  4 siblings, 0 replies; 7+ messages in thread
From: Shuai Zhang @ 2026-03-05  8:08 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: linux-bluetooth, linux-kernel, linux-arm-msm, cheng.jiang,
	quic_chezhou, wei.deng, jinwang.li, mengshi.wu

Hi

On 1/8/2026 3:43 PM, Shuai Zhang wrote:
> Since USB can disconnect at any time, if it disconnects during
> the BT firmware download, the BT controller firmware version may still
> be updated even without completing the download.
>
> When USB reconnects, the BT host detects the same version as in the
> firmware file, which prevents the firmware from being downloaded again.
>
> Therefore, remove the equality check to ensure that after
> USB reconnection, the BT host can still download the firmware.
>
> Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
> ---
>   drivers/bluetooth/btusb.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 646de80c7..991064a25 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -3503,7 +3503,10 @@ static int btusb_setup_qca_load_rampatch(struct hci_dev *hdev,
>   		    "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 if version is greater than or equal to firmware version.
> +	 * Equal versions are acceptable for re-flashing or recovery scenarios.
> +	 */
> +	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;


Could you please let me know if there are any updates?

Thanks,
Shuai


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches
  2026-01-08  7:43 [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches Shuai Zhang
                   ` (2 preceding siblings ...)
  2026-03-05  8:08 ` Shuai Zhang
@ 2026-03-13 12:16 ` Shuai Zhang
  2026-03-13 16:06 ` Dmitry Baryshkov
  4 siblings, 0 replies; 7+ messages in thread
From: Shuai Zhang @ 2026-03-13 12:16 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, linux-bluetooth
  Cc: linux-kernel, linux-arm-msm, cheng.jiang, quic_chezhou, wei.deng,
	jinwang.li, mengshi.wu

Hi reviewer,

On 1/8/2026 3:43 PM, Shuai Zhang wrote:
> Since USB can disconnect at any time, if it disconnects during
> the BT firmware download, the BT controller firmware version may still
> be updated even without completing the download.
>
> When USB reconnects, the BT host detects the same version as in the
> firmware file, which prevents the firmware from being downloaded again.
>
> Therefore, remove the equality check to ensure that after
> USB reconnection, the BT host can still download the firmware.
>
> Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
> ---
>   drivers/bluetooth/btusb.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 646de80c7..991064a25 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -3503,7 +3503,10 @@ static int btusb_setup_qca_load_rampatch(struct hci_dev *hdev,
>   		    "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 if version is greater than or equal to firmware version.
> +	 * Equal versions are acceptable for re-flashing or recovery scenarios.
> +	 */
> +	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;

If there are any updates, please let me know.

Thanks,
Shuai


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches
  2026-01-08  7:43 [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches Shuai Zhang
                   ` (3 preceding siblings ...)
  2026-03-13 12:16 ` Shuai Zhang
@ 2026-03-13 16:06 ` Dmitry Baryshkov
  2026-03-18  2:32   ` Shuai Zhang
  4 siblings, 1 reply; 7+ messages in thread
From: Dmitry Baryshkov @ 2026-03-13 16:06 UTC (permalink / raw)
  To: Shuai Zhang
  Cc: Marcel Holtmann, Luiz Augusto von Dentz, linux-bluetooth,
	linux-kernel, linux-arm-msm, cheng.jiang, quic_chezhou, wei.deng,
	jinwang.li, mengshi.wu

On Thu, Jan 08, 2026 at 03:43:53PM +0800, Shuai Zhang wrote:
> Since USB can disconnect at any time, if it disconnects during
> the BT firmware download, the BT controller firmware version may still
> be updated even without completing the download.

Does it not have any check for not completing firmware update if the
download was not successful / complete?

> 
> When USB reconnects, the BT host detects the same version as in the
> firmware file, which prevents the firmware from being downloaded again.
> 
> Therefore, remove the equality check to ensure that after
> USB reconnection, the BT host can still download the firmware.
> 
> Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
> ---
>  drivers/bluetooth/btusb.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 646de80c7..991064a25 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -3503,7 +3503,10 @@ static int btusb_setup_qca_load_rampatch(struct hci_dev *hdev,
>  		    "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 if version is greater than or equal to firmware version.
> +	 * Equal versions are acceptable for re-flashing or recovery scenarios.
> +	 */
> +	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;
> -- 
> 2.34.1
> 

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches
  2026-03-13 16:06 ` Dmitry Baryshkov
@ 2026-03-18  2:32   ` Shuai Zhang
  0 siblings, 0 replies; 7+ messages in thread
From: Shuai Zhang @ 2026-03-18  2:32 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Marcel Holtmann, Luiz Augusto von Dentz, linux-bluetooth,
	linux-kernel, linux-arm-msm, cheng.jiang, quic_chezhou, wei.deng,
	jinwang.li, mengshi.wu

Hi Dmitry

Thanks for the review.

On 3/14/2026 12:06 AM, Dmitry Baryshkov wrote:
> On Thu, Jan 08, 2026 at 03:43:53PM +0800, Shuai Zhang wrote:
>> Since USB can disconnect at any time, if it disconnects during
>> the BT firmware download, the BT controller firmware version may still
>> be updated even without completing the download.
> Does it not have any check for not completing firmware update if the
> download was not successful / complete?

Because of RAM limitations, the controller updates the firmware version 
during

the download process,even if the download does not complete.

Since btusb cannot power-cycle the controller, the only recovery after

an interrupted download is to retry the firmware download.

>
>> When USB reconnects, the BT host detects the same version as in the
>> firmware file, which prevents the firmware from being downloaded again.
>>
>> Therefore, remove the equality check to ensure that after
>> USB reconnection, the BT host can still download the firmware.
>>
>> Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
>> ---
>>   drivers/bluetooth/btusb.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>> index 646de80c7..991064a25 100644
>> --- a/drivers/bluetooth/btusb.c
>> +++ b/drivers/bluetooth/btusb.c
>> @@ -3503,7 +3503,10 @@ static int btusb_setup_qca_load_rampatch(struct hci_dev *hdev,
>>   		    "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 if version is greater than or equal to firmware version.
>> +	 * Equal versions are acceptable for re-flashing or recovery scenarios.
>> +	 */
>> +	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;
>> -- 
>> 2.34.1
>>
Thanks,
Shuai




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-03-18  2:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08  7:43 [PATCH v1] Bluetooth: btusb: Allow firmware re-download when version matches Shuai Zhang
2026-01-08  9:15 ` [v1] " bluez.test.bot
2026-01-19 11:45 ` [PATCH v1] " Shuai Zhang
2026-03-05  8:08 ` Shuai Zhang
2026-03-13 12:16 ` Shuai Zhang
2026-03-13 16:06 ` Dmitry Baryshkov
2026-03-18  2:32   ` Shuai Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox