Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Deepin-Kernel-SIG] [Upstream] [linux 6.6-y] bluetooth update for btintel pcie device #510

Merged
merged 29 commits into from
Dec 10, 2024

Conversation

opsiff
Copy link
Member

@opsiff opsiff commented Dec 3, 2024

Commit:
config: deepin_x86_desktop_defconfig: Enable BT_INTEL_PCIE
Bluetooth: btintel_pcie: remove redundant assignment to variable ret
Bluetooth: btintel_pcie: Remove deadcode
Bluetooth: btintel: Add DSBR support for BlazarIW, BlazarU and GaP
Bluetooth: btintel_pcie: Add recovery mechanism
Bluetooth: btintel_pcie: Add handshake between driver and firmware
Bluetooth: btintel_pcie: Allocate memory for driver private data
Bluetooth: btintel_pcie: Add support for ISO data
Bluetooth: Add a helper function to extract iso header
Bluetooth: btintel: Allow configuring drive strength of BRI
Bluetooth: btintel: Add support for BlazarU core
Bluetooth: btintel: Add firmware ID to firmware name
Bluetooth: Add vendor-specific packet classification for ISO data
Revert "Bluetooth: btintel: Add support for BlazarU core"
Bluetooth: btintel_pcie: Remove unnecessary memset(0) calls
Bluetooth: btintel_pcie: Fix irq leak
Bluetooth: btintel_pcie: Print Firmware Sequencer information
Bluetooth: btintel_pcie: Fix REVERSE_INULL issue reported by coverity
Bluetooth: btintel_pcie: Refactor and code cleanup
Bluetooth: btintel_pcie: Fix warning reported by sparse
Bluetooth: btintel: Fix compiler warning for multi_v7_defconfig config
Bluetooth: btintel_pcie: Fix compiler warnings
Bluetooth: btintel_pcie: Add setup function to download firmware
Bluetooth: btintel_pcie: Add support for PCIe transport
Bluetooth: btintel: Export few static functions
Bluetooth: hci_intel: Fix multiple issues reported by checkpatch.pl
Bluetooth: btintel: Add support to download intermediate loader
Bluetooth: btintel: Define macros for image types
Bluetooth: btintel: Print Firmware Sequencer information

kirankrishnappa-intel and others added 15 commits December 3, 2024 15:23
Firmware sequencer (FSEQ) is a common code shared across Bluetooth
and Wifi. Printing FSEQ will help to debug if there is any mismatch
between Bluetooth and Wifi FSEQ.

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit a7ba218)
Use macro for image type instead of using hard code number.

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 5ec6feb)
Some variants of Intel controllers like BlazarI supports downloading of
Intermediate bootloader (IML) image. IML gives flexibility to fix issues as its
not possible to fix issue in Primary bootloader once flashed to ROM. This patch
adds the support to download IML before downloading operational firmware image.

dmesg logs:
[13.399003] Bluetooth: Core ver 2.22
[13.399006] Bluetooth: Starting self testing
[13.401194] Bluetooth: ECDH test passed in 2135 usecs
[13.421175] Bluetooth: SMP test passed in 597 usecs
[13.421184] Bluetooth: Finished self testing
[13.422919] Bluetooth: HCI device and connection manager initialized
[13.422923] Bluetooth: HCI socket layer initialized
[13.422925] Bluetooth: L2CAP socket layer initialized
[13.422930] Bluetooth: SCO socket layer initialized
[13.458065] Bluetooth: hci0: Device revision is 0
[13.458071] Bluetooth: hci0: Secure boot is disabled
[13.458072] Bluetooth: hci0: OTP lock is disabled
[13.458072] Bluetooth: hci0: API lock is enabled
[13.458073] Bluetooth: hci0: Debug lock is disabled
[13.458073] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[13.458075] Bluetooth: hci0: Bootloader timestamp 2022.46 buildtype 1 build 26590
[13.458324] Bluetooth: hci0: DSM reset method type: 0x00
[13.460678] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291-iml.sfi
[13.460684] Bluetooth: hci0: Boot Address: 0x30099000
[13.460685] Bluetooth: hci0: Firmware Version: 227-11.24
[13.562554] Bluetooth: hci0: Waiting for firmware download to complete
[13.563023] Bluetooth: hci0: Firmware loaded in 99941 usecs
[13.563057] Bluetooth: hci0: Waiting for device to boot
[13.565029] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[13.565148] Bluetooth: hci0: Device booted in 2064 usecs
[13.567065] Bluetooth: hci0: No device address configured
[13.569010] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291.sfi
[13.569061] Bluetooth: hci0: Boot Address: 0x10000800
[13.569062] Bluetooth: hci0: Firmware Version: 227-11.24
[13.788891] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[13.788897] Bluetooth: BNEP filters: protocol multicast
[13.788902] Bluetooth: BNEP socket layer initialized
[15.435905] Bluetooth: hci0: Waiting for firmware download to complete
[15.436016] Bluetooth: hci0: Firmware loaded in 1823233 usecs
[15.436258] Bluetooth: hci0: Waiting for device to boot
[15.471140] Bluetooth: hci0: Device booted in 34277 usecs
[15.471201] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[15.471487] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0090-0291.ddc
[15.474353] Bluetooth: hci0: Applying Intel DDC parameters completed
[15.474486] Bluetooth: hci0: Found Intel DDC parameters: intel/bdaddress.cfg
[15.475299] Bluetooth: hci0: Applying Intel DDC parameters completed
[15.479381] Bluetooth: hci0: Firmware timestamp 2024.10 buildtype 3 build 58595
[15.479385] Bluetooth: hci0: Firmware SHA1: 0xb4f3cc46
[15.483243] Bluetooth: hci0: Fseq status: Success (0x00)
[15.483246] Bluetooth: hci0: Fseq executed: 00.00.00.00
[15.483247] Bluetooth: hci0: Fseq BT Top: 00.00.00.00
[15.578712] Bluetooth: MGMT ver 1.22
[15.822682] Bluetooth: RFCOMM TTY layer initialized
[15.822690] Bluetooth: RFCOMM socket layer initialized
[15.822695] Bluetooth: RFCOMM ver 1.11

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit f3b845e)
This fixes the following CHECKs, WARNINGs, and ERRORs reported in
hci_intel.c

Reported by checkpatch.pl:
-----------
hci_intel.c
-----------
WARNING: Prefer using '"%s...", __func__' to using 'intel_setup', this
        function's name, in a string
+       bt_dev_dbg(hdev, "start intel_setup");

ERROR: code indent should use tabs where possible
+        /* Check for supported iBT hardware variants of this firmware$

ERROR: code indent should use tabs where possible
+         * loading method.$

ERROR: code indent should use tabs where possible
+         *$

ERROR: code indent should use tabs where possible
+         * This check has been put in place to ensure correct forward$

ERROR: code indent should use tabs where possible
+         * compatibility options when newer hardware variants come along.$

ERROR: code indent should use tabs where possible
+         */$

CHECK: No space is necessary after a cast
+       duration = (unsigned long long) ktime_to_ns(delta) >> 10;

CHECK: No space is necessary after a cast
+       duration = (unsigned long long) ktime_to_ns(delta) >> 10;

WARNING: Missing a blank line after declarations
+               int err = PTR_ERR(intel->rx_skb);
+               bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err);

Signed-off-by: Uri Arev <[email protected]>
Suggested-by: Luiz Augusto von Dentz <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 62f7de3)
Some of the functions used in btintel.c is made global so that they can
be reused in other transport drivers apart from USB.

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 67d4dba)
Add initial code to support Intel bluetooth devices based on PCIe
transport. Allocate memory for TX & RX buffers, internal structures,
initialize interrupts for TX & RX and PCIe device.

Signed-off-by: Tedd Ho-Jeong An <[email protected]>
Suggested-by: Bjorn Helgaas <[email protected]>
Suggested-by: Paul Menzel <[email protected]>
Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit c2b636b)
Add support to download firmware.

dmesg:
[4.407464] Bluetooth: Core ver 2.22
[4.407467] Bluetooth: Starting self testing
[4.409093] Bluetooth: ECDH test passed in 1587 usecs
[4.420737] Bluetooth: SMP test passed in 526 usecs
[4.420745] Bluetooth: Finished self testing
[4.420760] Bluetooth: HCI device and connection manager initialized
[4.420764] Bluetooth: HCI socket layer initialized
[4.420766] Bluetooth: L2CAP socket layer initialized
[4.420769] Bluetooth: SCO socket layer initialized
[4.437976] Bluetooth: hci0: Device revision is 0
[4.437979] Bluetooth: hci0: Secure boot is disabled
[4.437980] Bluetooth: hci0: OTP lock is disabled
[4.437980] Bluetooth: hci0: API lock is disabled
[4.437981] Bluetooth: hci0: Debug lock is disabled
[4.437981] Bluetooth: hci0: Minimum firmware build 0 week 0 2000
[4.437982] Bluetooth: hci0: Bootloader timestamp 2023.33 buildtype 1 build 45995
[4.439461] Bluetooth: hci0: Found device firmware: intel/ibt-0190-0291-iml.sfi
[4.439467] Bluetooth: hci0: Boot Address: 0x30099000
[4.439468] Bluetooth: hci0: Firmware Version: 92-19.24
[4.486773] Bluetooth: hci0: Waiting for firmware download to complete
[4.486784] Bluetooth: hci0: Firmware loaded in 46209 usecs
[4.486845] Bluetooth: hci0: Waiting for device to boot
[4.491984] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[4.491987] Bluetooth: hci0: Device booted in 5074 usecs
[4.496657] Bluetooth: hci0: Found device firmware: intel/ibt-0190-0291.sfi
[4.496703] Bluetooth: hci0: Boot Address: 0x10000800
[4.496704] Bluetooth: hci0: Firmware Version: 92-19.24
[4.687338] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[4.687342] Bluetooth: BNEP filters: protocol multicast
[4.687345] Bluetooth: BNEP socket layer initialized
[4.922589] Bluetooth: hci0: Waiting for firmware download to complete
[4.922608] Bluetooth: hci0: Firmware loaded in 415962 usecs
[4.922664] Bluetooth: hci0: Waiting for device to boot
[4.956185] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[4.956188] Bluetooth: hci0: Device booted in 32770 usecs
[4.963167] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0190-0291.ddc
[4.963440] Bluetooth: hci0: Applying Intel DDC parameters completed
[4.963684] Bluetooth: hci0: Firmware timestamp 2024.18 buildtype 3 build 62300
[4.963687] Bluetooth: hci0: Firmware SHA1: 0x8201a4cd
[5.003020] Bluetooth: MGMT ver 1.22
[5.003084] Bluetooth: ISO socket layer initialized
[5.057844] Bluetooth: RFCOMM TTY layer initialized
[5.057858] Bluetooth: RFCOMM socket layer initialized
[5.057865] Bluetooth: RFCOMM ver 1.11

hciconfig -a:
hci0:   Type: Primary  Bus: PCI
        BD Address: A0:D3:65:48:F5:7F  ACL MTU: 1021:5  SCO MTU: 240:8
        UP RUNNING PSCAN
        RX bytes:23603 acl:0 sco:0 events:3792 errors:0
        TX bytes:949804 acl:0 sco:0 commands:3788 errors:0
        Features: 0xbf 0xfe 0x0f 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH SNIFF
        Link mode: PERIPHERAL ACCEPT
        Name: 'LNLM620'
        Class: 0x20010c
        Service Classes: Audio
        Device Class: Computer, Laptop
        HCI Version: 5.4 (0xd)  Revision: 0x4b5c
        LMP Version: 5.4 (0xd)  Subversion: 0x4b5c
        Manufacturer: Intel Corp. (2)

Signed-off-by: Chandrashekar <[email protected]>
Suggested-by: Bjorn Helgaas <[email protected]>
Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 6e65a09)
Fix compiler warnings reported by kernel bot.

Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Fixes: c2b636b ("Bluetooth: btintel_pcie: Add support for PCIe transport")
Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit a18d28f)
Fix the following compiler warning reported for ARCH=arm
multi_v7_defconfig.

In file included from drivers/bluetooth/hci_ldisc.c:34:
drivers/bluetooth/btintel.h:373:13: warning: 'btintel_hw_error' defined
but not used [-Wunused-function]
  373 | static void btintel_hw_error(struct hci_dev *hdev, u8 code)
      |             ^~~~~~~~~~~~~~~~

cc: Stephen Rothwell <[email protected]>
Fixes: 67d4dba ("Bluetooth: btintel: Export few static functions")
Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 36b1c9c)
Fix sparse error.

Fixes: c2b636b ("Bluetooth: btintel_pcie: Add support for PCIe transport")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit e5a43ef)
Minor refactor and s/TX_WAIT_TIMEOUT_MS/BTINTEL_PCIE_TX_WAIT_TIMEOUT_MS/g.

Fixes: 6e65a09 ("Bluetooth: btintel_pcie: Add *setup* function to download firmware")
Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 6a486c1)
check pdata return of skb_pull_data, instead of data.

Fixes: c2b636b ("Bluetooth: btintel_pcie: Add support for PCIe transport")
Signed-off-by: Vijay Satija <[email protected]>
Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 3f35d9b3e9a0e3c4684252ab91e648b96a179482)
Firmware sequencer (FSEQ) is a common code shared across Bluetooth
and Wifi. Printing FSEQ will help to debug if there is any mismatch
between Bluetooth and Wifi FSEQ.

Make 'btintel_print_fseq_info' public and use it in btintel_pcie.c.

dmesg:

....

[ 5335.695740] Bluetooth: hci0: Device booted in 33872 usecs
[ 5335.695918] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0190-0291.ddc
[ 5335.697011] Bluetooth: hci0: Applying Intel DDC parameters completed
[ 5335.697837] Bluetooth: hci0: Firmware timestamp 2024.20 buildtype 0 build 62871
[ 5335.697848] Bluetooth: hci0: Firmware SHA1: 0xeffdce06
[ 5335.698655] Bluetooth: hci0: Fseq status: Success (0x00)
[ 5335.698666] Bluetooth: hci0: Fseq executed: 00.00.04.176
[ 5335.698670] Bluetooth: hci0: Fseq BT Top: 00.00.04.176
[ 5335.750204] Bluetooth: MGMT ver 1.22

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 17813af5656b1f47fc3bc2c486ac8014e0026ad8)
Free irq before releasing irq vector.

Fixes: c2b636b ("Bluetooth: btintel_pcie: Add support for PCIe transport")
Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 041677e7aad6f57020aa271aafd4cb9e2af1536f)
Remove memset(0) after dma_alloc_coherent(), which already zeroes out
the memory, and fix the following two Coccinelle/coccicheck warnings
reported by zalloc-simple.cocci:

btintel_pcie.c:837:19-37: WARNING: dma_alloc_coherent used in

	/* Allocate full chunk of data buffer for DMA first and do indexing and
	 * initialization next, so it can be freed easily
	 */
	rxq->buf_v_addr   already zeroes out memory, so memset is not needed

btintel_pcie.c:792:19-37: WARNING: dma_alloc_coherent used in

	/* Allocate full chunk of data buffer for DMA first and do indexing and
	 * initialization next, so it can be freed easily
	 */
	txq->buf_v_addr   already zeroes out memory, so memset is not needed

Fixes: c2b636b ("Bluetooth: btintel_pcie: Add support for PCIe transport")
Signed-off-by: Thorsten Blum <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 67c3bceabb42780f18362d7c5ec72a700051ca36)

/* Registers for MSI-X */
#define BTINTEL_PCIE_CSR_MSIX_BASE (0x2000)
#define BTINTEL_PCIE_CSR_MSIX_FH_INT_CAUSES (BTINTEL_PCIE_CSR_MSIX_BASE + 0x0800)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from opsiff. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

opsiff and others added 11 commits December 3, 2024 23:33
When HCI raw sockets are opened, the Bluetooth kernel module doesn't
track CIS/BIS connections. User-space applications have to identify
ISO data by maintaining connection information and look up the mapping
for each ACL data packet received. Besides, btsnoop log captured in
kernel couldn't tell ISO data from ACL data in this case.

To avoid additional lookups, this patch introduces vendor-specific
packet classification for Intel BT controllers to distinguish
ISO data packets from ACL data packets.

Signed-off-by: Ying Hsu <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit f25b7fd36cc3a850e006aed686f5bbecd200de1b)
From BlazarI onwards, driver shall append the firmware ID (usually
represents transport type) while constructing the firmware name.
Firmware ID is returned on Intel Read Version command.

The new firmware file name for operational image and ddc file shall be,
ibt-<cnvi_top type+cnvi_top step>-<cnvr_top type+cnvr_top step-fw_id>.[sfi|ddc]

dmesg snippet from BlazarI pcie  product:

......

[17.098858] Bluetooth: hci0: Found device firmware: intel/ibt-0190-0291-pci.sfi
[17.098871] Bluetooth: hci0: Boot Address: 0x10000800
[17.098872] Bluetooth: hci0: Firmware Version: 214-25.24
[17.158229] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[17.158236] Bluetooth: BNEP filters: protocol multicast
[17.158241] Bluetooth: BNEP socket layer initialized
[17.468789] Bluetooth: hci0: Waiting for firmware download to complete
[17.468793] Bluetooth: hci0: Firmware loaded in 361262 usecs
[17.468872] Bluetooth: hci0: Waiting for device to boot
[17.504148] Bluetooth: hci0: Device booted in 34512 usecs
[17.504148] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[17.504682] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0190-0291-pci.ddc
[17.505380] Bluetooth: hci0: Applying Intel DDC parameters completed
[17.505622] Bluetooth: hci0: Firmware timestamp 2024.25 buildtype 3 build 64726
[17.505624] Bluetooth: hci0: Firmware SHA1: 0x9f4adddc
[17.505838] Bluetooth: hci0: Fseq status: Success (0x00)
[17.505839] Bluetooth: hci0: Fseq executed: 00.00.04.183
[17.505840] Bluetooth: hci0: Fseq BT Top: 00.00.04.183

dmesg snippet from BlazarI usb product:

.......

[14.212072] Bluetooth: hci0: Found device firmware: intel/ibt-0190-0291-usb.sfi
[14.212091] Bluetooth: hci0: Boot Address: 0x10000800
[14.212093] Bluetooth: hci0: Firmware Version: 79-21.24
[14.262125] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[14.262129] Bluetooth: BNEP filters: protocol multicast
[14.262133] Bluetooth: BNEP socket layer initialized
[15.865421] Bluetooth: hci0: Waiting for firmware download to complete
[15.865991] Bluetooth: hci0: Firmware loaded in 1615150 usecs
[15.866017] Bluetooth: hci0: Waiting for device to boot
[15.899934] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[15.899942] Bluetooth: hci0: Device booted in 33139 usecs
[15.900172] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0190-0291-usb.ddc
[15.901928] Bluetooth: hci0: Applying Intel DDC parameters completed
[15.904993] Bluetooth: hci0: Firmware timestamp 2024.21 buildtype 3 build 63311
[15.904996] Bluetooth: hci0: Firmware SHA1: 0x8b217cf7
[15.908929] Bluetooth: hci0: Fseq status: Success (0x00)
[15.908934] Bluetooth: hci0: Fseq executed: 00.00.04.180
[15.908935] Bluetooth: hci0: Fseq BT Top: 00.00.04.180

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 164c62f958f8c7f0bde1e9a5a8677971c6f28205)
Add support for BlazarU core (CNVi).

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 880120d5f12e3e9af6472f2ddddb33a6c2648418)
BRI (Bluetooth Radio Interface) traffic from CNVr to CNVi was found causing
cross talk step errors to WiFi. To avoid this potential issue OEM platforms
can replace BRI resistor to adjust the BRI response line drive strength.
During the *setup*, driver reads the drive strength value from uefi
variable and passes it to the controller via vendor specific command with
opcode 0xfc0a.

dmesg:

..
[21.982720] Bluetooth: hci0: Bootloader timestamp 2023.33 buildtype 1 build 45995
[21.984250] Bluetooth: hci0: Found device firmware: intel/ibt-0190-0291-iml.sfi
[21.984255] Bluetooth: hci0: Boot Address: 0x30099000
[21.984256] Bluetooth: hci0: Firmware Version: 160-24.24
[22.011501] Bluetooth: hci0: Waiting for firmware download to complete
[22.011518] Bluetooth: hci0: Firmware loaded in 26624 usecs
[22.011584] Bluetooth: hci0: Waiting for device to boot
[22.013546] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[22.013552] Bluetooth: hci0: Device booted in 1967 usecs
...
[22.013792] Bluetooth: hci0: dsbr: enable: 0x01 value: 0x0b
...
[22.015027] Bluetooth: hci0: Found device firmware: intel/ibt-0190-0291.sfi
[22.015041] Bluetooth: hci0: Boot Address: 0x10000800
[22.015043] Bluetooth: hci0: Firmware Version: 160-24.24
[22.395821] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[22.395828] Bluetooth: BNEP filters: protocol multicast
...

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit eb9e749c0182affafadfbe5ded4503c4b5a9b57c)
Add a helper function hci_iso_hdr() to extract iso header from skb.

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 29aeb4e8918e6aeeaf0bb7a03b000a73596d54a3)
Add support for handling ISO RX and TX packets.

Signed-off-by: Kiran <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 861da2c11c64abe706a8d39645bbcd3141c2efb5)
Fix driver not allocating memory for struct btintel_data which is used
to store internal data.

Fixes: 6e65a09 ("Bluetooth: btintel_pcie: Add *setup* function to download firmware")
Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 7ffaa200251871980af12e57649ad57c70bf0f43)
The following handshake mechanism needs be followed after firmware
download is completed to bring the firmware to running state.

After firmware fragments of Operational image are downloaded and
secure sends result of the image succeeds,

1. Driver sends HCI Intel reset with boot option #1 to switch FW image.
2. FW sends Alive GP[0] MSIx
3. Driver enables data path (doorbell 0x460 for RBDs, etc...)
4. Driver gets Bootup event from firmware
5. Driver performs D0 entry to device (WRITE to IPC_Sleep_Control =0x0)
6. FW sends Alive GP[0] MSIx
7. Device host interface is fully set for BT protocol stack operation.
8. Driver may optionally get debug event with ID 0x97 which can be dropped

For Intermediate loadger image, all the above steps are applicable
expcept #5 and #6.

On HCI_OP_RESET, firmware raises alive interrupt. Driver needs to wait
for it before passing control over to bluetooth stack.

Co-developed-by: Devegowda Chandrashekar <[email protected]>
Signed-off-by: Devegowda Chandrashekar <[email protected]>
Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 05c200c8f0295c9c91beeb3ee0552331c1f8adbe)
This patch adds a recovery mechanism to recover controller if firmware
download fails due to unresponsive controller, command timeout, firmware
signature verification failure etc. Driver attmepts maximum of 5 times
before giving up.

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit a430c2a10c743dab5a3a07bc4e9544c55bd010fd)
Add DSBR support for BlazarIW, BlazarU and Gale Peak2 cores.

Refer commit eb9e749c0182 ("Bluetooth: btintel: Allow configuring drive
strength of BRI") for details about DSBR.

Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit d88a8bb8bbbec9d57b84232a2d6f8dab84221959)
everestkc and others added 3 commits December 3, 2024 23:33
The switch case statement has a default branch. Thus, the return
statement at the end of the function can never be reached.
Fix it by removing the return statement at the end of the
function.

This issue was reported by Coverity Scan.

Signed-off-by: Everest K.C. <[email protected]>
Reviewed-by: Shuah Khan <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 9b49561f6c35d97f20abc178fece5868dd5e3338)
The variable ret is being assigned -ENOMEM however this is never
read and it is being re-assigned a new value when the code jumps
to label resubmit. The assignment is redundant and can be removed.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
(cherry picked from commit 4900e041c3f05dac47c6bce0844203a0703baaa2)
ASUS Vivobook S 14 (S5406SA) use a intel chip have pcie bt,
enable it.

Signed-off-by: Wentao Guan <[email protected]>

/* Registers for MSI-X */
#define BTINTEL_PCIE_CSR_MSIX_BASE (0x2000)
#define BTINTEL_PCIE_CSR_MSIX_FH_INT_CAUSES (BTINTEL_PCIE_CSR_MSIX_BASE + 0x0800)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)

@deepin-ci-robot
Copy link

deepin pr auto review

--
2.25.1

@opsiff opsiff merged commit 23ddbbf into linux-6.6.y Dec 10, 2024
3 of 10 checks passed
@opsiff opsiff deleted the btintel-update branch December 18, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants