summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2007-03-01 20:54:33 +0000
committerkettenis <kettenis@openbsd.org>2007-03-01 20:54:33 +0000
commitcb2ccc1681a16ee857cffff862f11ff62ad11f96 (patch)
treecf022e00ae63c3ab2657c88510b44f0313861f67
parentspell address correctly; ok jmc@ henning@ (diff)
downloadwireguard-openbsd-cb2ccc1681a16ee857cffff862f11ff62ad11f96.tar.xz
wireguard-openbsd-cb2ccc1681a16ee857cffff862f11ff62ad11f96.zip
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.
-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)) {