diff options
author | imp <imp@FreeBSD.org> | 2004-05-21 06:39:09 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2004-05-21 06:39:09 +0000 |
commit | fb229e54dcc73140e0eb2bffa7e684764e055643 (patch) | |
tree | f43cd354305cf43af74b1f8e1b380b3b9b15fa5d /sys/dev/pci | |
parent | dd4814977a7a8ed477d15eb6b341c54c2b1a7e85 (diff) | |
download | FreeBSD-src-fb229e54dcc73140e0eb2bffa7e684764e055643.zip FreeBSD-src-fb229e54dcc73140e0eb2bffa7e684764e055643.tar.gz |
Move pci_do_powerstate up a level. Now it just means 'do not turn devices
off into d3 state when there's no driver for the device'. This should
help suspend/resume in the default case.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/pci.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 71c1aae..61ac415 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1237,7 +1237,9 @@ pci_probe_nomatch(device_t dev, device_t child) } printf(" at device %d.%d (no driver attached)\n", pci_get_slot(child), pci_get_function(child)); - pci_cfg_save(child, (struct pci_devinfo *) device_get_ivars(child), 1); + if (pci_do_powerstate) + pci_cfg_save(child, + (struct pci_devinfo *) device_get_ivars(child), 1); return; } @@ -1811,6 +1813,7 @@ pci_cfg_restore(device_t dev, struct pci_devinfo *dinfo) */ if (dinfo->cfg.hdrtype != 0) return; + /* * Restore the device to full power mode. We must do this * before we restore the registers because moving from D3 to @@ -1819,7 +1822,7 @@ pci_cfg_restore(device_t dev, struct pci_devinfo *dinfo) * the noise on boot by doing nothing if we are already in * state D0. */ - if (pci_do_powerstate && (pci_get_powerstate(dev) != PCI_POWERSTATE_D0)) { + if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { if (bootverbose) printf( "pci%d:%d:%d: Transition from D%d to D0\n", @@ -1901,7 +1904,7 @@ pci_cfg_save(device_t dev, struct pci_devinfo *dinfo, int setstate) * implement (a) we don't power the device down on a reattach. */ cls = pci_get_class(dev); - if (pci_do_powerstate && setstate && cls != PCIC_DISPLAY && cls != PCIC_MEMORY) { + if (setstate && cls != PCIC_DISPLAY && cls != PCIC_MEMORY) { /* * PCI spec is clear that we can only go into D3 state from * D0 state. Transition from D[12] into D0 before going |