mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuai Zhang <quic_shuaz@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: <marcel@holtmann.org>, <luiz.dentz@gmail.com>,
	<linux-bluetooth@vger.kernel.org>, <stable@vger.kernel.org>,
	<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<quic_chejiang@quicinc.com>
Subject: Re: [PATCH v1] Bluetooth: btusb: add default nvm file
Date: Wed, 29 Oct 2025 10:02:05 +0800	[thread overview]
Message-ID: <ee4478c6-32ca-4c30-aee6-994f39532dc7@quicinc.com> (raw)
In-Reply-To: <3fluuwp2gxkc7ev5ddd2y5niga3tn77bxb6ojbpaoblbufepek@owcrah4exoky>

Hi Dmitry

On 10/29/2025 12:57 AM, Dmitry Baryshkov wrote:
> On Tue, Oct 28, 2025 at 08:05:50PM +0800, Shuai Zhang wrote:
>> If no NVM file matches the board_id, load the default NVM file.
>>
>> Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
>> ---
>>  drivers/bluetooth/btusb.c | 19 +++++++++++++++----
>>  1 file changed, 15 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>> index dcbff7641..998dfd455 100644
>> --- a/drivers/bluetooth/btusb.c
>> +++ b/drivers/bluetooth/btusb.c
>> @@ -3482,15 +3482,14 @@ static int btusb_setup_qca_load_rampatch(struct hci_dev *hdev,
>>  }
>>  
>>  static void btusb_generate_qca_nvm_name(char *fwname, size_t max_size,
>> -					const struct qca_version *ver)
>> +					const struct qca_version *ver,
>> +					u16 board_id)
>>  {
>>  	u32 rom_version = le32_to_cpu(ver->rom_version);
>>  	const char *variant, *fw_subdir;
>>  	int len;
>> -	u16 board_id;
>>  
>>  	fw_subdir = qca_get_fw_subdirectory(ver);
>> -	board_id = qca_extract_board_id(ver);
>>  
>>  	switch (le32_to_cpu(ver->ram_version)) {
>>  	case WCN6855_2_0_RAM_VERSION_GF:
>> @@ -3522,13 +3521,25 @@ static int btusb_setup_qca_load_nvm(struct hci_dev *hdev,
>>  	const struct firmware *fw;
>>  	char fwname[80];
>>  	int err;
>> +	u16 board_id = 0;
>>  
>> -	btusb_generate_qca_nvm_name(fwname, sizeof(fwname), ver);
>> +	board_id = qca_extract_board_id(ver);
>>  
>> +retry:
>> +	btusb_generate_qca_nvm_name(fwname, sizeof(fwname), ver, board_id);
>>  	err = request_firmware(&fw, fwname, &hdev->dev);
>>  	if (err) {
>> +		if (err == -EINVAL) {
>> +			bt_dev_err(hdev, "QCOM BT firmware file request failed (%d)", err);
>> +			return err;
>> +		}
>> +
>>  		bt_dev_err(hdev, "failed to request NVM file: %s (%d)",
>>  			   fwname, err);
>> +		if (err == -ENOENT && board_id != 0) {
>> +			board_id = 0;
>> +			goto retry;
>> +		}
> 
> I'd rather see here:
> 
>   } else {
> 	bt_dev_err(hdev, "QCOM BT firmware file request failed (%d)", err);
> 	return err;
>   }
> 

This will make the log clearer. Thank you for your suggestion;I will update it.

>>  		return err;
>>  	}
>>  
>> -- 
>> 2.34.1
>>
> 
BR,
Shuai


      reply	other threads:[~2025-10-29  2:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28 12:05 Shuai Zhang
2025-10-28 16:57 ` Dmitry Baryshkov
2025-10-29  2:02   ` Shuai Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee4478c6-32ca-4c30-aee6-994f39532dc7@quicinc.com \
    --to=quic_shuaz@quicinc.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=quic_chejiang@quicinc.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®