diff options
author | 2012-09-07 19:26:48 +0000 | |
---|---|---|
committer | 2012-09-07 19:26:48 +0000 | |
commit | 7438b4efe129f03a3ebc8dc948d8b6a93edb299a (patch) | |
tree | 1484dfc980e69be7253d9cb27351953714b19a9f | |
parent | Implement pci_min_powerstate(). (diff) | |
download | wireguard-openbsd-7438b4efe129f03a3ebc8dc948d8b6a93edb299a.tar.xz wireguard-openbsd-7438b4efe129f03a3ebc8dc948d8b6a93edb299a.zip |
Call pci_min_powerstate() to determine the lowest possible powerstate instead
of hardcoding it to D3.
-rw-r--r-- | sys/dev/pci/pci.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/ppb.c | 10 |
2 files changed, 13 insertions, 6 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index e265743dd17..7c2de8c1c5d 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci.c,v 1.94 2011/10/10 19:42:37 miod Exp $ */ +/* $OpenBSD: pci.c,v 1.95 2012/09/07 19:26:48 kettenis Exp $ */ /* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */ /* @@ -261,11 +261,14 @@ pci_suspend(struct pci_softc *sc) } if (pci_dopm) { - /* Place the device into D3. */ + /* + * Place the device into the lowest possible + * power state. + */ pd->pd_pmcsr_state = pci_get_powerstate(sc->sc_pc, pd->pd_tag); pci_set_powerstate(sc->sc_pc, pd->pd_tag, - PCI_PMCSR_STATE_D3); + pci_min_powerstate(sc->sc_pc, pd->pd_tag)); } } } diff --git a/sys/dev/pci/ppb.c b/sys/dev/pci/ppb.c index 1849be2f747..32dfce9523e 100644 --- a/sys/dev/pci/ppb.c +++ b/sys/dev/pci/ppb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppb.c,v 1.53 2011/10/31 21:44:54 mikeb Exp $ */ +/* $OpenBSD: ppb.c,v 1.54 2012/09/07 19:26:48 kettenis Exp $ */ /* $NetBSD: ppb.c,v 1.16 1997/06/06 23:48:05 thorpej Exp $ */ /* @@ -391,9 +391,13 @@ ppbactivate(struct device *self, int act) } if (pci_dopm) { - /* Place the bridge into D3. */ + /* + * Place the bridge into the lowest possible + * power state. + */ sc->sc_pmcsr_state = pci_get_powerstate(pc, tag); - pci_set_powerstate(pc, tag, PCI_PMCSR_STATE_D3); + pci_set_powerstate(pc, tag, + pci_min_powerstate(pc, tag)); } break; case DVACT_RESUME: |