-
Notifications
You must be signed in to change notification settings - Fork 105
[Deepin-Kernel-SIG] [linux 6.6-y] [FROMLIST] Bluetooth: btmtk: delay usb_autopm_put_interface until WMT … #673
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] [linux 6.6-y] [FROMLIST] Bluetooth: btmtk: delay usb_autopm_put_interface until WMT … #673
Conversation
…event received Delay calling usb_autopm_put_interface until the WMT event response is received to ensure proper synchronization and prevent premature power management actions. Co-developed-by: Yake Yang <[email protected]> Signed-off-by: Yake Yang <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Wentao Guan <[email protected]>
Reviewer's Guide by SourceryThis pull request delays the call to No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review代码审查意见:
综合以上意见,修改后的代码可能如下: static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,
struct btmtk_wmt_cmd *cmd,
struct btmtk_wmt_evt *evt)
{
struct btmtk_data *data = hci_get_drvdata(hdev);
struct btmtk_wmt_cmd_wc *wc;
struct sk_buff *wmt_skb;
struct btmtk_hci_wmt_evt *wmt_evt;
int err;
wc = kzalloc(sizeof(*wc), GFP_KERNEL);
if (!wc)
return -ENOMEM;
err = btmtk_usb_submit_wmt_send_urb(hdev, cmd, wc);
if (err < 0) {
clear_bit(BTMTK_TX_WAIT_VND_EVT, &data->flags);
goto err_free_wc;
}
err = btmtk_usb_submit_wmt_recv_urb(hdev);
if (err < 0)
goto err_pm_put;
/* The vendor specific WMT commands are all answered by a vendor
* specific event and will have the Command Status or Command
* Complete event.
*/
err = wait_event_interruptible(data->wait,
test_bit(BTMTK_RX_WAIT_VND_EVT, &data->flags));
if (err == -EINTR) {
bt_dev_err(hdev, "Execution of wmt command interrupted");
clear_bit(BTMTK_TX_WAIT_VND_EVT, &data->flags);
goto err_pm_put;
}
if (err) {
bt_dev_err(hdev, "Execution of wmt command timed out");
clear_bit(BTMTK_TX_WAIT_VND_EVT, &data->flags);
err = -ETIMEDOUT;
goto err_pm_put;
}
if (data->evt_skb == NULL)
goto err_pm_put;
/* Parse and handle the return WMT event */
wmt_evt = (struct btmtk_hci_wmt_evt *)data->evt_skb->data;
/* ... */
err_free_skb:
kfree_skb(data->evt_skb);
data->evt_skb = NULL;
err_pm_put:
usb_autopm_put_interface(data->intf);
err_free_wc:
kfree(wc);
return err;
}请注意,这只是一个示例,具体的修改可能需要根据实际代码逻辑进行调整。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hello666888999 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 |
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 - here's some feedback:
Overall Comments:
- Consider adding a comment explaining why
usb_autopm_put_interfaceis called in the newerr_pm_putlabel.
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.
…event received
Delay calling usb_autopm_put_interface until the WMT event response is received to ensure proper synchronization and prevent premature power management actions.
Co-developed-by: Yake Yang [email protected]
Summary by Sourcery
Delays calling usb_autopm_put_interface until the WMT event response is received to ensure proper synchronization and prevent premature power management actions.