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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 13 Apr 2009 10:43:31 -0700
From:	Joe Perches <joe@...ches.com>
To:	Matthew Garrett <mjg59@...f.ucam.org>
Cc:	Alan Jenkins <alan-jenkins@...fmail.co.uk>,
	yakui_zhao <yakui.zhao@...el.com>,
	Zhang Rui <rui.zhang@...el.com>,
	Alexey Starikovskiy <aystarik@...il.com>,
	"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Kernel Testers List <kernel-testers@...r.kernel.org>
Subject: Re: [BISECTED] 20 ACPI interrupts per second on EEEPC 4G

On Mon, 2009-04-13 at 18:05 +0100, Matthew Garrett wrote:
> Ok, I think I've got it. Does this fix things? Ridiculous thinko...
> 
> diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
> index 9cd15e8..564ea14 100644
> --- a/drivers/acpi/thermal.c
> +++ b/drivers/acpi/thermal.c
> @@ -909,7 +909,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
>  			thermal_zone_device_register("acpitz", trips, tz,
>  						     &acpi_thermal_zone_ops,
>  						     0, 0, 0,
> -						     tz->polling_frequency);
> +						     tz->polling_frequency*100);
>  	if (IS_ERR(tz->thermal_zone))
>  		return -ENODEV;

Perhaps this is clearer?
It also makes cleans up a for loop with a naked ;

Signed-off-by: Joe Perches <joe@...ches.com>

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 9cd15e8..e8a6490 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -883,6 +880,10 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
 	int result;
 	acpi_status status;
 	int i;
+	int tc1;
+	int tc2;
+	int passive_delay;
+	int polling_delay;
 
 	if (tz->trips.critical.flags.valid)
 		trips++;
@@ -894,22 +895,25 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
 		trips++;
 
 	for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
-			tz->trips.active[i].flags.valid; i++, trips++);
+		    tz->trips.active[i].flags.valid; i++)
+		trips++;
 
-	if (tz->trips.passive.flags.valid)
-		tz->thermal_zone =
-			thermal_zone_device_register("acpitz", trips, tz,
-						     &acpi_thermal_zone_ops,
-						     tz->trips.passive.tc1,
-						     tz->trips.passive.tc2,
-						     tz->trips.passive.tsp*100,
-						     tz->polling_frequency*100);
-	else
-		tz->thermal_zone =
-			thermal_zone_device_register("acpitz", trips, tz,
-						     &acpi_thermal_zone_ops,
-						     0, 0, 0,
-						     tz->polling_frequency);
+	if (tz->trips.passive.flags.valid) {
+		tc1 = tz->trips.passive.tc1;
+		tc2 = tz->trips.passive.tc2;
+		passive_delay = tz->trips.passive.tsp * 100;
+	} else {
+		tc1 = 0;
+		tc2 = 0;
+		passive_delay = 0;
+	}
+	polling_delay = tz->polling_frequency * 100;
+
+	tz->thermal_zone =
+		thermal_zone_device_register("acpitz", trips, tz,
+					     &acpi_thermal_zone_ops,
+					     tc1, tc2, passive_delay,
+					     polling_delay);
 	if (IS_ERR(tz->thermal_zone))
 		return -ENODEV;
 


--
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