All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] fancontrol aborts after suspend/resume
@ 2014-04-02 10:53 Lubos Lunak
  2014-04-03  7:42 ` Jean Delvare
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Lubos Lunak @ 2014-04-02 10:53 UTC (permalink / raw)
  To: lm-sensors

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]


 Hello,

 if system running fancontrol is suspended and resumed, fancontrol will abort, 
as writing the pwm value will fail because of pwm control being set to 
automatic control after the resume (google for 'fancontrol suspend' for 
various discussions about this). The attached patch fixes the problem.

 I'm not subscribed, so please CC me on any possible replies.

-- 
 Lubos Lunak

[-- Attachment #2: l-resume.patch --]
[-- Type: text/x-diff, Size: 594 bytes --]

--- prog/pwm/fancontrol.sav	2014-04-01 20:06:29.000000000 +0200
+++ prog/pwm/fancontrol	2014-04-02 12:40:52.376746067 +0200
@@ -504,8 +504,14 @@ function UpdateFanSpeeds
 		echo $pwmval > $pwmo # write new value to pwm output
 		if [ $? -ne 0 ]
 		then
-			echo "Error writing PWM value to $DIR/$pwmo" >&2
-			restorefans 1
+			# Try enabling the fan again (may be reset e.g. after a suspend/resume).
+			pwmenable $pwmo
+			echo $pwmval > $pwmo
+			if [ $? -ne 0 ]
+			then
+				echo "Error writing PWM value to $DIR/$pwmo" >&2
+				restorefans 1
+			fi
 		fi
 		if [ "$DEBUG" != "" ]
 		then

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-04-03 15:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-02 10:53 [lm-sensors] [PATCH] fancontrol aborts after suspend/resume Lubos Lunak
2014-04-03  7:42 ` Jean Delvare
2014-04-03 14:31 ` Lubos Lunak
2014-04-03 15:07 ` Guenter Roeck
2014-04-03 15:10 ` Guenter Roeck
2014-04-03 15:25 ` Lubos Lunak
2014-04-03 15:33 ` Guenter Roeck
2014-04-03 15:46 ` Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.