there are azalia that will fail to attach. in the activate function for
authorderaadt <deraadt@openbsd.org>
Sun, 18 Aug 2024 14:35:14 +0000 (14:35 +0000)
committerderaadt <deraadt@openbsd.org>
Sun, 18 Aug 2024 14:35:14 +0000 (14:35 +0000)
DVACT_QUIESCE, this was handled by doing nothing.  however, the other
DVACT methods were still trying to touch the device.  This needs to
bail out earlier.
ok ratchov

sys/dev/pci/azalia.c

index 97bd1de..c1731e5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: azalia.c,v 1.288 2024/08/13 22:32:58 deraadt Exp $    */
+/*     $OpenBSD: azalia.c,v 1.289 2024/08/18 14:35:14 deraadt Exp $    */
 /*     $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
 
 /*-
@@ -598,13 +598,12 @@ azalia_pci_activate(struct device *self, int act)
        azalia_t *sc = (azalia_t*)self;
        int rv = 0; 
 
+       if (sc->detached)
+               return (0);
+
        switch (act) {
        case DVACT_QUIESCE:
                rv = config_activate_children(self, act);
-
-               if (sc->detached)
-                       break;
-       
                /* stop interrupts and clear status registers */
                AZ_WRITE_4(sc, INTCTL, 0);
                AZ_WRITE_2(sc, STATESTS, HDA_STATESTS_SDIWAKE);