Re: ohci : strange looking use of round_jiffies_relative. possible bug ?

From: Mike Nuss
Date: Wed Mar 26 2008 - 14:07:06 EST


On Wed, Mar 26, 2008 at 11:46 AM, Richard Kennedy
<richard@xxxxxxxxxxxxxxx> wrote:
>
> On Wed, 2008-03-26 at 11:37 -0400, Alan Stern wrote:
> > On Wed, 26 Mar 2008, Richard Kennedy wrote:
> >
> > > I was looking at the uses of round_jiffies and noticed that the ohci
> > > unlink_watchdog_func() calls
> > > mod_timer(&ohci->unlink_watchdog, round_jiffies_relative(HZ));
> > >
> > > Which looks a bit strange as it will set the timer to 0 <= t < HZ.
> > > Reading the comments I think that is really is expecting to setup timer
> > > to (now + 1s)
> > >
> > > mod_timer(&ohci->unlink_watchdog, round_jiffies(jiffies + HZ));
> > >
> > > If this is not true then perhaps it needs a comment to explain what it
> > > _is_ trying to do, because it's got me baffled ;)

Yes, my intent there was a roughly 1 second delay. You're correct, it's wrong.

> > I'd say it's a bug. Or rather a pair of bugs, since that mod_timer()
> > call appears in two places.

Yup.

Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/