1. 09 11月, 2019 1 次提交
  2. 04 11月, 2019 1 次提交
    • C
      Bluetooth: hci_qca: add PM support · 41d5b25f
      Claire Chang 提交于
      Add PM suspend/resume callbacks for hci_qca driver.
      
      BT host will make sure both Rx and Tx go into sleep state in
      qca_suspend. Without this, Tx may still remain in awake state, which
      prevents BTSOC from entering deep sleep. For example, BlueZ will send
      Set Event Mask to device when suspending and this will wake the device
      Rx up. However, the Tx idle timeout on the host side is 2000 ms. If the
      host is suspended before its Tx idle times out, it won't send
      HCI_IBS_SLEEP_IND to the device and the device Rx will remain awake.
      
      We implement this by canceling relevant work in workqueue, sending
      HCI_IBS_SLEEP_IND to the device and then waiting HCI_IBS_SLEEP_IND sent
      by the device.
      
      In order to prevent the device from being awaken again after qca_suspend
      is called, we introduce QCA_SUSPEND flag. QCA_SUSPEND is set in the
      beginning of qca_suspend to indicate system is suspending and that we'd
      like to ignore any further wake events.
      
      With QCA_SUSPEND and spinlock, we can avoid race condition, e.g. if
      qca_enqueue acquires qca->hci_ibs_lock before qca_suspend calls
      cancel_work_sync and then qca_enqueue adds a new qca->ws_awake_device
      work after the previous one is cancelled.
      
      If BTSOC wants to wake the whole system up after qca_suspend is called,
      it will keep sending HCI_IBS_WAKE_IND and uart driver will take care of
      waking the system. For example, uart driver will reconfigure its Rx pin
      to a normal GPIO pin and enable irq wake on that pin when suspending.
      Once host detects Rx falling, the system will begin resuming. Then, the
      BT host clears QCA_SUSPEND flag in qca_resume and begins dealing with
      normal HCI packets. By doing so, only a few HCI_IBS_WAKE_IND packets are
      lost and there is no data packet loss.
      Signed-off-by: NClaire Chang <tientzu@chromium.org>
      Reviewed-by: NBalakrishna Godavarthi <bgodavar@codeaurora.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      41d5b25f
  3. 21 10月, 2019 1 次提交
  4. 17 10月, 2019 5 次提交
  5. 05 9月, 2019 4 次提交
  6. 04 9月, 2019 1 次提交
  7. 14 8月, 2019 1 次提交
  8. 13 8月, 2019 2 次提交
  9. 01 8月, 2019 1 次提交
  10. 06 7月, 2019 2 次提交
    • R
      Bluetooth: hci_qca: Load customized NVM based on the device property · 99c905c6
      Rocky Liao 提交于
      QCA BTSOC NVM is a customized firmware file and different vendors may
      want to have different BTSOC configuration (e.g. Configure SCO over PCM
      or I2S, Setting Tx power, etc.) via this file. This patch will allow
      vendors to download different NVM firmware file by reading a device
      property "firmware-name".
      Signed-off-by: NRocky Liao <rjliao@codeaurora.org>
      Tested-by: NHarish Bandi <c-hbandi@codeaurora.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      99c905c6
    • M
      Bluetooth: hci_qca: wcn3990: Drop baudrate change vendor event · 2faa3f15
      Matthias Kaehlcke 提交于
      Firmware download to the WCN3990 often fails with a 'TLV response size
      mismatch' error:
      
      [  133.064659] Bluetooth: hci0: setting up wcn3990
      [  133.489150] Bluetooth: hci0: QCA controller version 0x02140201
      [  133.495245] Bluetooth: hci0: QCA Downloading qca/crbtfw21.tlv
      [  133.507214] Bluetooth: hci0: QCA TLV response size mismatch
      [  133.513265] Bluetooth: hci0: QCA Failed to download patch (-84)
      
      This is caused by a vendor event that corresponds to an earlier command
      to change the baudrate. The event is not processed in the context of the
      baudrate change and is later interpreted as response to the firmware
      download command (which is also a vendor command), but the driver detects
      that the event doesn't have the expected amount of associated data.
      
      More details:
      
      For the WCN3990 the vendor command for a baudrate change isn't sent as
      synchronous HCI command, because the controller sends the corresponding
      vendor event with the new baudrate. The event is received and decoded
      after the baudrate change of the host port.
      
      Identify the 'unused' event when it is received and don't add it to
      the queue of RX frames.
      Signed-off-by: NMatthias Kaehlcke <mka@chromium.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      2faa3f15
  11. 05 6月, 2019 1 次提交
  12. 06 5月, 2019 1 次提交
  13. 03 5月, 2019 1 次提交
  14. 24 4月, 2019 3 次提交
  15. 03 3月, 2019 1 次提交
  16. 27 2月, 2019 4 次提交
  17. 26 2月, 2019 1 次提交
  18. 18 2月, 2019 3 次提交
  19. 22 1月, 2019 1 次提交
  20. 18 10月, 2018 1 次提交
  21. 06 10月, 2018 1 次提交
    • K
      treewide: Replace more open-coded allocation size multiplications · 329e0989
      Kees Cook 提交于
      As done treewide earlier, this catches several more open-coded
      allocation size calculations that were added to the kernel during the
      merge window. This performs the following mechanical transformations
      using Coccinelle:
      
      	kvmalloc(a * b, ...) -> kvmalloc_array(a, b, ...)
      	kvzalloc(a * b, ...) -> kvcalloc(a, b, ...)
      	devm_kzalloc(..., a * b, ...) -> devm_kcalloc(..., a, b, ...)
      Signed-off-by: NKees Cook <keescook@chromium.org>
      329e0989
  22. 27 9月, 2018 3 次提交
    • B
      Bluetooth: hci_qca: Add poweroff support during hci down for wcn3990 · 3e4be65e
      Balakrishna Godavarthi 提交于
      This patch enables power off support for hci down and power on support
      for hci up. As wcn3990 power sources are ignited by regulators, we will
      turn off them during hci down, i.e. an complete power off of wcn3990.
      So while hci up, will call vendor setup which will turn on the regulators,
      requests BT chip version and download the firmware.
      Signed-off-by: NBalakrishna Godavarthi <bgodavar@codeaurora.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      3e4be65e
    • B
      Bluetooth: hci_qca: Remove hdev dereference in qca_close(). · c2d78273
      Balakrishna Godavarthi 提交于
      When flag KASAN is set, we are seeing an following crash while removing
      hci_uart module.
      
      [   50.589909] Unable to handle kernel paging request at virtual address 6b6b6b6b6b6b73
      [   50.597902] Mem abort info:
      [   50.600846]   Exception class = DABT (current EL), IL = 32 bits
      [   50.606959]   SET = 0, FnV = 0
      [   50.610142]   EA = 0, S1PTW = 0
      [   50.613396] Data abort info:
      [   50.616401]   ISV = 0, ISS = 0x00000004
      [   50.620373]   CM = 0, WnR = 0
      [   50.623466] [006b6b6b6b6b6b73] address between user and kernel address ranges
      [   50.630818] Internal error: Oops: 96000004 [#1] PREEMPT SMP
      
      [   50.671670] PC is at qca_power_shutdown+0x28/0x100 [hci_uart]
      [   50.677593] LR is at qca_close+0x74/0xb0 [hci_uart]
      [   50.775689] Process rmmod (pid: 2144, stack limit = 0xffffff801ba90000)
      [   50.782493] Call trace:
      
      [   50.872150] [<ffffff8000c3c81c>] qca_power_shutdown+0x28/0x100 [hci_uart]
      [   50.879138] [<ffffff8000c3c968>] qca_close+0x74/0xb0 [hci_uart]
      [   50.885238] [<ffffff8000c3a71c>] hci_uart_unregister_device+0x44/0x50 [hci_uart]
      [   50.892846] [<ffffff8000c3c9f4>] qca_serdev_remove+0x50/0x5c [hci_uart]
      [   50.899654] [<ffffff800844f630>] serdev_drv_remove+0x28/0x38
      [   50.905489] [<ffffff800850fc44>] device_release_driver_internal+0x140/0x1e4
      [   50.912653] [<ffffff800850fd94>] driver_detach+0x78/0x84
      [   50.918121] [<ffffff800850edac>] bus_remove_driver+0x80/0xa8
      [   50.923942] [<ffffff80085107dc>] driver_unregister+0x4c/0x58
      [   50.929768] [<ffffff8000c3ca8c>] qca_deinit+0x24/0x598 [hci_uart]
      [   50.936045] [<ffffff8000c3ca10>] hci_uart_exit+0x10/0x48 [hci_uart]
      [   50.942495] [<ffffff8008136630>] SyS_delete_module+0x17c/0x224
      
      This crash is due to dereference of hdev, after freeing it.
      Signed-off-by: NBalakrishna Godavarthi <bgodavar@codeaurora.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      c2d78273
    • B
      Bluetooth: hci_qca: Remove serdev_device_open/close function calls · ca30ccd2
      Balakrishna Godavarthi 提交于
      Removed serdev_device_open/close functions from qca_open/close as
      they are called in hci_uart_register_device() and
      hci_uart_unregister_device() functions.
      Signed-off-by: NBalakrishna Godavarthi <bgodavar@codeaurora.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      ca30ccd2