[GIT PULL] iop clocksource support for 2.6.33

Mikael Pettersson mikpe at it.uu.se
Sat Nov 21 14:28:40 EST 2009


Linus Walleij writes:
 > 2009/11/20 Dan Williams <dan.j.williams at intel.com>:
 > 
 > (...)
 > 
 > > +static void __init iop_clocksource_set_hz(struct clocksource *cs, unsigned int hz)
 > > +{
 > > +       u64 temp;
 > > +       u32 shift;
 > > +
 > > +       /* Find shift and mult values for hz. */
 > > +       shift = 32;
 > > +       do {
 > > +               temp = (u64) NSEC_PER_SEC << shift;
 > > +               do_div(temp, hz);
 > > +               if ((temp >> 32) == 0)
 > > +                       break;
 > > +       } while (--shift != 0);
 > > +
 > > +       cs->shift = shift;
 > > +       cs->mult = (u32) temp;
 > > +
 > > +       printk(KERN_INFO "clocksource: %s uses shift %u mult %#x\n",
 > > +              cs->name, cs->shift, cs->mult);
 > > +}
 > 
 > (...)
 > 
 > > +static void __init iop_clockevent_set_hz(struct clock_event_device *ce, unsigned int hz)
 > > +{
 > > +       u64 temp;
 > > +       u32 shift;
 > > +
 > > +       /* Find shift and mult values for hz. */
 > > +       shift = 32;
 > > +       do {
 > > +               temp = (u64) hz << shift;
 > > +               do_div(temp, NSEC_PER_SEC);
 > > +               if ((temp >> 32) == 0)
 > > +                       break;
 > > +       } while (--shift != 0);
 > > +
 > > +       ce->shift = shift;
 > > +       ce->mult = (u32) temp;
 > > +
 > > +       printk(KERN_INFO "clockevent: %s uses shift %u mult %#lx\n",
 > > +              ce->name, ce->shift, ce->mult);
 > >  }
 > 
 > I only recently annoyed TGLX enough to have this generified from the MIPS
 > versions in a few recent patches visible in linux-next.
 > 
 > Not that it can't be fixed afterwards, so no blocker.

If/when Linus' tree has both the iop clocks update and Thomas'
update to make the MIPS shift/mult compute functions generic,
I'll send in a cleanup to make iop's time code use the new generic
functions instead (I've already tested that combo). The iop update
does not conflict with Thomas', but there will temporarily be a
little bit of code duplication.



More information about the linux-arm-kernel mailing list