Commit f2dece44 authored by Daniel Mack's avatar Daniel Mack Committed by Greg Kroah-Hartman

usb: musb: correct use of schedule_delayed_work()

schedule_delayed_work() takes the delay in jiffies, not msecs. Fix the
caller sites in musb. This bug caused regressions with the cleanups
that went in for 3.14 (8ed1fb79: "usb: musb: finish suspend/reset
work independently from musb_hub_control()").
Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 73926db3
...@@ -480,7 +480,8 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -480,7 +480,8 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
musb->rh_timer = jiffies musb->rh_timer = jiffies
+ msecs_to_jiffies(20); + msecs_to_jiffies(20);
schedule_delayed_work( schedule_delayed_work(
&musb->finish_resume_work, 20); &musb->finish_resume_work,
msecs_to_jiffies(20));
musb->xceiv->state = OTG_STATE_A_HOST; musb->xceiv->state = OTG_STATE_A_HOST;
musb->is_active = 1; musb->is_active = 1;
......
...@@ -135,7 +135,8 @@ void musb_port_suspend(struct musb *musb, bool do_suspend) ...@@ -135,7 +135,8 @@ void musb_port_suspend(struct musb *musb, bool do_suspend)
/* later, GetPortStatus will stop RESUME signaling */ /* later, GetPortStatus will stop RESUME signaling */
musb->port1_status |= MUSB_PORT_STAT_RESUME; musb->port1_status |= MUSB_PORT_STAT_RESUME;
schedule_delayed_work(&musb->finish_resume_work, 20); schedule_delayed_work(&musb->finish_resume_work,
msecs_to_jiffies(20));
} }
} }
...@@ -171,8 +172,7 @@ void musb_port_reset(struct musb *musb, bool do_reset) ...@@ -171,8 +172,7 @@ void musb_port_reset(struct musb *musb, bool do_reset)
if (musb->rh_timer > 0 && remain > 0) { if (musb->rh_timer > 0 && remain > 0) {
/* take into account the minimum delay after resume */ /* take into account the minimum delay after resume */
schedule_delayed_work( schedule_delayed_work(
&musb->deassert_reset_work, &musb->deassert_reset_work, remain);
jiffies_to_msecs(remain));
return; return;
} }
...@@ -180,7 +180,8 @@ void musb_port_reset(struct musb *musb, bool do_reset) ...@@ -180,7 +180,8 @@ void musb_port_reset(struct musb *musb, bool do_reset)
power & ~MUSB_POWER_RESUME); power & ~MUSB_POWER_RESUME);
/* Give the core 1 ms to clear MUSB_POWER_RESUME */ /* Give the core 1 ms to clear MUSB_POWER_RESUME */
schedule_delayed_work(&musb->deassert_reset_work, 1); schedule_delayed_work(&musb->deassert_reset_work,
msecs_to_jiffies(1));
return; return;
} }
...@@ -190,7 +191,8 @@ void musb_port_reset(struct musb *musb, bool do_reset) ...@@ -190,7 +191,8 @@ void musb_port_reset(struct musb *musb, bool do_reset)
musb->port1_status |= USB_PORT_STAT_RESET; musb->port1_status |= USB_PORT_STAT_RESET;
musb->port1_status &= ~USB_PORT_STAT_ENABLE; musb->port1_status &= ~USB_PORT_STAT_ENABLE;
schedule_delayed_work(&musb->deassert_reset_work, 50); schedule_delayed_work(&musb->deassert_reset_work,
msecs_to_jiffies(50));
} else { } else {
dev_dbg(musb->controller, "root port reset stopped\n"); dev_dbg(musb->controller, "root port reset stopped\n");
musb_writeb(mbase, MUSB_POWER, musb_writeb(mbase, MUSB_POWER,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment