diff options
author | imp <imp@FreeBSD.org> | 2004-04-09 20:41:18 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2004-04-09 20:41:18 +0000 |
commit | fd167b36d818bcc374e0c630333755132e7bc813 (patch) | |
tree | fdfc8cbb14e4d05da83d561e9a0d40364f4baa08 /sys/dev/pci | |
parent | b1a7a6504a6274afca3eedd827c8db83efac587c (diff) | |
download | FreeBSD-src-fd167b36d818bcc374e0c630333755132e7bc813.zip FreeBSD-src-fd167b36d818bcc374e0c630333755132e7bc813.tar.gz |
Only print state change message for real state changes. When we set a
device in D0 to D0, that's a no-op, however the messages seem to be
confusing some people. Eventually, these messages will be parked
behind a if (bootverbose).
# I don't think this will fix any real bugs...
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/pci.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 3da1386..cf9ffe2 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1703,9 +1703,11 @@ pci_cfg_restore(device_t dev, struct pci_devinfo *dinfo) */ if (dinfo->cfg.hdrtype != 0) return; - printf("pci%d:%d:%d: setting power state D0\n", dinfo->cfg.bus, - dinfo->cfg.slot, dinfo->cfg.func); - pci_set_powerstate(dev, PCI_POWERSTATE_D0); + if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { + printf("pci%d:%d:%d: setting power state D0\n", dinfo->cfg.bus, + dinfo->cfg.slot, dinfo->cfg.func); + pci_set_powerstate(dev, PCI_POWERSTATE_D0); + } for (i = 0; i < dinfo->cfg.nummaps; i++) pci_write_config(dev, PCIR_MAPS + i * 4, dinfo->cfg.bar[i], 4); pci_write_config(dev, PCIR_BIOS, dinfo->cfg.bios, 4); @@ -1768,8 +1770,10 @@ pci_cfg_save(device_t dev, struct pci_devinfo *dinfo, int setstate) */ cls = pci_get_class(dev); if (setstate && cls != PCIC_DISPLAY && cls != PCIC_MEMORY) { - pci_set_powerstate(dev, PCI_POWERSTATE_D3); - printf("pci%d:%d:%d: setting power state D3\n", dinfo->cfg.bus, - dinfo->cfg.slot, dinfo->cfg.func); + if (pci_get_powerstate(dev) != PCI_POWERSTATE_D3) { + printf("pci%d:%d:%d: setting power state D3\n", dinfo->cfg.bus, + dinfo->cfg.slot, dinfo->cfg.func); + pci_set_powerstate(dev, PCI_POWERSTATE_D3); + } } } |