From ddb81f81c6b53bdfc4bba2ced060724d2beb0270 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Thu, 13 Mar 2014 03:52:57 +0000 Subject: get rid of the assumption that the head of the alldevs list is the "mainbus" device. this breaks when mpath is enabled because it attaches before mainbus and therefore takes the head position. have autoconf provide device_mainbus() which looks up mainbus_cd, and use that instead. discussed with deraadt who just wants mpath stuff to move forward despite there being many ways to shine this particular turd. --- sys/arch/sparc64/sparc64/machdep.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/arch/sparc64') diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index be3d7ca1675..23ff1327fd9 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.149 2013/11/01 17:36:19 krw Exp $ */ +/* $OpenBSD: machdep.c,v 1.150 2014/03/13 03:52:56 dlg Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -610,6 +610,7 @@ boot(howto) { int i; static char str[128]; + struct device *mainbus; /* If system is cold, just halt. */ if (cold) { @@ -655,8 +656,9 @@ boot(howto) haltsys: doshutdownhooks(); - if (!TAILQ_EMPTY(&alldevs)) - config_suspend(TAILQ_FIRST(&alldevs), DVACT_POWERDOWN); + mainbus = device_mainbus(); + if (mainbus != NULL) + config_suspend(mainbus, DVACT_POWERDOWN); /* If powerdown was requested, do it. */ if ((howto & RB_POWERDOWN) == RB_POWERDOWN) { -- cgit v1.2.3