login
Header Space

 
 

Re: x86: Clean up computation of HPET .mult variables

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Carlos R. Mafra <crmafra2@...>
Cc: <linux-kernel@...>, <tglx@...>, <venkatesh.pallipadi@...>
Date: Tuesday, May 6, 2008 - 10:17 pm

On Tue, 2008-05-06 at 17:50 -0300, Carlos R. Mafra wrote:

Not yet ..

I used you patch with some formatting changes and I get,

clocksource_hpet.mult   walker = 292935555
clocksource_hpet.mult my patch = 292935555

Same as yours .. just checking ;)

Now I modify the shift value from 22 to 25 and I get this,

clocksource_hpet.mult   walker = 2343484437
clocksource_hpet.mult my patch = 2343484446

I don't think this is due to rounding .. I'm not really sure why they're
different .. I would assume the clocksource_hz2mult is more correct, but
feel free to check into it if you want..

The reason I'm messing with the shift is cause 22 is actually too low..
For your period it can be 25, which would give better accuracy.

If you want to check the shift calculation I used it looks like this,

static inline u32 clocksource_hz2shift(u32 bits, u32 hz)
{
       u64 temp;

       for (; bits > 0; bits--) {
               temp = (u64) NSEC_PER_SEC << bits;
               do_div(temp, hz);
               if ((temp >> 32) == 0)
                       break;
       }
       return bits;
}

Daniel

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Mon May 5, 7:11 pm)
Re: rtc-cmos.c: Build fix, Carlos R. Mafra, (Tue May 6, 2:51 pm)
Re: rtc-cmos.c: Build fix, Andrew Morton, (Wed May 7, 5:31 pm)
Re: rtc-cmos.c: Build fix, Ingo Molnar, (Fri May 9, 4:32 am)
Re: rtc-cmos.c: Build fix, Carlos R. Mafra, (Fri May 9, 8:33 am)
Re: rtc-cmos.c: Build fix, Ingo Molnar, (Wed May 7, 3:10 am)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 9:13 am)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Mon May 5, 7:58 pm)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Mon May 5, 10:13 pm)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Mon May 5, 11:23 pm)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 8:59 am)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Tue May 6, 12:21 pm)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 4:50 pm)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Tue May 6, 10:17 pm)
Re: x86: Clean up computation of HPET .mult variables, Carlos R. Mafra, (Tue May 6, 11:39 pm)
Re: x86: Clean up computation of HPET .mult variables, Daniel Walker, (Wed May 7, 12:21 am)
speck-geostationary