Re: [RFC PATCH v4 03/21] x86/hpet: Calculate ticks-per-second in a separate function

2019-06-18 Thread Thomas Gleixner
On Tue, 18 Jun 2019, Ricardo Neri wrote: > On Fri, Jun 14, 2019 at 05:54:05PM +0200, Thomas Gleixner wrote: > > > > So we already have ticks per second, aka frequency, right? So why do we > > need yet another function instead of using the value which is computed > > once? The frequency of the HPET

Re: [RFC PATCH v4 03/21] x86/hpet: Calculate ticks-per-second in a separate function

2019-06-18 Thread Ricardo Neri
On Fri, Jun 14, 2019 at 05:54:05PM +0200, Thomas Gleixner wrote: > On Thu, 23 May 2019, Ricardo Neri wrote: > > > > +u64 hpet_get_ticks_per_sec(u64 hpet_caps) > > +{ > > + u64 ticks_per_sec, period; > > + > > + period = (hpet_caps & HPET_COUNTER_CLK_PERIOD_MASK) >> > > +HPET_COUNT

Re: [RFC PATCH v4 03/21] x86/hpet: Calculate ticks-per-second in a separate function

2019-06-14 Thread Thomas Gleixner
On Fri, 14 Jun 2019, Thomas Gleixner wrote: > On Thu, 23 May 2019, Ricardo Neri wrote: > > int hpet_alloc(struct hpet_data *hdp) > > { > > u64 cap, mcfg; > > @@ -844,7 +867,6 @@ int hpet_alloc(struct hpet_data *hdp) > > struct hpets *hpetp; > > struct hpet __iomem *hpet; > > stati

Re: [RFC PATCH v4 03/21] x86/hpet: Calculate ticks-per-second in a separate function

2019-06-14 Thread Thomas Gleixner
On Thu, 23 May 2019, Ricardo Neri wrote: > > +u64 hpet_get_ticks_per_sec(u64 hpet_caps) > +{ > + u64 ticks_per_sec, period; > + > + period = (hpet_caps & HPET_COUNTER_CLK_PERIOD_MASK) >> > + HPET_COUNTER_CLK_PERIOD_SHIFT; /* fs, 10^-15 */ > + > + /* > + * The frequen

[RFC PATCH v4 03/21] x86/hpet: Calculate ticks-per-second in a separate function

2019-05-23 Thread Ricardo Neri
It is easier to compute the expiration times of an HPET timer by using its frequency (i.e., the number of times it ticks in a second) than its period, as given in the capabilities register. In addition to the HPET char driver, the HPET-based hardlockup detector will also need to know the timer's f