1. May 05, 2023
  2. Apr 25, 2023
  3. Apr 24, 2023
    • David S. Miller's avatar
      Merge tag 'for-net-next-2023-04-23' of... · 2efb07b5
      David S. Miller authored
      Merge tag 'for-net-next-2023-04-23' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
      
      bluetooth-next pull request for net-next:
      
       - Introduce devcoredump support
       - Add support for Realtek RTL8821CS, RTL8851B, RTL8852BS
       - Add support for Mediatek MT7663, MT7922
       - Add support for NXP w8997
       - Add support for Actions Semi ATS2851
       - Add support for QTI WCN6855
       - Add support for Marvell 88W8997
      2efb07b5
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_sync: Only allow hci_cmd_sync_queue if running · d883a466
      Luiz Augusto von Dentz authored
      This makes sure hci_cmd_sync_queue only queue new work if HCI_RUNNING
      has been set otherwise there is a risk of commands being sent while
      turning off.
      
      Because hci_cmd_sync_queue can no longer queue work while HCI_RUNNING is
      not set it cannot be used to power on adapters so instead
      hci_cmd_sync_submit is introduced which bypass the HCI_RUNNING check, so
      it behaves like the old implementation.
      
      Link: https://lore.kernel.org/all/CAB4PzUpDMvdc8j2MdeSAy1KkAE-D3woprCwAdYWeOc-3v3c9Sw@mail.gmail.com/
      
      
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      d883a466
    • Tim Jiang's avatar
      Bluetooth: btusb: Add WCN6855 devcoredump support · 20981ce2
      Tim Jiang authored
      
      
      WCN6855 will report memdump via ACL data or HCI event when
      it get crashed, so we collect memdump to debug firmware.
      
      Signed-off-by: default avatarTim Jiang <quic_tjiang@quicinc.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      20981ce2
    • Neeraj Sanjay Kale's avatar
      Bluetooth: btnxpuart: Enable flow control before checking boot signature · b0310d6e
      Neeraj Sanjay Kale authored
      
      
      This enables flow control before checking for bootloader signature and
      deciding whether FW download is needed or not. In case of V1 bootloader
      chips w8987 and w8997, it is observed that if WLAN FW is downloaded first
      and power save is enabled in wlan core, bootloader signatures are not
      emitted by the BT core when the chip is put to sleep. As a result, the
      driver skips FW download and subsequent HCI commands get timeout errors
      in dmesg as shown below:
      
      [  112.898867] Bluetooth: hci0: Opcode 0x c03 failed: -110
      [  114.914865] Bluetooth: hci0: Setting baudrate failed (-110)
      [  116.930856] Bluetooth: hci0: Setting wake-up method failed (-110)
      
      By enabling the flow control, the host enables its RTS pin, and an
      interrupt in chip's UART peripheral causes the bootloader to wake up,
      enabling the bootloader signatures, which then helps in downloading
      the bluetooth FW file.
      
      This changes all instances of 0/1 for serdev_device_set_flow_control()
      to false/true.
      
      Signed-off-by: default avatarNeeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      b0310d6e
    • Archie Pusaka's avatar
      Bluetooth: Cancel sync command before suspend and power off · f4198635
      Archie Pusaka authored
      
      
      Some of the sync commands might take a long time to complete, e.g.
      LE Create Connection when the peer device isn't responding might take
      20 seconds before it times out. If suspend command is issued during
      this time, it will need to wait for completion since both commands are
      using the same sync lock.
      
      This patch cancel any running sync commands before attempting to
      suspend or adapter power off.
      
      Signed-off-by: default avatarArchie Pusaka <apusaka@chromium.org>
      Reviewed-by: default avatarYing Hsu <yinghsu@chromium.org>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      f4198635
    • Max Chou's avatar
      Bluetooth: btrtl: Add the support for RTL8851B · 7948fe1c
      Max Chou authored
      Add the support for RTL8851B BT controller on USB interface.
      The necessary firmware will be submitted to linux-firmware project.
      
      Note that the Bluetooth devices WITH the VID=0x0bda would be set the
      feature quirk in btrtl_setup_realtek(). It's able to ignore the
      feature flag set for the specific VID and PID in blacklist_table[] of
      btusb.c. (check [1])
      
      If Realtek Bluetooth chips WITHOUT the VID=0x0bda, it shall be added
      the feature flag for the specific VID and PID in blacklist_table[] of
      btusb.c. (check [2])
      
      [1] '9ab9235f ("Bluetooth: btrtl: Enable WBS for the specific
          Realtek devices")'
      [2] '73280f13
      
       ("Bluetooth: btusb: Add the more support IDs for
          Realtek RTL8822CE")'
      
      The device info from /sys/kernel/debug/usb/devices as below.
      
      T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 33 Spd=480  MxCh= 0
      D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0bda ProdID=b851 Rev= 0.00
      S:  Manufacturer=Realtek
      S:  Product=802.11ax WLAN Adapter
      S:  SerialNumber=00E04C885A01
      C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA
      A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 8 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=0a(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=0b(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=0c(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      Signed-off-by: default avatarMax Chou <max.chou@realtek.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      7948fe1c
    • Luiz Augusto von Dentz's avatar
      Bluetooth: btnxpuart: Fix sparse warnings · 9e080b53
      Luiz Augusto von Dentz authored
      
      
      This fixes the following sparse warnings:
      
         drivers/bluetooth/btnxpuart.c:681:23: sparse: sparse:
         restricted __le16 degrades to integer
         drivers/bluetooth/btnxpuart.c:690:82: sparse:
         sparse: incorrect type in argument 2 (different base types)
         @@     expected unsigned short [usertype] req_len
         @@     got restricted __le16 [usertype] len @@
         drivers/bluetooth/btnxpuart.c:690:82: sparse:
         expected unsigned short [usertype] req_len
         drivers/bluetooth/btnxpuart.c:690:82: sparse:
         got restricted __le16 [usertype] len
         drivers/bluetooth/btnxpuart.c:694:84: sparse:
         sparse: incorrect type in argument 2 (different base types)
         @@     expected unsigned short [usertype] req_len
         @@     got restricted __le16 [usertype] len @@
         drivers/bluetooth/btnxpuart.c:694:84: sparse:
         expected unsigned short [usertype] req_len
         drivers/bluetooth/btnxpuart.c:694:84: sparse:
         got restricted __le16 [usertype] len
         drivers/bluetooth/btnxpuart.c:708:23: sparse:
         sparse: incorrect type in assignment (different base types)
         @@     expected unsigned int [usertype] requested_len
         @@     got restricted __le16 [usertype] len @@
         drivers/bluetooth/btnxpuart.c:708:23: sparse:
         expected unsigned int [usertype] requested_len
         drivers/bluetooth/btnxpuart.c:708:23: sparse:
         got restricted __le16 [usertype] len
         drivers/bluetooth/btnxpuart.c:787:78: sparse:
         sparse: incorrect type in argument 2 (different base types)
         @@     expected unsigned short [usertype] chipid
         @@     got restricted __le16 [usertype] chip_id @@
         drivers/bluetooth/btnxpuart.c:787:78: sparse:
         expected unsigned short [usertype] chipid
         drivers/bluetooth/btnxpuart.c:787:78: sparse:
         got restricted __le16 [usertype] chip_id
         drivers/bluetooth/btnxpuart.c:810:74: sparse:
         sparse: incorrect type in argument 2 (different base types)
         @@     expected unsigned short [usertype] req_len
         @@     got restricted __le16 [usertype] len @@
         drivers/bluetooth/btnxpuart.c:810:74: sparse:
         expected unsigned short [usertype] req_len
         drivers/bluetooth/btnxpuart.c:810:74: sparse:
         got restricted __le16 [usertype] len
         drivers/bluetooth/btnxpuart.c:815:76: sparse:
         sparse: incorrect type in argument 2 (different base types)
         @@     expected unsigned short [usertype] req_len
         @@     got restricted __le16 [usertype] len @@
         drivers/bluetooth/btnxpuart.c:815:76: sparse:
         expected unsigned short [usertype] req_len
         drivers/bluetooth/btnxpuart.c:815:76: sparse:
         got restricted __le16 [usertype] len
         drivers/bluetooth/btnxpuart.c:834:16: sparse:
         sparse: restricted __le32 degrades to integer
         drivers/bluetooth/btnxpuart.c:843:55: sparse:
         sparse: restricted __le32 degrades to integer
         drivers/bluetooth/btnxpuart.c:844:36: sparse:
         sparse: incorrect type in argument 3 (different base types)
         @@     expected unsigned long [usertype]
         @@     got restricted __le16 [usertype] len @@
         drivers/bluetooth/btnxpuart.c:844:36: sparse:
         expected unsigned long [usertype]
         drivers/bluetooth/btnxpuart.c:844:36: sparse:
         got restricted __le16 [usertype] len
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Link: https://lore.kernel.org/oe-kbuild-all/202304160736.Tsa0zTBU-lkp@intel.com/
      
      
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      9e080b53