mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
Merge "usb: f_gsi: Initiate remote-wakeup if notification already queued"
This commit is contained in:
commit
82ee11b482
1 changed files with 17 additions and 0 deletions
|
|
@ -2540,6 +2540,9 @@ static void gsi_disable(struct usb_function *f)
|
|||
|
||||
atomic_set(&gsi->connected, 0);
|
||||
|
||||
del_timer(&gsi->gsi_rw_timer);
|
||||
gsi->debugfs_rw_timer_enable = 0;
|
||||
|
||||
if (gsi->prot_id == IPA_USB_RNDIS)
|
||||
rndis_uninit(gsi->params);
|
||||
|
||||
|
|
@ -2603,6 +2606,16 @@ static void gsi_suspend(struct usb_function *f)
|
|||
post_event(&gsi->d_port, EVT_SUSPEND);
|
||||
queue_delayed_work(gsi->d_port.ipa_usb_wq, &gsi->d_port.usb_ipa_w, 0);
|
||||
log_event_dbg("gsi suspended");
|
||||
|
||||
/*
|
||||
* If host suspended bus without receiving notification request then
|
||||
* initiate remote-wakeup. As driver won't be able to do it later since
|
||||
* notification request is already queued.
|
||||
*/
|
||||
if (gsi->c_port.notify_req_queued && usb_gsi_remote_wakeup_allowed(f)) {
|
||||
mod_timer(&gsi->gsi_rw_timer, jiffies + msecs_to_jiffies(2000));
|
||||
log_event_dbg("%s: pending response, arm rw_timer\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
static void gsi_resume(struct usb_function *f)
|
||||
|
|
@ -2620,6 +2633,10 @@ static void gsi_resume(struct usb_function *f)
|
|||
gsi->func_is_suspended)
|
||||
return;
|
||||
|
||||
/* Keep timer enabled if user enabled using debugfs */
|
||||
if (!gsi->debugfs_rw_timer_enable)
|
||||
del_timer(&gsi->gsi_rw_timer);
|
||||
|
||||
if (gsi->c_port.notify && !gsi->c_port.notify->desc)
|
||||
config_ep_by_speed(cdev->gadget, f, gsi->c_port.notify);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue