Skip to content

Commit

Permalink
usb: musb: correct use of schedule_delayed_work()
Browse files Browse the repository at this point in the history
schedule_delayed_work() takes the delay in jiffies, not msecs.

This bug slipped in with the recent reset logic cleanup
(8ed1fb7: "usb: musb: finish suspend/reset work independently from
musb_hub_control()").

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Daniel Mack authored and Felipe Balbi committed Feb 20, 2014
1 parent e7d613d commit 9ccfaf7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
musb->rh_timer = jiffies
+ msecs_to_jiffies(20);
schedule_delayed_work(
&musb->finish_resume_work, 20);
&musb->finish_resume_work,
msecs_to_jiffies(20));

musb->xceiv->state = OTG_STATE_A_HOST;
musb->is_active = 1;
Expand Down
12 changes: 7 additions & 5 deletions drivers/usb/musb/musb_virthub.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ void musb_port_suspend(struct musb *musb, bool do_suspend)

/* later, GetPortStatus will stop RESUME signaling */
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));
}
}

Expand Down Expand Up @@ -171,16 +172,16 @@ void musb_port_reset(struct musb *musb, bool do_reset)
if (musb->rh_timer > 0 && remain > 0) {
/* take into account the minimum delay after resume */
schedule_delayed_work(
&musb->deassert_reset_work,
jiffies_to_msecs(remain));
&musb->deassert_reset_work, remain);
return;
}

musb_writeb(mbase, MUSB_POWER,
power & ~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;
}

Expand All @@ -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_ENABLE;
schedule_delayed_work(&musb->deassert_reset_work, 50);
schedule_delayed_work(&musb->deassert_reset_work,
msecs_to_jiffies(50));
} else {
dev_dbg(musb->controller, "root port reset stopped\n");
musb_writeb(mbase, MUSB_POWER,
Expand Down

0 comments on commit 9ccfaf7

Please sign in to comment.