Skip to content
Permalink
Dmitry-Baryshk…
Switch branches/tags

Commits on Aug 17, 2021

  1. WIP: arm64: dts: qcom: qrb5165-rb5: add bus-pwrseq property to pcie0

    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  2. WIP: PCI: qcom: use pwrseq to power up bus devices

    Use bus-pwrseq device tree node to power up the devices on the bus. This
    is to be rewritten with the proper code parsing the device tree and
    powering up individual devices.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  3. arm64: dts: qcom: sdm845-db845c: add second channel support to qca po…

    …wer sequencer
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  4. arm64: dts: qcom: qrb5165-rb5: add bluetooth support

    Add support for the bluetooth part of the QCA6391 BT+WiFi chip present
    on the RB5 board. WiFi is not supported yet, as it requires separate
    handling of the PCIe device power.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  5. arm64: dts: qcom: sdm845-db845c: switch bt+wifi to qca power sequencer

    Switch sdm845-db845c device tree to use new power sequencer driver
    rather than separate regulators.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  6. pwrseq: add support for QCA BT+WiFi power sequencer

    Add support for power sequencer used in the Qualcomm BT+WiFi SoCs. They
    require several external volate regulators and some of them use separate
    BT and WiFi enable GPIO pins. This code is mostly extracted from the
    hci_qca.c bluetooth driver and ath10k WiFi driver. Instead of having
    each of them manage pins, different requirements, regulator types, move
    this knowledge to the common power sequencer driver. Currently original
    drivers are not stripped from the regulator code, this will be done
    later (to keep compatibility with the old device trees).
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  7. Bluetooth: hci_qca: add support for pwrseq

    Support using pwrseq for powering up and down the QCA BT chips.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  8. Bluetooth: hci_qca: futher rework of power on/off handling

    Further rework of power on/off handling. Move bt_en and sw_ctl handling
    close to regulator enable/disable, so that this code can be easily
    extended with pwrseq support.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  9. Bluetooth: hci_qca: merge qca_power_on with qca_regulators_init

    With wcn6750 support added, regulator-based code was extended with the
    bt_en gpio support. Now there is no need to keep regulator and
    non-regulator code paths separate. Merge both code paths.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  10. Bluetooth: hci_qca: merge init paths

    The hci_qca driver has almost identical init paths. Merge them together
    to remove duplication in preparation to adding power sequencer support.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  11. Bluetooth: hci_qca: merge qca_power into qca_serdev

    There is no need to separate struct qca_power from the rest of struct
    qca_serdev. Squash qca_power into the main struct, to simplify the
    driver.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  12. ath10k: add support for pwrseq sequencing

    Power sequencing for Qualcomm WiFi+BT chipsets are being reworked to use
    pwrseq rather than individually handling all the regulators. Add support
    for pwrseq to ath10k SNOC driver.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  13. mmc: core: switch to new pwrseq subsystem

    Drop old MMC pwrseq code and use new pwrseq subsystem instead.
    Individual drivers are already ported to new subsystem.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  14. pwrseq: port MMC's pwrseq drivers to new pwrseq subsystem

    Port MMC's all pwrseq drivers to new pwrseq subsystem.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021
  15. power: add power sequencer subsystem

    Basing on MMC's pwrseq support code, add separate power sequencer
    subsystem. It will be used by other drivers to handle device power up
    requirements.
    
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    lumag authored and intel-lab-lkp committed Aug 17, 2021

Commits on Aug 16, 2021

  1. Bluetooth: Fix race condition in handling NOP command

    For NOP command, need to cancel work scheduled on cmd_timer,
    on receiving command status or commmand complete event.
    
    Below use case might lead to race condition multiple when NOP
    commands are queued sequentially:
    
    hci_cmd_work() {
       if (atomic_read(&hdev->cmd_cnt) {
                .
                .
                .
          atomic_dec(&hdev->cmd_cnt);
          hci_send_frame(hdev,...);
          schedule_delayed_work(&hdev->cmd_timer,...);
       }
    }
    
    On receiving event for first NOP, the work scheduled on hdev->cmd_timer
    is not cancelled and second NOP is dequeued and sent to controller.
    
    While waiting for an event for second NOP command, work scheduled on
    cmd_timer for the first NOP can get scheduled, resulting in sending third
    NOP command (sending back to back NOP commands). This might
    cause issues at controller side (like memory overrun, controller going
    unresponsive) resulting in hci tx timeouts, hardware errors etc.
    
    The fix to this issue is to cancel the delayed work scheduled on
    cmd_timer on receiving command status or command complete event for
    NOP command (this patch handles NOP command same as any other SIG
    command).
    
    Signed-off-by: Kiran K <kiran.k@intel.com>
    Reviewed-by: Chethan T N <chethan.tumkur.narayan@intel.com>
    Reviewed-by: Srivatsa Ravishankar <ravishankar.srivatsa@intel.com>
    Acked-by: Manish Mandlik <mmandlik@google.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    kirankrishnappa-intel authored and holtmann committed Aug 16, 2021
  2. Bluetooth: btbcm: add patch ram for bluetooth

    Bluetooth on the BCM43752 needs a patchram file to function correctly.
    
    Signed-off-by: Angus Ainslie <angus@akkea.ca>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    nytowl authored and holtmann committed Aug 16, 2021
  3. Bluetooth: Store advertising handle so it can be re-enabled

    This stores the advertising handle/instance into hci_conn so it is
    accessible when re-enabling the advertising once disconnected.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Aug 16, 2021
  4. Bluetooth: Fix handling of LE Enhanced Connection Complete

    LE Enhanced Connection Complete contains the Local RPA used in the
    connection which must be used when set otherwise there could problems
    when pairing since the address used by the remote stack could be the
    Local RPA:
    
    BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 4, Part E
    page 2396
    
      'Resolvable Private Address being used by the local device for this
      connection. This is only valid when the Own_Address_Type (from the
      HCI_LE_Create_Connection, HCI_LE_Set_Advertising_Parameters,
      HCI_LE_Set_Extended_Advertising_Parameters, or
      HCI_LE_Extended_Create_Connection commands) is set to 0x02 or
      0x03, and the Controller generated a resolvable private address for the
      local device using a non-zero local IRK. For other Own_Address_Type
      values, the Controller shall return all zeros.'
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Aug 16, 2021
  5. Bluetooth: Move shutdown callback before flushing tx and rx queue

    Commit 0ea9fd0 ("Bluetooth: Shutdown controller after workqueues
    are flushed or cancelled") introduced a regression that makes mtkbtsdio
    driver stops working:
    [   36.593956] Bluetooth: hci0: Firmware already downloaded
    [   46.814613] Bluetooth: hci0: Execution of wmt command timed out
    [   46.814619] Bluetooth: hci0: Failed to send wmt func ctrl (-110)
    
    The shutdown callback depends on the result of hdev->rx_work, so we
    should call it before flushing rx_work:
    -> btmtksdio_shutdown()
     -> mtk_hci_wmt_sync()
      -> __hci_cmd_send()
       -> wait for BTMTKSDIO_TX_WAIT_VND_EVT gets cleared
    
    -> btmtksdio_recv_event()
     -> hci_recv_frame()
      -> queue_work(hdev->workqueue, &hdev->rx_work)
       -> clears BTMTKSDIO_TX_WAIT_VND_EVT
    
    So move the shutdown callback before flushing TX/RX queue to resolve the
    issue.
    
    Reported-and-tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
    Tested-by: Hsin-Yi Wang <hsinyi@chromium.org>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Fixes: 0ea9fd0 ("Bluetooth: Shutdown controller after workqueues are flushed or cancelled")
    Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    khfeng authored and holtmann committed Aug 16, 2021

Commits on Aug 10, 2021

  1. Bluetooth: btusb: check conditions before enabling USB ALT 3 for WBS

    Some USB BT adapters don't satisfy the MTU requirement mentioned in
    commit e848dbd ("Bluetooth: btusb: Add support USB ALT 3 for WBS")
    and have ALT 3 setting that produces no/garbled audio. Some adapters
    with larger MTU were also reported to have problems with ALT 3.
    
    Add a flag and check it and MTU before selecting ALT 3, falling back to
    ALT 1. Enable the flag for Realtek, restoring the previous behavior for
    non-Realtek devices.
    
    Tested with USB adapters (mtu<72, no/garbled sound with ALT3, ALT1
    works) BCM20702A1 0b05:17cb, CSR8510A10 0a12:0001, and (mtu>=72, ALT3
    works) RTL8761BU 0bda:8771, Intel AX200 8087:0029 (after disabling
    ALT6). Also got reports for (mtu>=72, ALT 3 reported to produce bad
    audio) Intel 8087:0a2b.
    
    Signed-off-by: Pauli Virtanen <pav@iki.fi>
    Fixes: e848dbd ("Bluetooth: btusb: Add support USB ALT 3 for WBS")
    Tested-by: Michał Kępień <kernel@kempniu.pl>
    Tested-by: Jonathan Lampérth <jon@h4n.dev>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    pv authored and Vudentz committed Aug 10, 2021
  2. Bluetooth: fix repeated calls to sco_sock_kill

    In commit 4e1a720 ("Bluetooth: avoid killing an already killed
    socket"), a check was added to sco_sock_kill to skip killing a socket
    if the SOCK_DEAD flag was set.
    
    This was done after a trace for a use-after-free bug showed that the
    same sock pointer was being killed twice.
    
    Unfortunately, this check prevents sco_sock_kill from running on any
    socket. sco_sock_kill kills a socket only if it's zapped and orphaned,
    however sock_orphan announces that the socket is dead before detaching
    it. i.e., orphaned sockets have the SOCK_DEAD flag set.
    
    To fix this, we remove the check for SOCK_DEAD, and avoid repeated
    calls to sco_sock_kill by removing incorrect calls in:
    
    1. sco_sock_timeout. The socket should not be killed on timeout as
    further processing is expected to be done. For example,
    sco_sock_connect sets the timer then waits for the socket to be
    connected or for an error to be returned.
    
    2. sco_conn_del. This function should clean up resources for the
    connection, but the socket itself should be cleaned up in
    sco_sock_release.
    
    3. sco_sock_close. Calls to sco_sock_close in sco_sock_cleanup_listen
    and sco_sock_release are followed by sco_sock_kill. Hence the
    duplicated call should be removed.
    
    Fixes: 4e1a720 ("Bluetooth: avoid killing an already killed socket")
    Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    desmondcheongzx authored and Vudentz committed Aug 10, 2021
  3. Bluetooth: switch to lock_sock in RFCOMM

    Other than rfcomm_sk_state_change and rfcomm_connect_ind, functions in
    RFCOMM use lock_sock to lock the socket.
    
    Since bh_lock_sock and spin_lock_bh do not provide synchronization
    with lock_sock, these calls should be changed to lock_sock.
    
    This is now safe to do because packet processing is now done in a
    workqueue instead of a tasklet, so bh_lock_sock/spin_lock_bh are no
    longer necessary to synchronise between user contexts and SOFTIRQ
    processing.
    
    Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    desmondcheongzx authored and Vudentz committed Aug 10, 2021
  4. Bluetooth: serialize calls to sco_sock_{set,clear}_timer

    Currently, calls to sco_sock_set_timer are made under the locked
    socket, but this does not apply to all calls to sco_sock_clear_timer.
    
    Both sco_sock_{set,clear}_timer should be serialized by lock_sock to
    prevent unexpected concurrent clearing/setting of timers.
    
    Additionally, since sco_pi(sk)->conn is only cleared under the locked
    socket, this change allows us to avoid races between
    sco_sock_clear_timer and the call to kfree(conn) in sco_conn_del.
    
    Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    desmondcheongzx authored and Vudentz committed Aug 10, 2021
  5. Bluetooth: switch to lock_sock in SCO

    Since sco_sock_timeout is now scheduled using delayed work, it is no
    longer run in SOFTIRQ context. Hence bh_lock_sock is no longer
    necessary in SCO to synchronise between user contexts and SOFTIRQ
    processing.
    
    As such, calls to bh_lock_sock should be replaced with lock_sock to
    synchronize with other concurrent processes that use lock_sock.
    
    Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    desmondcheongzx authored and Vudentz committed Aug 10, 2021
  6. Bluetooth: avoid circular locks in sco_sock_connect

    In a future patch, calls to bh_lock_sock in sco.c should be replaced
    by lock_sock now that none of the functions are run in IRQ context.
    
    However, doing so results in a circular locking dependency:
    
    ======================================================
    WARNING: possible circular locking dependency detected
    5.14.0-rc4-syzkaller #0 Not tainted
    ------------------------------------------------------
    syz-executor.2/14867 is trying to acquire lock:
    ffff88803e3c1120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at:
    lock_sock include/net/sock.h:1613 [inline]
    ffff88803e3c1120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at:
    sco_conn_del+0x12a/0x2a0 net/bluetooth/sco.c:191
    
    but task is already holding lock:
    ffffffff8d2dc7c8 (hci_cb_list_lock){+.+.}-{3:3}, at:
    hci_disconn_cfm include/net/bluetooth/hci_core.h:1497 [inline]
    ffffffff8d2dc7c8 (hci_cb_list_lock){+.+.}-{3:3}, at:
    hci_conn_hash_flush+0xda/0x260 net/bluetooth/hci_conn.c:1608
    
    which lock already depends on the new lock.
    
    the existing dependency chain (in reverse order) is:
    
    -> #2 (hci_cb_list_lock){+.+.}-{3:3}:
           __mutex_lock_common kernel/locking/mutex.c:959 [inline]
           __mutex_lock+0x12a/0x10a0 kernel/locking/mutex.c:1104
           hci_connect_cfm include/net/bluetooth/hci_core.h:1482 [inline]
           hci_remote_features_evt net/bluetooth/hci_event.c:3263 [inline]
           hci_event_packet+0x2f4d/0x7c50 net/bluetooth/hci_event.c:6240
           hci_rx_work+0x4f8/0xd30 net/bluetooth/hci_core.c:5122
           process_one_work+0x98d/0x1630 kernel/workqueue.c:2276
           worker_thread+0x658/0x11f0 kernel/workqueue.c:2422
           kthread+0x3e5/0x4d0 kernel/kthread.c:319
           ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
    
    -> #1 (&hdev->lock){+.+.}-{3:3}:
           __mutex_lock_common kernel/locking/mutex.c:959 [inline]
           __mutex_lock+0x12a/0x10a0 kernel/locking/mutex.c:1104
           sco_connect net/bluetooth/sco.c:245 [inline]
           sco_sock_connect+0x227/0xa10 net/bluetooth/sco.c:601
           __sys_connect_file+0x155/0x1a0 net/socket.c:1879
           __sys_connect+0x161/0x190 net/socket.c:1896
           __do_sys_connect net/socket.c:1906 [inline]
           __se_sys_connect net/socket.c:1903 [inline]
           __x64_sys_connect+0x6f/0xb0 net/socket.c:1903
           do_syscall_x64 arch/x86/entry/common.c:50 [inline]
           do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
           entry_SYSCALL_64_after_hwframe+0x44/0xae
    
    -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}:
           check_prev_add kernel/locking/lockdep.c:3051 [inline]
           check_prevs_add kernel/locking/lockdep.c:3174 [inline]
           validate_chain kernel/locking/lockdep.c:3789 [inline]
           __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015
           lock_acquire kernel/locking/lockdep.c:5625 [inline]
           lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590
           lock_sock_nested+0xca/0x120 net/core/sock.c:3170
           lock_sock include/net/sock.h:1613 [inline]
           sco_conn_del+0x12a/0x2a0 net/bluetooth/sco.c:191
           sco_disconn_cfm+0x71/0xb0 net/bluetooth/sco.c:1202
           hci_disconn_cfm include/net/bluetooth/hci_core.h:1500 [inline]
           hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1608
           hci_dev_do_close+0x528/0x1130 net/bluetooth/hci_core.c:1778
           hci_unregister_dev+0x1c0/0x5a0 net/bluetooth/hci_core.c:4015
           vhci_release+0x70/0xe0 drivers/bluetooth/hci_vhci.c:340
           __fput+0x288/0x920 fs/file_table.c:280
           task_work_run+0xdd/0x1a0 kernel/task_work.c:164
           exit_task_work include/linux/task_work.h:32 [inline]
           do_exit+0xbd4/0x2a60 kernel/exit.c:825
           do_group_exit+0x125/0x310 kernel/exit.c:922
           get_signal+0x47f/0x2160 kernel/signal.c:2808
           arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:865
           handle_signal_work kernel/entry/common.c:148 [inline]
           exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
           exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:209
           __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
           syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302
           ret_from_fork+0x15/0x30 arch/x86/entry/entry_64.S:288
    
    other info that might help us debug this:
    
    Chain exists of:
      sk_lock-AF_BLUETOOTH-BTPROTO_SCO --> &hdev->lock --> hci_cb_list_lock
    
     Possible unsafe locking scenario:
    
           CPU0                    CPU1
           ----                    ----
      lock(hci_cb_list_lock);
                                   lock(&hdev->lock);
                                   lock(hci_cb_list_lock);
      lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO);
    
     *** DEADLOCK ***
    
    The issue is that the lock hierarchy should go from &hdev->lock -->
    hci_cb_list_lock --> sk_lock-AF_BLUETOOTH-BTPROTO_SCO. For example,
    one such call trace is:
    
      hci_dev_do_close():
        hci_dev_lock();
        hci_conn_hash_flush():
          hci_disconn_cfm():
            mutex_lock(&hci_cb_list_lock);
            sco_disconn_cfm():
            sco_conn_del():
              lock_sock(sk);
    
    However, in sco_sock_connect, we call lock_sock before calling
    hci_dev_lock inside sco_connect, thus inverting the lock hierarchy.
    
    We fix this by pulling the call to hci_dev_lock out from sco_connect.
    
    Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    desmondcheongzx authored and Vudentz committed Aug 10, 2021
  7. Bluetooth: schedule SCO timeouts with delayed_work

    struct sock.sk_timer should be used as a sock cleanup timer. However,
    SCO uses it to implement sock timeouts.
    
    This causes issues because struct sock.sk_timer's callback is run in
    an IRQ context, and the timer callback function sco_sock_timeout takes
    a spin lock on the socket. However, other functions such as
    sco_conn_del and sco_conn_ready take the spin lock with interrupts
    enabled.
    
    This inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} lock usage could
    lead to deadlocks as reported by Syzbot [1]:
           CPU0
           ----
      lock(slock-AF_BLUETOOTH-BTPROTO_SCO);
      <Interrupt>
        lock(slock-AF_BLUETOOTH-BTPROTO_SCO);
    
    To fix this, we use delayed work to implement SCO sock timouts
    instead. This allows us to avoid taking the spin lock on the socket in
    an IRQ context, and corrects the misuse of struct sock.sk_timer.
    
    As a note, cancel_delayed_work is used instead of
    cancel_delayed_work_sync in sco_sock_set_timer and
    sco_sock_clear_timer to avoid a deadlock. In the future, the call to
    bh_lock_sock inside sco_sock_timeout should be changed to lock_sock to
    synchronize with other functions using lock_sock. However, since
    sco_sock_set_timer and sco_sock_clear_timer are sometimes called under
    the locked socket (in sco_connect and __sco_sock_close),
    cancel_delayed_work_sync might cause them to sleep until an
    sco_sock_timeout that has started finishes running. But
    sco_sock_timeout would also sleep until it can grab the lock_sock.
    
    Using cancel_delayed_work is fine because sco_sock_timeout does not
    change from run to run, hence there is no functional difference
    between:
    1. waiting for a timeout to finish running before scheduling another
    timeout
    2. scheduling another timeout while a timeout is running.
    
    Link: https://syzkaller.appspot.com/bug?id=9089d89de0502e120f234ca0fc8a703f7368b31e [1]
    Reported-by: syzbot+2f6d7c28bb4bf7e82060@syzkaller.appspotmail.com
    Tested-by: syzbot+2f6d7c28bb4bf7e82060@syzkaller.appspotmail.com
    Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    desmondcheongzx authored and Vudentz committed Aug 10, 2021

Commits on Aug 6, 2021

  1. Bluetooth: btusb: Fix fall-through warnings

    Fix fall-through warnings:
    drivers/bluetooth/btusb.c: In function ‘btusb_recv_acl_mtk’:
    drivers/bluetooth/btusb.c:4033:3: warning:
    this statement may fall through [-Wimplicit-fallthrough=]
     4033 |   usb_disable_autosuspend(data->udev);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/bluetooth/btusb.c:4034:2: note: here
     4034 |  case 0x05ff:  /* Firmware debug logging 1 */
          |  ^~~~
    
    Signed-off-by: mark-yw.chen <mark-yw.chen@mediatek.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    mark-yw.chen authored and holtmann committed Aug 6, 2021

Commits on Aug 5, 2021

  1. Bluetooth: btintel: Combine setting up MSFT extension

    This patch combines the setting up MSFT extension for the legacy and TLV
    based bootloader into the common function based on hw_variant.
    
    Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    tedd-an authored and holtmann committed Aug 5, 2021
  2. Bluetooth: btintel: Fix the legacy bootloader returns tlv based version

    From the ThP, it supports both legacy and TLV based HCI_Intel_Read_Version
    command after downloading the operational firmware, and it causes the
    driver to choose the wrong setup routines and missing firmware/ddc file.
    
    So, as a workaround, this patch checks the fw variant from the TLV based
    version, and if the device is legacy bootloader device, the legacy
    HCI_Intel_Read_Version command is used to get the legacy version
    information and run the legacy bootloader setup with it.
    
    Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    tedd-an authored and holtmann committed Aug 5, 2021
  3. Bluetooth: btintel: Clean the exported function to static

    This patch changes the exported functions to static if they are no
    longer used by others.
    
    Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    tedd-an authored and holtmann committed Aug 5, 2021
  4. Bluetooth: btintel: Move hci quirks to setup routine

    This patch moves the hci quirks for Intel devices into the setup
    routines and cleaned up the driver flags.
    
    Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    tedd-an authored and holtmann committed Aug 5, 2021
  5. Bluetooth: btintel: Refactoring setup routine for bootloader devices

    This patch refactors the setup routines for legacy and TLV based
    bootloader devices to the combined setup, and move the related functions
    from btusb to btintel.
    
    Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    tedd-an authored and holtmann committed Aug 5, 2021
  6. Bluetooth: btintel: Add combined set_diag functions

    This patch adds a combined set_diag functions.
    It also changes the btintel_set_diag_mfg() to static since it is no
    longer used by others.
    
    Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    tedd-an authored and holtmann committed Aug 5, 2021
  7. Bluetooth: btintel: Fix the LED is not turning off immediately

    Some platforms have an issue with BT LED when the interface is
    down or BT radio is turned off, which takes 5 seconds to BT LED
    goes off. This command turns off the BT LED immediately.
    
    This patch sends the Intel vendor command to turn off the LED.
    
    Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    tedd-an authored and holtmann committed Aug 5, 2021
Older