kernel-testers.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>,
	yakui_zhao <yakui.zhao@intel.com>,
	Zhang Rui <rui.zhang@intel.com>,
	Alexey Starikovskiy <aystarik@gmail.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Kernel Testers List <kernel-testers@vger.kernel.org>
Subject: Re: [BISECTED] 20 ACPI interrupts per second on EEEPC 4G
Date: Mon, 13 Apr 2009 10:43:31 -0700	[thread overview]
Message-ID: <1239644611.32203.37.camel@localhost> (raw)
In-Reply-To: <20090413170531.GA13188@srcf.ucam.org>

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@perches.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;
 



  reply	other threads:[~2009-04-13 17:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-10 15:39 Regression: 20 ACPI interrupts per second on EEEPC 4G Alan Jenkins
     [not found] ` <49DF6835.9040501-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
2009-04-11  0:24   ` Alexey Starikovskiy
2009-04-11  9:14     ` Alan Jenkins
     [not found]       ` <49E05F83.2090500-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
2009-04-12 15:54         ` [BISECTED] " Alan Jenkins
     [not found]           ` <49E20EBA.2090708-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
2009-04-13  2:04             ` yakui_zhao
     [not found]               ` <1239588248.5564.19.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-04-13  9:39                 ` Alan Jenkins
2009-04-13 17:05                   ` Matthew Garrett
2009-04-13 17:43                     ` Joe Perches [this message]
     [not found]                     ` <20090413170531.GA13188-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2009-04-13 18:42                       ` Alan Jenkins
2009-04-14 19:16                         ` [PATCH] thermal: Fix polling frequency for systems without passive cooling Matthew Garrett
     [not found]                           ` <20090414191645.GB7940-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2009-04-17  1:37                             ` Zhang Rui
2009-04-18  5:05                               ` Len Brown
2009-04-13 14:53             ` [BISECTED] 20 ACPI interrupts per second on EEEPC 4G Matthew Garrett
2009-04-13  2:06           ` Zhang Rui
2009-04-17 20:54           ` Alexey Starikovskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1239644611.32203.37.camel@localhost \
    --to=joe@perches.com \
    --cc=alan-jenkins@tuffmail.co.uk \
    --cc=aystarik@gmail.com \
    --cc=kernel-testers@vger.kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=rui.zhang@intel.com \
    --cc=yakui.zhao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).