For DVACT_RESUME, let the children know we are ready *after* calling
authorderaadt <deraadt@openbsd.org>
Sun, 18 Aug 2024 15:03:01 +0000 (15:03 +0000)
committerderaadt <deraadt@openbsd.org>
Sun, 18 Aug 2024 15:03:01 +0000 (15:03 +0000)
our own wakeup().  The wakeup() won't result in anything running now
because DVACT_RESUME is running in "cold !=0, interrupts blocked,
scheduler stopped", but it is idiomatically incorrect to inform your
children you are ready before you are ready.

sys/dev/sdmmc/sdmmc.c

index 7950050..348261e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sdmmc.c,v 1.61 2023/04/19 02:01:02 dlg Exp $  */
+/*     $OpenBSD: sdmmc.c,v 1.62 2024/08/18 15:03:01 deraadt Exp $      */
 
 /*
  * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -202,8 +202,8 @@ sdmmc_activate(struct device *self, int act)
                        sc->sc_dying = -1;
                break;
        case DVACT_RESUME:
-               rv = config_activate_children(self, act);
                wakeup(&sc->sc_tskq);
+               rv = config_activate_children(self, act);
                break;
        default:
                rv = config_activate_children(self, act);