diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-03-01 20:54:34 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-03-01 20:54:34 +0000 |
commit | 77e22ec2d6b7b85248261f7cce9c57a3af0c10ca (patch) | |
tree | 420c02932f1f3ee8b6f83ae43f8ab116322935ce /sys/arch | |
parent | 791e4f4d75b94f69d848fcdec52d04d3e6b490c5 (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.c | 13 |
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)) { |