summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-01-29 21:17:50 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-01-29 21:17:50 +0000
commitffd9e167097620bb10be8a6bf0e276b6708e3514 (patch)
treeb351dc85d92f2cb513f80dec7039e93c922d5f6e /sys/arch
parentafb9e399b5e2bf147190866db7fe30cbff076226 (diff)
Some of the latest macppc laptops with no adb subsystem at all, spontaneously
powerdown if we try to issue pmu commands. Skip these if no adb device appears in the device tree. Adapted from NetBSD.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/macppc/dev/adb.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/sys/arch/macppc/dev/adb.c b/sys/arch/macppc/dev/adb.c
index 600f1cbe462..c0abe9406e8 100644
--- a/sys/arch/macppc/dev/adb.c
+++ b/sys/arch/macppc/dev/adb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adb.c,v 1.27 2007/04/23 16:27:20 deraadt Exp $ */
+/* $OpenBSD: adb.c,v 1.28 2009/01/29 21:17:49 miod Exp $ */
/* $NetBSD: adb.c,v 1.6 1999/08/16 06:28:09 tsubai Exp $ */
/* $NetBSD: adb_direct.c,v 1.14 2000/06/08 22:10:45 tsubai Exp $ */
@@ -1665,7 +1665,8 @@ adbattach(struct device *parent, struct device *self, void *aux)
}
adb_polling = 1;
- adb_reinit();
+ if (!adbempty)
+ adb_reinit();
mac_intr_establish(parent, ca->ca_intr[0], IST_LEVEL, IPL_HIGH,
adb_intr, sc, sc->sc_dev.dv_xname);
@@ -1678,7 +1679,10 @@ adbattach(struct device *parent, struct device *self, void *aux)
if (adb_debug)
printf("adb: done with adb_reinit\n");
#endif
- totaladbs = count_adbs();
+ if (adbempty)
+ totaladbs = 0;
+ else
+ totaladbs = count_adbs();
printf(" irq %d: %s, %d target%s\n", ca->ca_intr[0], ca->ca_name,
totaladbs, (totaladbs == 1) ? "" : "s");
@@ -1715,12 +1719,14 @@ adbattach(struct device *parent, struct device *self, void *aux)
}
}
- if (adbHardware == ADB_HW_CUDA)
- adb_cuda_fileserver_mode();
- if (adbHardware == ADB_HW_PMU)
- pmu_fileserver_mode(1);
+ if (!adbempty) {
+ if (adbHardware == ADB_HW_CUDA)
+ adb_cuda_fileserver_mode();
+ if (adbHardware == ADB_HW_PMU)
+ pmu_fileserver_mode(1);
- if (adbHardware == ADB_HW_CUDA)
- adb_cuda_autopoll();
- adb_polling = 0;
+ if (adbHardware == ADB_HW_CUDA)
+ adb_cuda_autopoll();
+ adb_polling = 0;
+ }
}