Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 May 2011 21:54:19 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222430 - head/sys/powerpc/powermac
Message-ID:  <201105282154.p4SLsJoR002019@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sat May 28 21:54:18 2011
New Revision: 222430
URL: http://svn.freebsd.org/changeset/base/222430

Log:
  Require an error instead of a timeout to decide the new-style fan
  commands won't work. This prevents a busy system from making smu(4)
  suddenly decide its fans use the old-style command set.
  
  MFC after:	3 days

Modified:
  head/sys/powerpc/powermac/smu.c

Modified: head/sys/powerpc/powermac/smu.c
==============================================================================
--- head/sys/powerpc/powermac/smu.c	Sat May 28 21:13:22 2011	(r222429)
+++ head/sys/powerpc/powermac/smu.c	Sat May 28 21:54:18 2011	(r222430)
@@ -662,7 +662,7 @@ smu_fan_set_rpm(struct smu_fan *fan, int
 		cmd.data[3] = rpm & 0xff;
 	
 		error = smu_run_cmd(smu, &cmd, 1);
-		if (error)
+		if (error && error != EWOULDBLOCK)
 			fan->old_style = 1;
 	}
 
@@ -695,7 +695,7 @@ smu_fan_read_rpm(struct smu_fan *fan)
 		cmd.data[1] = fan->reg;
 
 		error = smu_run_cmd(smu, &cmd, 1);
-		if (error)
+		if (error && error != EWOULDBLOCK)
 			fan->old_style = 1;
 
 		rpm = (cmd.data[0] << 8) | cmd.data[1];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105282154.p4SLsJoR002019>