summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-03-01 20:54:34 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-03-01 20:54:34 +0000
commit77e22ec2d6b7b85248261f7cce9c57a3af0c10ca (patch)
tree420c02932f1f3ee8b6f83ae43f8ab116322935ce /sys/arch
parent791e4f4d75b94f69d848fcdec52d04d3e6b490c5 (diff)
Don't attach sensors and iic(4) if we didn't find any fans.
Tickling the SMU when we don't set the fans running is bad since this prevents the fans to spin up automatically causing the machine to overheat.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/macppc/dev/smu.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/arch/macppc/dev/smu.c b/sys/arch/macppc/dev/smu.c
index 359ddfafa74..268d2148053 100644
--- a/sys/arch/macppc/dev/smu.c
+++ b/sys/arch/macppc/dev/smu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smu.c,v 1.13 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: smu.c,v 1.14 2007/03/01 20:54:33 kettenis Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -294,6 +294,17 @@ smu_attach(struct device *parent, struct device *self, void *aux)
sensor_attach(&sc->sc_sensordev, &fan->sensor);
}
+ /*
+ * Bail out if we didn't find any fans. If we don't set the
+ * fans to a safe speed, but tickle the SMU periodically by
+ * reading sensors, the fans will never spin up and the
+ * machine might overheat.
+ */
+ if (sc->sc_num_fans == 0) {
+ printf(": no fans\n");
+ return;
+ }
+
/* Sensors */
node = OF_getnodebyname(ca->ca_node, "sensors");
for (node = OF_child(node); node; node = OF_peer(node)) {