Re: [PATCH v3 1/6] Bluetooth: btintel: Check firmware version before download

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Luiz,

On Tue, 2021-02-09 at 17:04 -0800, Tedd Ho-Jeong An wrote:
> Hi Luiz,
> 
> On Tue, 2021-02-09 at 15:33 -0800, Luiz Augusto von Dentz wrote:
> > From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
> > 
> > This checks the firmware build number, week and year matches with
> > repective version loaded and then skip the download process.
> > 
> > Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
> > ---
> > v2: Add patch that mover checks for operational mode after the version
> > checking.
> > v3: Fix not checking for operation mode before using btintel_read_boot_params
> > since some models depend on that to contruct the fw filename. Also attempt to
> > cleanup duplicated code.
> > 
> >  drivers/bluetooth/btintel.c   | 94 +++++++++++++++++++++++++++--------
> >  drivers/bluetooth/btintel.h   |  5 +-
> >  drivers/bluetooth/btusb.c     | 16 +++++-
> >  drivers/bluetooth/hci_intel.c |  7 ++-
> >  4 files changed, 96 insertions(+), 26 deletions(-)
> 
> Here is a quick test result after plug in the card to the USB, which is similar to "reboot" case:

This is not actually correct. I was using VM to test so the device was alrady running in
operational firmware.
Let me run on real hw and send the new result.

> 
> dmesg:
> [  380.993756] usb 1-2: new full-speed USB device number 6 using xhci_hcd
> [  381.441601] usb 1-2: New USB device found, idVendor=8087, idProduct=0025, bcdDevice= 0.02
> [  381.441614] usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> [  381.456056] btusb:btusb_probe:4418: intf 00000000daf5923a id 0000000054fbca43
> [  381.458813] btusb:btusb_open:1314: hci0
> [  381.458824] btusb:btusb_submit_intr_urb:886: hci0
> [  381.458902] btusb:btusb_submit_bulk_urb:976: hci0
> [  381.458935] btusb:btusb_submit_bulk_urb:976: hci0
> [  381.459006] btusb:btusb_setup_intel_new:2814: hci0
> [  381.459151] btusb:btusb_send_frame_intel:2347: hci0
> [  381.460077] btusb:btusb_intr_complete:841: hci0 urb 00000000fba620cd status 0 count 15
> [  381.460167] btusb:btusb_tx_complete:1266: hci0 urb 00000000d075e504 status 0 count 3
> [  381.460579] Bluetooth: hci0: Firmware revision 0.1 build 26 week 11 2020
> [  381.460685] btusb:btusb_send_frame_intel:2347: hci0
> [  381.461515] btusb:btusb_tx_complete:1266: hci0 urb 00000000eac374bf status 0 count 3
> [  381.461986] btusb:btusb_intr_complete:841: hci0 urb 00000000fba620cd status 0 count 12
> [  381.463058] Bluetooth: hci0: Found device firmware: intel/ibt-18-16-1.sfi
> [  381.463283] btintel:btintel_firmware_version:991: hci0: Boot Address: 0xa100
> [  381.463291] btintel:btintel_firmware_version:994: hci0: Firmware Version: 0-0.0

I have noticed this line, which isn't correct. it is actually
Boot Parameters
Boot Address:	0x00040800
Firmware build:	26-11.2020

[  381.463401] btusb:btusb_send_frame_intel:2347: hci0
> [  381.464156] btusb:btusb_tx_complete:1266: hci0 urb 0000000005038ab1 status 0 count 11
> [  381.466847] btusb:btusb_intr_complete:841: hci0 urb 00000000fba620cd status -32 count 64
> [  381.494960] usb 1-2: USB disconnect, device number 6
> [  381.495216] btusb:btusb_intr_complete:841: hci0 urb 00000000fba620cd status -108 count 0
> [  381.495324] btusb:btusb_bulk_complete:931: hci0 urb 00000000f4141fb0 status -108 count 0
> [  381.495329] btusb:btusb_bulk_complete:931: hci0 urb 00000000a595df06 status -108 count 0
> [  381.495342] btusb:btusb_disconnect:4791: intf 00000000daf5923a
> 
> [  383.519564] Bluetooth: hci0: command 0xfc01 tx timeout
> [  391.555247] Bluetooth: hci0: FW download error recovery failed (-110)
> 
> [  391.555395] btusb:btusb_flush:1418: hci0
> [  391.555479] btusb:btusb_close:1384: hci0
> [  391.556244] btusb:btusb_disconnect:4791: intf 00000000ce1879b8
> 
> 
> Timeout from reset command. For hard reset, I don't think it sends the
> CommandComplete/CommandStatus
> events.
> 
> 
> < HCI Command: Intel Read Version (0x3f|0x0005) plen
> 0                                                           #1 [hci0] 9.028782
> > HCI Event: Command Complete (0x0e) plen
> 13                                                                     #2 [hci0] 9.029760
>       Intel Read Version (0x3f|0x0005) ncmd 1
>         Status: Success (0x00)
>         Hardware platform: 0x37
>         Hardware variant: 0x12
>         Hardware revision: 1.0
>         Firmware variant: 0x23
>         Firmware revision: 0.1
>         Firmware build: 26-11.2020
>         Firmware patch: 0
> < HCI Command: Read BD ADDR (0x04|0x0009) plen
> 0                                                                 #3 [hci0] 9.030334
> > HCI Event: Command Complete (0x0e) plen
> 10                                                                     #4 [hci0] 9.031668
>       Read BD ADDR (0x04|0x0009) ncmd 1
>         Status: Success (0x00)
>         Address: 9C:DA:3E:F2:8F:A4 (Intel Corporate)
> < HCI Command: Intel Reset (0x3f|0x0001) plen
> 8                                                                  #5 [hci0] 9.033055
>         Reset type: Hard software reset (0x01)
>         Patch vectors: Enable (0x01)
>         DDC parameters: Reload from OTP (0x01)
>         Boot option: Current image (0x00)
>         Boot address: 0x00000000
> = Close Index:
> 9C:DA:3E:F2:8F:A4                                                                                 
>   
> [hci0] 19.130135
> 
> 
> Regards,
> Tedd
> 




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux