aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/musb/musb_core.c')
-rw-r--r--drivers/usb/musb/musb_core.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index fca288bbc800..772f15821242 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -594,11 +594,11 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
594 | MUSB_PORT_STAT_RESUME; 594 | MUSB_PORT_STAT_RESUME;
595 musb->rh_timer = jiffies 595 musb->rh_timer = jiffies
596 + msecs_to_jiffies(USB_RESUME_TIMEOUT); 596 + msecs_to_jiffies(USB_RESUME_TIMEOUT);
597 musb->need_finish_resume = 1;
598
599 musb->xceiv->otg->state = OTG_STATE_A_HOST; 597 musb->xceiv->otg->state = OTG_STATE_A_HOST;
600 musb->is_active = 1; 598 musb->is_active = 1;
601 musb_host_resume_root_hub(musb); 599 musb_host_resume_root_hub(musb);
600 schedule_delayed_work(&musb->finish_resume_work,
601 msecs_to_jiffies(USB_RESUME_TIMEOUT));
602 break; 602 break;
603 case OTG_STATE_B_WAIT_ACON: 603 case OTG_STATE_B_WAIT_ACON:
604 musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; 604 musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL;
@@ -1925,6 +1925,14 @@ static void musb_pm_runtime_check_session(struct musb *musb)
1925static void musb_irq_work(struct work_struct *data) 1925static void musb_irq_work(struct work_struct *data)
1926{ 1926{
1927 struct musb *musb = container_of(data, struct musb, irq_work.work); 1927 struct musb *musb = container_of(data, struct musb, irq_work.work);
1928 int error;
1929
1930 error = pm_runtime_get_sync(musb->controller);
1931 if (error < 0) {
1932 dev_err(musb->controller, "Could not enable: %i\n", error);
1933
1934 return;
1935 }
1928 1936
1929 musb_pm_runtime_check_session(musb); 1937 musb_pm_runtime_check_session(musb);
1930 1938
@@ -1932,6 +1940,9 @@ static void musb_irq_work(struct work_struct *data)
1932 musb->xceiv_old_state = musb->xceiv->otg->state; 1940 musb->xceiv_old_state = musb->xceiv->otg->state;
1933 sysfs_notify(&musb->controller->kobj, NULL, "mode"); 1941 sysfs_notify(&musb->controller->kobj, NULL, "mode");
1934 } 1942 }
1943
1944 pm_runtime_mark_last_busy(musb->controller);
1945 pm_runtime_put_autosuspend(musb->controller);
1935} 1946}
1936 1947
1937static void musb_recover_from_babble(struct musb *musb) 1948static void musb_recover_from_babble(struct musb *musb)
@@ -2710,11 +2721,6 @@ static int musb_resume(struct device *dev)
2710 mask = MUSB_DEVCTL_BDEVICE | MUSB_DEVCTL_FSDEV | MUSB_DEVCTL_LSDEV; 2721 mask = MUSB_DEVCTL_BDEVICE | MUSB_DEVCTL_FSDEV | MUSB_DEVCTL_LSDEV;
2711 if ((devctl & mask) != (musb->context.devctl & mask)) 2722 if ((devctl & mask) != (musb->context.devctl & mask))
2712 musb->port1_status = 0; 2723 musb->port1_status = 0;
2713 if (musb->need_finish_resume) {
2714 musb->need_finish_resume = 0;
2715 schedule_delayed_work(&musb->finish_resume_work,
2716 msecs_to_jiffies(USB_RESUME_TIMEOUT));
2717 }
2718 2724
2719 /* 2725 /*
2720 * The USB HUB code expects the device to be in RPM_ACTIVE once it came 2726 * The USB HUB code expects the device to be in RPM_ACTIVE once it came
@@ -2766,12 +2772,6 @@ static int musb_runtime_resume(struct device *dev)
2766 2772
2767 musb_restore_context(musb); 2773 musb_restore_context(musb);
2768 2774
2769 if (musb->need_finish_resume) {
2770 musb->need_finish_resume = 0;
2771 schedule_delayed_work(&musb->finish_resume_work,
2772 msecs_to_jiffies(USB_RESUME_TIMEOUT));
2773 }
2774
2775 spin_lock_irqsave(&musb->lock, flags); 2775 spin_lock_irqsave(&musb->lock, flags);
2776 error = musb_run_resume_work(musb); 2776 error = musb_run_resume_work(musb);
2777 if (error) 2777 if (error)