Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L linux-rt
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • David Runge
  • linux-rt
  • Repository

Switch branch/tag
  • linux-rt
  • net
  • bluetooth
  • hci_core.c
Find file BlameHistoryPermalink
  • Kai-Heng Feng's avatar
    Bluetooth: Move shutdown callback before flushing tx and rx queue · 49c1f5bb
    Kai-Heng Feng authored Aug 10, 2021 and David Runge's avatar David Runge committed Sep 13, 2021
    Commit 0ea9fd00
    
     ("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: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
    Tested-by: default avatarHsin-Yi Wang <hsinyi@chromium.org>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Fixes: 0ea9fd00
    
     ("Bluetooth: Shutdown controller after workqueues are flushed or cancelled")
    Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    Fixes: https://bugs.archlinux.org/task/72032
    49c1f5bb

Replace hci_core.c

Attach a file by drag & drop or click to upload


Cancel
GitLab will create a branch in your fork and start a merge request.