Page MenuHomeFreeBSD

hpet_suspend: reset configuration of all timers
AbandonedPublic

Authored by avg on May 5 2018, 5:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 9, 2:34 AM
Unknown Object (File)
Jan 17 2025, 12:44 PM
Unknown Object (File)
Dec 20 2024, 11:18 AM
Unknown Object (File)
Dec 4 2024, 4:35 AM
Unknown Object (File)
Nov 27 2024, 11:25 AM
Unknown Object (File)
Nov 7 2024, 4:23 PM
Unknown Object (File)
Sep 17 2024, 8:26 PM
Unknown Object (File)
Sep 15 2024, 3:31 PM
Subscribers

Details

Reviewers
mav
jkim
kib
jhb
Summary

The theory is that SMM code / firmware could be enabling HPET for its
own uses and unexpected interrupts cause a trouble for it. Without this
change my system was unstable after waking up from S3 if HPET was used
as the kernel event timer.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16441
Build 16360: arc lint + arc unit

Event Timeline

Are eventtimers stopped before suspend ? I think it would be useful to pacify the LAPIC timer as well.

This revision is now accepted and ready to land.May 5 2018, 10:34 AM
In D15305#322677, @kib wrote:

Are eventtimers stopped before suspend ? I think it would be useful to pacify the LAPIC timer as well.

It seems that the event timer infrastructure does not participate in the suspend-resume protocol.
I agree that it would make sense to stop and restart timers at the centralized level.

Something made me to comment out hpet_disable() call on suspend 8 years ago. Wish I remember what was that.

Also I suspect there may be a little point to disable it here without stopping the eventtimer subsystem from reprogramming it again. May be it should be addressed from the both sides.

In D15305#323170, @mav wrote:

Something made me to comment out hpet_disable() call on suspend 8 years ago. Wish I remember what was that.

Maybe the fact that it froze HPET timer(s) and some drivers still needed it...

Also I suspect there may be a little point to disable it here without stopping the eventtimer subsystem from reprogramming it again. May be it should be addressed from the both sides.

This is a very good point. In practice, it seems that the window from stopping HPET to disabling interrupts and stopping other CPUs is sufficiently short. so that HPET does not get reprogrammed.
But that is still possible.
So, after you and Kostik's comments, I think that it's better to explicitly stop and restart event timers.

I've experimented with that and it seems to solve the instability that I had with HPET even without any change to hpet_suspend.
See D15413.

Abandoning this change in favor of more general D15413.