All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hui Wang <hui.wang@canonical.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: btusb: Add a parameter to load fw forcibly for Intel BT
Date: Tue, 1 Dec 2020 13:46:22 +0800	[thread overview]
Message-ID: <efdddc31-bf46-42e6-8edd-710835ed3f4b@canonical.com> (raw)
In-Reply-To: <116CA1BC-A38E-4622-99D7-91C7DF6EA463@holtmann.org>


On 12/1/20 1:05 AM, Marcel Holtmann wrote:
> Hi Hui,
>
>> On the machines with Intel new BT module, if users run reboot, the BT
>> driver will not load the firmware from rootfs during boot since it is
>> already in operational mode. This will confuse the users if users
>> update the BT firmware and expect the updated firmware to fix some
>> problems.
>>
>> Let the driver print a message to tell users the firmware is not
>> loaded and add a module parameter to let driver forcibly load the
>> firmware from rootfs. After users read this message, they could set
>> this parameter to load the firmware forcibly.
>>
>> Signed-off-by: Hui Wang <hui.wang@canonical.com>
>> ---
>> drivers/bluetooth/btusb.c | 13 ++++++++++++-
>> 1 file changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>> index 1005b6e8ff74..d4fceedd354b 100644
>> --- a/drivers/bluetooth/btusb.c
>> +++ b/drivers/bluetooth/btusb.c
>> @@ -32,6 +32,7 @@ static bool force_scofix;
>> static bool enable_autosuspend = IS_ENABLED(CONFIG_BT_HCIBTUSB_AUTOSUSPEND);
>>
>> static bool reset = true;
>> +static bool force_load_fw;
>>
>> static struct usb_driver btusb_driver;
>>
>> @@ -2589,8 +2590,15 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
>> 		return err;
>>
>> 	/* controller is already having an operational firmware */
>> -	if (ver.fw_variant == 0x23)
>> +	if (ver.fw_variant == 0x23) {
>> +		if (force_load_fw) {
>> +			btintel_reset_to_bootloader(hdev);
>> +			force_load_fw = false;
>> +			return -EAGAIN;
>> +		}
>> +		bt_dev_info(hdev, "already in operational mode, not load fw. Set force_load_fw=1 to load fw forcibly");
>> 		goto finish;
>> +	}
> I don’t like this approach. I rather do this in a more generic way that resets the controller and puts it into boot loader support if support. We can use the experimental mgmt setting for this.
OK, got it, will investigate it. Thanks.
>
> Regards
>
> Marcel
>

  reply	other threads:[~2020-12-01  5:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30  5:27 [PATCH] Bluetooth: btusb: Add a parameter to load fw forcibly for Intel BT Hui Wang
2020-11-30  6:01 ` bluez.test.bot
2020-11-30 17:05 ` [PATCH] " Marcel Holtmann
2020-12-01  5:46   ` Hui Wang [this message]
2021-02-05 13:26     ` Hui Wang

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=efdddc31-bf46-42e6-8edd-710835ed3f4b@canonical.com \
    --to=hui.wang@canonical.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.