git: 721b91d1715e - stable/14 - syscon_power: do reboot after shutdown_panic is executed

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Sat, 16 Mar 2024 15:16:16 UTC
The branch stable/14 has been updated by avg:

URL: https://cgit.FreeBSD.org/src/commit/?id=721b91d1715e3844b0372a2fc42c70853b91fa46

commit 721b91d1715e3844b0372a2fc42c70853b91fa46
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2021-07-09 15:00:21 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2024-03-16 15:14:09 +0000

    syscon_power: do reboot after shutdown_panic is executed
    
    A syscon_power instance can handle either poweroff or reboot, but not
    both.  If the instance handles reboot then set its priority to be after
    shutdown_panic.
    
    This is to provide uniform experience with other platforms.
    
    (cherry picked from commit 5f7312a0d70c607afa9ce24ccd757321d043e02c)
---
 sys/dev/extres/syscon/syscon_power.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/dev/extres/syscon/syscon_power.c b/sys/dev/extres/syscon/syscon_power.c
index 9626adb52890..201d140963d2 100644
--- a/sys/dev/extres/syscon/syscon_power.c
+++ b/sys/dev/extres/syscon/syscon_power.c
@@ -162,9 +162,11 @@ syscon_power_attach(device_t dev)
 		OF_getencprop(node, "value", &sc->value, sizeof(sc->value));
 	}
 
+	/* Handle reboot after shutdown_panic. */
 	sc->reboot = ofw_bus_is_compatible(dev, "syscon-reboot");
 	sc->shutdown_tag = EVENTHANDLER_REGISTER(shutdown_final,
-	    syscon_power_shutdown_final, dev, SHUTDOWN_PRI_LAST);
+	    syscon_power_shutdown_final, dev,
+	    sc->reboot ? SHUTDOWN_PRI_LAST + 150 : SHUTDOWN_PRI_LAST);
 
 	return (0);
 }