Hi, On 11/3/20 11:49 AM, Andy Shevchenko wrote: > On Tue, Nov 3, 2020 at 12:12 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: >> On 11/3/20 1:05 AM, Coiby Xu wrote: >>> On Tue, Oct 27, 2020 at 11:09:11AM +0100, Hans de Goede wrote: > > ... > >>> [1] https://lore.kernel.org/patchwork/comment/1522675/ >> >> This is a case where Andy is obviously right and you should just use the >> higher precision "unit = 15625" value (except probably that is wrong too, >> see below). >> >> We have had similar issues with the docs for getting the TSC frequency >> on some Intel chips, where the docs said 16.6 MHz for a certain register >> value, where what they meant was 100/6 MHz which really is significantly >> different. This was leading to a time drift of 5 minutes / day on non >> networked (so no NTP) Linux systems. >> >> I think this is what Andy was referring to when he wrote: >> "What the heck with HW companies! (Just an emotion based on the experience)" > > Exactly! > > ... > >> Actually all the values look somewhat suspect. The comment: >> >>> Debounce Debounce Timer Max >>> TmrLarge TmrOutUnit Unit Debounce >>> Time >>> 0 0 61 usec (2 RtcClk) 976 usec >>> 0 1 244 usec (8 RtcClk) 3.9 msec >>> 1 0 15.6 msec (512 RtcClk) 250 msec >>> 1 1 62.5 msec (2048 RtcClk) 1 sec >> >> Helpfully gives the values in RtcClks. A typical RTC clock crystal >> is 32 KHz which gives us 31.25 usec per tick, so I would expect the >> values to be: > > I guess you are mistaken here. Usual frequency for RTC is 32.768kHz > [1], which gives more or less above values > > 30.51757 > 61.03515 > 244.14062 > 15625 > 62500 You are completely right, my bad. > [1]: https://en.wikipedia.org/wiki/Real-time_clock > (just google: rtc clock frequency) I did duckduckgo, but one of the first hits said 32KHz crystal and I assumed that meant 32.000 KHz falling into the exact precision trap I was complaining about in my previous email, oops. Regards, Hans