All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Zhao Yakui <yakui.zhao@intel.com>, Linus Torvalds <torvalds@osdl.org>
Cc: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Lukas Hejtmanek <xhejtman@ics.muni.cz>,
	"Li, Shaohua" <shaohua.li@intel.com>,
	linux-kernel@vger.kernel.org,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Alexey Starikovskiy <astarikovskiy@suse.de>
Subject: Re: ACPI related Warning in 2.6.24-rc3-git2
Date: Sun, 2 Dec 2007 01:34:13 -0500	[thread overview]
Message-ID: <200712020134.14573.lenb@kernel.org> (raw)
In-Reply-To: <1196324563.4062.15.camel@yakui_zhao.sh.intel.com>

Applied to ACPI tree.

Linus,
I reproduced this issue on my T61, and saw it go away w/ this patch.
I'll be sending you a pull request probably Sunday night w/ this
pach in it.  But if you are in a hurry to cut rc4 before then,
consider this an Acked-by: Len Brown <len.brown@intel.com>

thanks,
-Len

On Thursday 29 November 2007 03:22, Zhao Yakui wrote:
> Subject: ACPI : Delete the IRQ operation in throttling controll via PTC
> >From : Zhao Yakui <yakui.zhao@intel.com>
> 
> The IRQ operation(enable/disable) should be avoided when throttling is
> controlled via PTC method. It is replaced by the migration of task. 
> 
> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
> 
> ---
>  drivers/acpi/processor_throttling.c |   36
> ++++++++++++++++++++++++++++--------
>  1 file changed, 28 insertions(+), 8 deletions(-)
> 
> Index: linux-2.6.24-rc3-git3/drivers/acpi/processor_throttling.c
> ===================================================================
> --- linux-2.6.24-rc3-git3.orig/drivers/acpi/processor_throttling.c
> +++ linux-2.6.24-rc3-git3/drivers/acpi/processor_throttling.c
> @@ -29,6 +29,7 @@
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/init.h>
> +#include <linux/sched.h>
>  #include <linux/cpufreq.h>
>  #include <linux/proc_fs.h>
>  #include <linux/seq_file.h>
> @@ -413,7 +414,7 @@ static int acpi_throttling_rdmsr(struct 
>  	} else {
>  		msr_low = 0;
>  		msr_high = 0;
> -		rdmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL,
> +		rdmsr_safe(MSR_IA32_THERM_CONTROL,
>  			(u32 *)&msr_low , (u32 *) &msr_high);
>  		msr = (msr_high << 32) | msr_low;
>  		*value = (acpi_integer) msr;
> @@ -438,7 +439,7 @@ static int acpi_throttling_wrmsr(struct 
>  			"HARDWARE addr space,NOT supported yet\n");
>  	} else {
>  		msr = value;
> -		wrmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL,
> +		wrmsr_safe(MSR_IA32_THERM_CONTROL,
>  			msr & 0xffffffff, msr >> 32);
>  		ret = 0;
>  	}
> @@ -572,21 +573,32 @@ static int acpi_processor_get_throttling
>  		return -ENODEV;
>  
>  	pr->throttling.state = 0;
> -	local_irq_disable();
> +
>  	value = 0;
>  	ret = acpi_read_throttling_status(pr, &value);
>  	if (ret >= 0) {
>  		state = acpi_get_throttling_state(pr, value);
>  		pr->throttling.state = state;
>  	}
> -	local_irq_enable();
>  
>  	return 0;
>  }
>  
>  static int acpi_processor_get_throttling(struct acpi_processor *pr)
>  {
> -	return pr->throttling.acpi_processor_get_throttling(pr);
> +	cpumask_t saved_mask;
> +	int ret;
> +
> +	/*
> +	 * Migrate task to the cpu pointed by pr.
> +	 */
> +	saved_mask = current->cpus_allowed;
> +	set_cpus_allowed(current, cpumask_of_cpu(pr->id));
> +	ret = pr->throttling.acpi_processor_get_throttling(pr);
> +	/* restore the previous state */
> +	set_cpus_allowed(current, saved_mask);
> +
> +	return ret;
>  }
>  
>  static int acpi_processor_get_fadt_info(struct acpi_processor *pr)
> @@ -717,21 +729,29 @@ static int acpi_processor_set_throttling
>  	if (state < pr->throttling_platform_limit)
>  		return -EPERM;
>  
> -	local_irq_disable();
>  	value = 0;
>  	ret = acpi_get_throttling_value(pr, state, &value);
>  	if (ret >= 0) {
>  		acpi_write_throttling_state(pr, value);
>  		pr->throttling.state = state;
>  	}
> -	local_irq_enable();
>  
>  	return 0;
>  }
>  
>  int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
>  {
> -	return pr->throttling.acpi_processor_set_throttling(pr, state);
> +	cpumask_t saved_mask;
> +	int ret;
> +	/*
> +	 * Migrate task to the cpu pointed by pr.
> +	 */
> +	saved_mask = current->cpus_allowed;
> +	set_cpus_allowed(current, cpumask_of_cpu(pr->id));
> +	ret = pr->throttling.acpi_processor_set_throttling(pr, state);
> +	/* restore the previous state */
> +	set_cpus_allowed(current, saved_mask);
> +	return ret;
>  }
>  
>  int acpi_processor_get_throttling_info(struct acpi_processor *pr)
> 
> On Wed, 2007-11-28 at 14:42 +0800, Pallipadi, Venkatesh wrote:
> > Yakui,
> > 
> > Can you look at this. Seems to be coming from commit f79f06ab9f86
> > FixedHW support tries to read MSR with interrupts disabled.
> > 
> > Thanks,
> > Venki 
> > 
> > >-----Original Message-----
> > >From: linux-kernel-owner@vger.kernel.org 
> > >[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of 
> > >Rafael J. Wysocki
> > >Sent: Tuesday, November 27, 2007 7:37 AM
> > >To: Lukas Hejtmanek
> > >Cc: linux-kernel@vger.kernel.org; ACPI Devel Maling List; Len 
> > >Brown; Alexey Starikovskiy
> > >Subject: Re: ACPI related Warning in 2.6.24-rc3-git2
> > >
> > >On Tuesday, 27 of November 2007, Lukas Hejtmanek wrote:
> > >> Hello,
> > >> 
> > >> in recent kernel, I got the following warnings while 
> > >booting. It's ACPI
> > >> related. Does anybode care? Lenovo ThinkPad T61 (6465CTO).
> > >
> > >Appropriate Ccs added.
> > >
> > >Did it happen before?
> > >
> > >> [   13.114814] Pid: 1, comm: swapper Not tainted 2.6.24-rc3-git2 #3
> > >> [   13.114885] 
> > >> [   13.114885] Call Trace:
> > >> [   13.115020]  [<ffffffff80357ab6>] 
> > >acpi_ut_update_ref_count+0x50/0x9d
> > >> [   13.115095]  [<ffffffff8021e7ad>] 
> > >smp_call_function_single+0xbd/0xd0
> > >> [   13.115169]  [<ffffffff80331dbc>] _rdmsr_on_cpu+0x5c/0x60
> > >> [   13.115241]  [<ffffffff803631c7>]
> > >> acpi_processor_get_throttling_ptc+0xf3/0x158
> > >> [   13.115323]  [<ffffffff80362f04>]
> > >> acpi_processor_get_throttling_info+0x460/0x4af
> > >> [   13.115406]  [<ffffffff80362264>] acpi_processor_start+0x54a/0x606
> > >> [   13.115478]  [<ffffffff802abc38>] ifind+0x48/0xd0
> > >> [   13.115550]  [<ffffffff8035a31e>] 
> > >acpi_start_single_object+0x24/0x46
> > >> [   13.115622]  [<ffffffff8035b716>] acpi_device_probe+0x7d/0x91
> > >> [   13.115694]  [<ffffffff8038effc>] driver_probe_device+0x9c/0x1b0
> > >> [   13.115766]  [<ffffffff8038f2c9>] __driver_attach+0xc9/0xd0
> > >> [   13.115840]  [<ffffffff8038f200>] __driver_attach+0x0/0xd0
> > >> [   13.115924]  [<ffffffff8038e1dd>] bus_for_each_dev+0x4d/0x80
> > >> [   13.115994]  [<ffffffff8038e64c>] bus_add_driver+0xac/0x220
> > >> [   13.116080]  [<ffffffff8064dd7c>] acpi_processor_init+0x8f/0xfc
> > >> [   13.116153]  [<ffffffff806386f4>] kernel_init+0x154/0x330
> > >> [   13.116225]  [<ffffffff8020d178>] child_rip+0xa/0x12
> > >> [   13.116295]  [<ffffffff806385a0>] kernel_init+0x0/0x330
> > >> [   13.116365]  [<ffffffff8020d16e>] child_rip+0x0/0x12
> > >> [   13.116435] 
> > >> [   13.116504] WARNING: at arch/x86/kernel/smp_64.c:397
> > >> smp_call_function_mask()
> > >> [   13.116577] Pid: 1, comm: swapper Not tainted 2.6.24-rc3-git2 #3
> > >> [   13.116648] 
> > >> [   13.116648] Call Trace:
> > >> [   13.116779]  [<ffffffff80357ab6>] 
> > >acpi_ut_update_ref_count+0x50/0x9d
> > >> [   13.116851]  [<ffffffff8021e4af>] smp_call_function_mask+0x8f/0xa0
> > >> [   13.116923]  [<ffffffff80331dbc>] _rdmsr_on_cpu+0x5c/0x60
> > >> [   13.116994]  [<ffffffff803631c7>]
> > >> acpi_processor_get_throttling_ptc+0xf3/0x158
> > >> [   13.117077]  [<ffffffff80362f04>]
> > >> acpi_processor_get_throttling_info+0x460/0x4af
> > >> [   13.117169]  [<ffffffff80362264>] acpi_processor_start+0x54a/0x606
> > >> [   13.117248]  [<ffffffff802abc38>] ifind+0x48/0xd0
> > >> [   13.117330]  [<ffffffff8035a31e>] 
> > >acpi_start_single_object+0x24/0x46
> > >> [   13.117402]  [<ffffffff8035b716>] acpi_device_probe+0x7d/0x91
> > >> [   13.117488]  [<ffffffff8038effc>] driver_probe_device+0x9c/0x1b0
> > >> [   13.117559]  [<ffffffff8038f2c9>] __driver_attach+0xc9/0xd0
> > >> [   13.117631]  [<ffffffff8038f200>] __driver_attach+0x0/0xd0
> > >> [   13.117715]  [<ffffffff8038e1dd>] bus_for_each_dev+0x4d/0x80
> > >> [   13.117786]  [<ffffffff8038e64c>] bus_add_driver+0xac/0x220
> > >> [   13.117856]  [<ffffffff8064dd7c>] acpi_processor_init+0x8f/0xfc
> > >> [   13.117941]  [<ffffffff806386f4>] kernel_init+0x154/0x330
> > >> [   13.118018]  [<ffffffff8020d178>] child_rip+0xa/0x12
> > >> [   13.118088]  [<ffffffff806385a0>] kernel_init+0x0/0x330
> > >> [   13.118158]  [<ffffffff8020d16e>] child_rip+0x0/0x12
> > >> [   13.118227] 
> > >> [...]
> > >> [   13.124714] WARNING: at arch/x86/kernel/smp_64.c:427
> > >> smp_call_function_single()
> > >> [   13.124798] Pid: 1, comm: swapper Not tainted 2.6.24-rc3-git2 #3
> > >> [   13.125460] 
> > >> [   13.125461] Call Trace:
> > >> [   13.125592]  [<ffffffff80357ab6>] 
> > >acpi_ut_update_ref_count+0x50/0x9d
> > >> [   13.125665]  [<ffffffff8021e7ad>] 
> > >smp_call_function_single+0xbd/0xd0
> > >> [   13.125737]  [<ffffffff80331dbc>] _rdmsr_on_cpu+0x5c/0x60
> > >> [   13.125807]  [<ffffffff803631c7>]
> > >> acpi_processor_get_throttling_ptc+0xf3/0x158
> > >> [   13.125903]  [<ffffffff80362f04>]
> > >> acpi_processor_get_throttling_info+0x460/0x4af
> > >> [   13.125999]  [<ffffffff80362264>] acpi_processor_start+0x54a/0x606
> > >> [   13.126071]  [<ffffffff803625ed>] acpi_processor_add+0x24/0x6b
> > >> [   13.126142]  [<ffffffff8035a31e>] 
> > >acpi_start_single_object+0x24/0x46
> > >> [   13.126214]  [<ffffffff8035b716>] acpi_device_probe+0x7d/0x91
> > >> [   13.126285]  [<ffffffff8038effc>] driver_probe_device+0x9c/0x1b0
> > >> [   13.126357]  [<ffffffff8038f2c9>] __driver_attach+0xc9/0xd0
> > >> [   13.126441]  [<ffffffff8038f200>] __driver_attach+0x0/0xd0
> > >> [   13.126518]  [<ffffffff8038e1dd>] bus_for_each_dev+0x4d/0x80
> > >> [   13.126600]  [<ffffffff8038e64c>] bus_add_driver+0xac/0x220
> > >> [   13.126670]  [<ffffffff8064dd7c>] acpi_processor_init+0x8f/0xfc
> > >> [   13.126755]  [<ffffffff806386f4>] kernel_init+0x154/0x330
> > >> [   13.126832]  [<ffffffff8020d178>] child_rip+0xa/0x12
> > >> [   13.126916]  [<ffffffff806385a0>] kernel_init+0x0/0x330
> > >> [   13.126986]  [<ffffffff8020d16e>] child_rip+0x0/0x12
> > >> [   13.127059] 
> > >> [   13.127124] WARNING: at arch/x86/kernel/smp_64.c:397
> > >> smp_call_function_mask()
> > >> [   13.127197] Pid: 1, comm: swapper Not tainted 2.6.24-rc3-git2 #3
> > >> [   13.127267] 
> > >> [   13.127268] Call Trace:
> > >> [   13.127398]  [<ffffffff80357ab6>] 
> > >acpi_ut_update_ref_count+0x50/0x9d
> > >> [   13.127473]  [<ffffffff8021e4af>] smp_call_function_mask+0x8f/0xa0
> > >> [   13.127545]  [<ffffffff80331dbc>] _rdmsr_on_cpu+0x5c/0x60
> > >> [   13.127616]  [<ffffffff803631c7>]
> > >> acpi_processor_get_throttling_ptc+0xf3/0x158
> > >> [   13.127699]  [<ffffffff80362f04>]
> > >> acpi_processor_get_throttling_info+0x460/0x4af
> > >> [   13.127782]  [<ffffffff80362264>] acpi_processor_start+0x54a/0x606
> > >> [   13.127861]  [<ffffffff803625ed>] acpi_processor_add+0x24/0x6b
> > >> [   13.127933]  [<ffffffff8035a31e>] 
> > >acpi_start_single_object+0x24/0x46
> > >> [   13.128005]  [<ffffffff8035b716>] acpi_device_probe+0x7d/0x91
> > >> [   13.128076]  [<ffffffff8038effc>] driver_probe_device+0x9c/0x1b0
> > >> [   13.128147]  [<ffffffff8038f2c9>] __driver_attach+0xc9/0xd0
> > >> [   13.128226]  [<ffffffff8038f200>] __driver_attach+0x0/0xd0
> > >> [   13.128310]  [<ffffffff8038e1dd>] bus_for_each_dev+0x4d/0x80
> > >> [   13.128381]  [<ffffffff8038e64c>] bus_add_driver+0xac/0x220
> > >> [   13.128452]  [<ffffffff8064dd7c>] acpi_processor_init+0x8f/0xfc
> > >> [   13.128523]  [<ffffffff806386f4>] kernel_init+0x154/0x330
> > >> [   13.128594]  [<ffffffff8020d178>] child_rip+0xa/0x12
> > >> [   13.128664]  [<ffffffff806385a0>] kernel_init+0x0/0x330
> > >> [   13.128734]  [<ffffffff8020d16e>] child_rip+0x0/0x12
> > >> 
> > >> 
> > >
> > >
> > >
> > >-- 
> > >"Premature optimization is the root of all evil." - Donald Knuth
> > >-
> > >To unsubscribe from this list: send the line "unsubscribe 
> > >linux-kernel" in
> > >the body of a message to majordomo@vger.kernel.org
> > >More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > >Please read the FAQ at  http://www.tux.org/lkml/
> > >
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

      parent reply	other threads:[~2007-12-02  6:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-27 15:05 ACPI related Warning in 2.6.24-rc3-git2 Lukas Hejtmanek
2007-11-27 15:37 ` Rafael J. Wysocki
2007-11-27 15:54   ` Lukas Hejtmanek
2007-11-28  4:11   ` Henrique de Moraes Holschuh
2007-11-28  8:31     ` Lukas Hejtmanek
2007-11-28  8:31       ` Lukas Hejtmanek
2007-11-28 13:55       ` Paul Erkkila
2007-11-28 15:27         ` Jens Axboe
2007-11-28 15:46           ` Paul Erkkila
2007-12-14  2:41       ` Len Brown
2007-12-14  6:57         ` Lukas Hejtmanek
2007-12-14  6:57           ` Lukas Hejtmanek
2007-11-28  6:42   ` Pallipadi, Venkatesh
2007-11-28  6:42     ` Pallipadi, Venkatesh
2007-11-29  8:22     ` Zhao Yakui
2007-11-29 22:07       ` Lukas Hejtmanek
2007-11-29 22:07         ` Lukas Hejtmanek
2007-12-02  6:34       ` Len Brown [this message]

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=200712020134.14573.lenb@kernel.org \
    --to=lenb@kernel.org \
    --cc=astarikovskiy@suse.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=shaohua.li@intel.com \
    --cc=torvalds@osdl.org \
    --cc=venkatesh.pallipadi@intel.com \
    --cc=xhejtman@ics.muni.cz \
    --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 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.