lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <53D95AB1.70300@inwind.it>
Date:	Wed, 30 Jul 2014 22:50:57 +0200
From:	Goffredo Baroncelli <kreijack@...ind.it>
To:	Jean Delvare <jdelvare@...e.de>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>
CC:	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 3/3] therm_windtunnel doesn't work properly on PowerMac G4

Add the "log_temp" and "verbose" module parameters.
    
log_temp    enable/disable the temperature logging
verbose     enable/disable the fan tune logging

Signed-off-by: Goffredo Baroncelli <kreijack@...ind.it>

---
 drivers/macintosh/therm_windtunnel.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
index fbe4516..7efba5d 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -44,7 +44,13 @@
 #include <asm/sections.h>
 #include <asm/macio.h>
 
-#define LOG_TEMP		0			/* continuously log temperature */
+static bool log_temp = 0;
+module_param(log_temp, bool, 0644);
+MODULE_PARM_DESC(log_temp, "Enable the temperature logging");
+
+static bool verbose = 1;
+module_param(verbose, bool, 0644);
+MODULE_PARM_DESC(verbose, "Enable the fan speed logging");
 
 static struct {
 	volatile int		running;
@@ -157,11 +163,12 @@ tune_fan( int fan_setting )
 	/* write_reg( x.fan, 0x24, val, 1 ); */
 	write_reg( x.fan, 0x25, val, 1 );
 	write_reg( x.fan, 0x20, 0, 1 );
-	print_temp("CPU-temp: ", x.temp );
-	if( x.casetemp )
+	if (verbose) {
+		print_temp("CPU-temp: ", x.temp );
 		print_temp(", Case: ", x.casetemp );
-	printk(",  Fan: %d (tuned %+d)\n", 11-fan_setting, x.fan_level-fan_setting );
-
+		printk(",  Fan: %d (tuned %+d)\n",
+			11-fan_setting, x.fan_level-fan_setting );
+	}
 	x.fan_level = fan_setting;
 }
 
@@ -179,7 +186,7 @@ poll_temp( void )
 	casetemp = read_reg(x.fan, 0x0b, 1) << 8;
 	casetemp |= (read_reg(x.fan, 0x06, 1) & 0x7) << 5;
 
-	if( LOG_TEMP && x.temp != temp ) {
+	if( log_temp && x.temp != temp ) {
 		print_temp("CPU-temp: ", temp );
 		print_temp(", Case: ", casetemp );
 		printk(",  Fan: %d\n", 11-x.fan_level );
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ