Skip to contentSkip to conversation

Does the kernel HPET support has problems or the hwclock from util-linux?

DISCUSSION David Brownell 2 participants 2 messages Jul 4, 2007 – Jul 6, 2007

lore
Share & tools
lore
#0 lore raw

Not that I think it matters, but I understand that util-linux-ng now has a 2.13-rc1 release out, so you're not using the latest version of "hwclock". That shouldn't affect HPET though.

That said, this situation is likely going to be a mess until some new HPET support gets merged. Issues include:

- There are two drivers for the "cmos rtc" ... the legacy version (/dev/rtc), and the one using the new RTC framework ("rtc-cmos" driver, likely /dev/rtc0 on your system).

To use the new one, you'll probably want the latest hwclock, which understands that not ever RTC uses /dev/rtc0. (Or you can symlink /dev/rtc to /dev/rtc0 ...)

- HPET itself has two modes. I think of them as "break things mode" and "sane mode"; but I think they have official names that make the first one sound like it might be reasonable to use. (Yet it isn't; and I suspect that's a big reason why HPET isn't enabled by default on most systems.)

The difference is that the "break things" mode overrides the RTC interrupt line so the RTC can't use it, where the "sane" mode just routes HPET irqs like other IRQs.

- Until the new HPET stuff gets merged (and I don't know what schedule that's on), Linux uses the "break things" mode. Which means that it breaks rtc-cmos ... but the legacy RTC driver has some fairly ugly hacks to cope with it.

The new HPET stuff will among other things let HPET be used to provide per-CPU clockevent sources (assuming there are as many HPET instances as there are CPUs). That's on top of other advantages, like "not breaking things".

So for the short term, I think there might be some set of config options using the legacy (drivers/char/rtc.c) driver that will let you enable HPET, with minimal breakage. I don't know what those options are, or what hwclock would need to do (or not do).

And longer term, the rtc framework version (rtc-cmos) will work just fine with new HPET code, since Linux will be able to use HPET in "sane mode" not "break things" mode.

- Dave

#1 lore raw
Quoted 12 lines · Luca Tettamanti

rae l <[email protected]> ha scritto:

Quoted 10 lines

from this address, I know util-linux-2.12r is the latest:
http://www.kernel.org/pub/linux/utils/util-linux/util-linux-2.12r.lsm

My Dell OptiPlex 320 has 4 HPET timers and no RTC, so the execution of hwclock has errors:

gektop@tux ~ $ /sbin/hwclock --show
select() to /dev/rtc to wait for clock tick timed out gektop@tux ~ $ /sbin/hwclock --version hwclock from util-linux-2.12r

Quoted 6 lines

I think that the problem is that HPET and the CMOS RTC (list in CC) share the same interrupt line.
I suppose that you should enable CONFIG_HPET_RTC_IRQ (my hardware has the same "feature"); in this way /dev/rtc correcly reports that it cannot deliver the interrupt (when HPET is enabled) and hwclock uses direct ISA access.

I searched the CONFIG_HPET_RTC_IRQ, it's conflict with HPET_EMULATE_RTC, that I've enabled.
so while HPET_RTC_IRQ is the good way, EMULATE_RTC is a bad way.

Quoted 7 lines

Luca
--
Windows NT crashed.
I'm the Blue Screen of Death.
No one hears your screams.

Signature · 2 lines
Denis Cheng
Linux Application Developer