-
Notifications
You must be signed in to change notification settings - Fork 105
[Deepin-Kernel-SIG] [Upstream] [linux 6.6-y] Bluetooth: btmtk: Fix failed to send func ctrl for MediaTek devices. #575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Deepin-Kernel-SIG] [Upstream] [linux 6.6-y] Bluetooth: btmtk: Fix failed to send func ctrl for MediaTek devices. #575
Conversation
[ Upstream commit 67dba2c ] Use usb_autopm_get_interface() and usb_autopm_put_interface() in btmtk_usb_shutdown(), it could send func ctrl after enabling autosuspend. Bluetooth: btmtk_usb_hci_wmt_sync() hci0: Execution of wmt command timed out Bluetooth: btmtk_usb_shutdown() hci0: Failed to send wmt func ctrl (-110) Fixes: 5c5e8c5 ("Bluetooth: btmtk: move btusb_mtk_[setup, shutdown] to btmtk.c") Signed-off-by: Chris Lu <chris.lu@mediatek.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit cd4522b)
Reviewer's Guide by SourceryThis pull request addresses a bug in the btmtk driver that prevents the device from sending a function control command after autosuspend is enabled. The fix involves using usb_autopm_get_interface() and usb_autopm_put_interface() to ensure the device is properly powered during the shutdown process. Additionally, the pull request replaces sprintf with sysfs_emit in the rfcomm tty driver. Sequence diagram for btmtk USB device shutdown processsequenceDiagram
participant H as HCI Device
participant D as btmtk Driver
participant U as USB Interface
H->>D: btmtk_usb_shutdown()
D->>U: usb_autopm_get_interface()
Note over D,U: Ensure device is powered
D->>H: Send WMT Function Control
alt Success
H-->>D: Command Success
D->>U: usb_autopm_put_interface()
else Failure
H-->>D: Command Failed
D->>U: usb_autopm_put_interface()
D-->>H: Return Error
end
State diagram for USB device power managementstateDiagram-v2
[*] --> Active: usb_autopm_get_interface()
Active --> SendingCommand: WMT Function Control
SendingCommand --> ReleasePower: Command Complete
ReleasePower --> [*]: usb_autopm_put_interface()
SendingCommand --> Error: Command Failed
Error --> ReleasePower
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @opsiff - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sourcery-ai[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
stable inclusion
from stable-6.12.10
category: bugfix
[ Upstream commit 67dba2c ]
Use usb_autopm_get_interface() and usb_autopm_put_interface() in btmtk_usb_shutdown(), it could send func ctrl after enabling autosuspend.
Bluetooth: btmtk_usb_hci_wmt_sync() hci0: Execution of wmt command
timed out
Bluetooth: btmtk_usb_shutdown() hci0: Failed to send wmt func ctrl
(-110)
Fixes: 5c5e8c5 ("Bluetooth: btmtk: move btusb_mtk_[setup, shutdown] to btmtk.c")
Signed-off-by: Chris Lu chris.lu@mediatek.com
Signed-off-by: Luiz Augusto von Dentz luiz.von.dentz@intel.com
Signed-off-by: Sasha Levin sashal@kernel.org
(cherry picked from commit cd4522b)
Summary by Sourcery
Bug Fixes: