Page MenuHomeFreeBSD

D15305.id.diff
No OneTemporary

D15305.id.diff

Index: sys/dev/acpica/acpi_hpet.c
===================================================================
--- sys/dev/acpica/acpi_hpet.c
+++ sys/dev/acpica/acpi_hpet.c
@@ -841,15 +841,28 @@
static int
hpet_suspend(device_t dev)
{
-// struct hpet_softc *sc;
+ struct hpet_softc *sc;
+ struct hpet_timer *t;
+ int i;
/*
* Disable the timer during suspend. The timer will not lose
* its state in S1 or S2, but we are required to disable
* it.
*/
-// sc = device_get_softc(dev);
-// hpet_disable(sc);
+ sc = device_get_softc(dev);
+ hpet_disable(sc);
+ for (i = 0; i < sc->num_timers; i++) {
+ t = &sc->t[i];
+
+ /*
+ * Clear timer state to minimize chances of confusing
+ * the firmware after resuming from S3.
+ */
+ bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num),
+ t->caps & ~(HPET_TCNF_INT_ENB | HPET_TCNF_TYPE));
+ bus_write_4(sc->mem_res, HPET_ISR, 1 << t->num);
+ }
return (0);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 20, 12:22 PM (2 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31716833
Default Alt Text
D15305.id.diff (925 B)

Event Timeline