the default pciide chip needs no additional register restores; tested by jcs on one...
authorderaadt <deraadt@openbsd.org>
Wed, 28 Jul 2010 18:31:51 +0000 (18:31 +0000)
committerderaadt <deraadt@openbsd.org>
Wed, 28 Jul 2010 18:31:51 +0000 (18:31 +0000)
sys/dev/pci/pciide.c

index 0393508..1205508 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pciide.c,v 1.312 2010/07/28 15:50:19 deraadt Exp $    */
+/*     $OpenBSD: pciide.c,v 1.313 2010/07/28 18:31:51 deraadt Exp $    */
 /*     $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $     */
 
 /*
@@ -1439,7 +1439,9 @@ pciide_activate(struct device *self, int act)
                            PCI_MAPREG_END + 0x18 + (i * 4),
                            sc->sc_save[i]);
 
-               if (sc->sc_pp->chip_map == sch_chip_map) {
+               if (sc->sc_pp->chip_map == default_chip_map) {
+                       /* nothing more to restore */
+               } else if (sc->sc_pp->chip_map == sch_chip_map) {
                        pci_conf_write(sc->sc_pc, sc->sc_tag,
                            SCH_D0TIM, sc->sc_save2[0]);
                        pci_conf_write(sc->sc_pc, sc->sc_tag,