Re: [PATCH] MIPS: Don't overflow cevt-r4k.c calculations at high clock rates.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Wed, 19 May 2010, Thomas Gleixner wrote:

> On Tue, 18 May 2010, David Daney wrote:
> 
> > The 'mult' element of struct clock_event_device must never be wider
> > than 32-bits.  If it were, it would get truncated when used by
> > clockevent_delta2ns() when this calls do_div().
> > 
> > We meet the requirement by ensuring that the relationship:
> > 
> >  (mips_hpt_frequency >> (32 - shift)) < NSEC_PER_SEC
> > 
> > Always holds.
> 
> clocks_calc_mult_shift() is your friend :)

There are wrapper functions for clock sources and clock events as well:

clocksource_calc_mult_shift()
clockevents_calc_mult_shift()

Thanks,

	tglx


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux