1. 22 Jul, 2022 8 commits
    • Abhishek Pandit-Subedi's avatar
      Bluetooth: Fix index added after unregister · 0acef50b
      Abhishek Pandit-Subedi authored
      When a userchannel socket is released, we should check whether the hdev
      is already unregistered before sending out an IndexAdded.
      Signed-off-by: default avatarAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      0acef50b
    • Schspa Shi's avatar
      Bluetooth: When HCI work queue is drained, only queue chained work · 877afada
      Schspa Shi authored
      The HCI command, event, and data packet processing workqueue is drained
      to avoid deadlock in commit
      76727c02 ("Bluetooth: Call drain_workqueue() before resetting state").
      
      There is another delayed work, which will queue command to this drained
      workqueue. Which results in the following error report:
      
      Bluetooth: hci2: command 0x040f tx timeout
      WARNING: CPU: 1 PID: 18374 at kernel/workqueue.c:1438 __queue_work+0xdad/0x1140
      Workqueue: events hci_cmd_timeout
      RIP: 0010:__queue_work+0xdad/0x1140
      RSP: 0000:ffffc90002cffc60 EFLAGS: 00010093
      RAX: 0000000000000000 RBX: ffff8880b9d3ec00 RCX: 0000000000000000
      RDX: ffff888024ba0000 RSI: ffffffff814e048d RDI: ffff8880b9d3ec08
      RBP: 0000000000000008 R08: 0000000000000000 R09: 00000000b9d39700
      R10: ffffffff814f73c6 R11: 0000000000000000 R12: ffff88807cce4c60
      R13: 0000000000000000 R14: ffff8880796d8800 R15: ffff8880796d8800
      FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 000000c0174b4000 CR3: 000000007cae9000 CR4: 00000000003506e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       <TASK>
       ? queue_work_on+0xcb/0x110
       ? lockdep_hardirqs_off+0x90/0xd0
       queue_work_on+0xee/0x110
       process_one_work+0x996/0x1610
       ? pwq_dec_nr_in_flight+0x2a0/0x2a0
       ? rwlock_bug.part.0+0x90/0x90
       ? _raw_spin_lock_irq+0x41/0x50
       worker_thread+0x665/0x1080
       ? process_one_work+0x1610/0x1610
       kthread+0x2e9/0x3a0
       ? kthread_complete_and_exit+0x40/0x40
       ret_from_fork+0x1f/0x30
       </TASK>
      
      To fix this, we can add a new HCI_DRAIN_WQ flag, and don't queue the
      timeout workqueue while command workqueue is draining.
      
      Fixes: 76727c02 ("Bluetooth: Call drain_workqueue() before resetting state")
      Reported-by: syzbot+63bed493aebbf6872647@syzkaller.appspotmail.com
      Signed-off-by: default avatarSchspa Shi <schspa@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      877afada
    • Jiasheng Jiang's avatar
      Bluetooth: hci_intel: Add check for platform_driver_register · ab2d2a98
      Jiasheng Jiang authored
      As platform_driver_register() could fail, it should be better
      to deal with the return value in order to maintain the code
      consisitency.
      
      Fixes: 1ab1f239 ("Bluetooth: hci_intel: Add support for platform driver")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      ab2d2a98
    • Alain Michaud's avatar
      Bluetooth: clear the temporary linkkey in hci_conn_cleanup · 629f66aa
      Alain Michaud authored
      If a hardware error occurs and the connections are flushed without a
      disconnection_complete event being signaled, the temporary linkkeys are
      not flushed.
      
      This change ensures that any outstanding flushable linkkeys are flushed
      when the connection are flushed from the hash table.
      
      Additionally, this also makes use of test_and_clear_bit to avoid
      multiple attempts to delete the link key that's already been flushed.
      Signed-off-by: default avatarAlain Michaud <alainm@chromium.org>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      629f66aa
    • Hakan Jansson's avatar
      Bluetooth: hci_bcm: Add support for FW loading in autobaud mode · af35e28f
      Hakan Jansson authored
      Use the presence of a DT property, "brcm,requires-autobaud-mode", to enable
      startup in autobaud mode. If the property is present, the device is started
      in autobaud mode by asserting RTS (BT_UART_CTS_N) prior to powering on the
      device.
      
      Also prevent the use of unsupported commands for devices started in
      autobaud mode. Only a limited subset of HCI commands are supported in
      autobaud mode.
      
      Some devices (e.g. CYW5557x) require autobaud mode to enable FW loading.
      Autobaud mode can also be required on some boards where the controller
      device is using a non-standard baud rate in normal mode when first powered
      on.
      Signed-off-by: default avatarHakan Jansson <hakan.jansson@infineon.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      af35e28f
    • Hakan Jansson's avatar
      dt-bindings: net: broadcom-bluetooth: Add property for autobaud mode · 0b4de252
      Hakan Jansson authored
      Add property, "brcm,requires-autobaud-mode", to enable autobaud mode
      selection.
      
      Some devices (e.g. CYW5557x) require autobaud mode to enable FW loading.
      Autobaud mode can also be required on some boards where the controller
      device is using a non-standard baud rate when first powered on.
      Signed-off-by: default avatarHakan Jansson <hakan.jansson@infineon.com>
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      0b4de252
    • Sai Teja Aluvala's avatar
      Bluetooth: hci_qca: Return wakeup for qca_wakeup · bde63e9e
      Sai Teja Aluvala authored
      This fixes the return value of qca_wakeup(), since
      .wakeup work inversely with original .prevent_wake.
      
      Fixes: 4539ca67 (Bluetooth: Rename driver .prevent_wake to .wakeup)
      Signed-off-by: default avatarSai Teja Aluvala <quic_saluvala@quicinc.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      bde63e9e
    • Aaron Ma's avatar
      Bluetooth: btusb: Add support of IMC Networks PID 0x3568 · c69ecb0e
      Aaron Ma authored
      It is 13d3:3568 for MediaTek MT7922 USB Bluetooth chip.
      
      T:  Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  2 Spd=480 MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=13d3 ProdID=3568 Rev=01.00
      S:  Manufacturer=MediaTek Inc.
      S:  Product=Wireless_Device
      S:  SerialNumber=...
      C:  #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=125us
      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#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
      E:  Ad=0a(O) Atr=03(Int.) MxPS=  64 Ivl=125us
      E:  Ad=8a(I) Atr=03(Int.) MxPS=  64 Ivl=125us
      Signed-off-by: default avatarAaron Ma <aaron.ma@canonical.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      c69ecb0e
  2. 21 Jul, 2022 24 commits
  3. 20 Jul, 2022 8 commits