Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758020AbXK2ILV (ORCPT ); Thu, 29 Nov 2007 03:11:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752678AbXK2ILJ (ORCPT ); Thu, 29 Nov 2007 03:11:09 -0500 Received: from mga11.intel.com ([192.55.52.93]:2457 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752722AbXK2ILH (ORCPT ); Thu, 29 Nov 2007 03:11:07 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.23,228,1194249600"; d="scan'208";a="407445758" Subject: RE: ACPI related Warning in 2.6.24-rc3-git2 From: Zhao Yakui To: "Pallipadi, Venkatesh" Cc: "Rafael J. Wysocki" , Lukas Hejtmanek , "Li, Shaohua" , linux-kernel@vger.kernel.org, ACPI Devel Maling List , Len Brown , Alexey Starikovskiy In-Reply-To: <924EFEDD5F540B4284297C4DC59F3DEE2B3AD7@orsmsx423.amr.corp.intel.com> References: <20071127150557.GA4365@ics.muni.cz> <200711271637.13036.rjw@sisk.pl> <924EFEDD5F540B4284297C4DC59F3DEE2B3AD7@orsmsx423.amr.corp.intel.com> Content-Type: text/plain Date: Thu, 29 Nov 2007 16:22:43 +0800 Message-Id: <1196324563.4062.15.camel@yakui_zhao.sh.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.8.0 (2.8.0-7.fc6) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 11109 Lines: 278 Subject: ACPI : Delete the IRQ operation in throttling controll via PTC >From : Zhao Yakui 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 --- 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 #include #include +#include #include #include #include @@ -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] [] > >acpi_ut_update_ref_count+0x50/0x9d > >> [ 13.115095] [] > >smp_call_function_single+0xbd/0xd0 > >> [ 13.115169] [] _rdmsr_on_cpu+0x5c/0x60 > >> [ 13.115241] [] > >> acpi_processor_get_throttling_ptc+0xf3/0x158 > >> [ 13.115323] [] > >> acpi_processor_get_throttling_info+0x460/0x4af > >> [ 13.115406] [] acpi_processor_start+0x54a/0x606 > >> [ 13.115478] [] ifind+0x48/0xd0 > >> [ 13.115550] [] > >acpi_start_single_object+0x24/0x46 > >> [ 13.115622] [] acpi_device_probe+0x7d/0x91 > >> [ 13.115694] [] driver_probe_device+0x9c/0x1b0 > >> [ 13.115766] [] __driver_attach+0xc9/0xd0 > >> [ 13.115840] [] __driver_attach+0x0/0xd0 > >> [ 13.115924] [] bus_for_each_dev+0x4d/0x80 > >> [ 13.115994] [] bus_add_driver+0xac/0x220 > >> [ 13.116080] [] acpi_processor_init+0x8f/0xfc > >> [ 13.116153] [] kernel_init+0x154/0x330 > >> [ 13.116225] [] child_rip+0xa/0x12 > >> [ 13.116295] [] kernel_init+0x0/0x330 > >> [ 13.116365] [] 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] [] > >acpi_ut_update_ref_count+0x50/0x9d > >> [ 13.116851] [] smp_call_function_mask+0x8f/0xa0 > >> [ 13.116923] [] _rdmsr_on_cpu+0x5c/0x60 > >> [ 13.116994] [] > >> acpi_processor_get_throttling_ptc+0xf3/0x158 > >> [ 13.117077] [] > >> acpi_processor_get_throttling_info+0x460/0x4af > >> [ 13.117169] [] acpi_processor_start+0x54a/0x606 > >> [ 13.117248] [] ifind+0x48/0xd0 > >> [ 13.117330] [] > >acpi_start_single_object+0x24/0x46 > >> [ 13.117402] [] acpi_device_probe+0x7d/0x91 > >> [ 13.117488] [] driver_probe_device+0x9c/0x1b0 > >> [ 13.117559] [] __driver_attach+0xc9/0xd0 > >> [ 13.117631] [] __driver_attach+0x0/0xd0 > >> [ 13.117715] [] bus_for_each_dev+0x4d/0x80 > >> [ 13.117786] [] bus_add_driver+0xac/0x220 > >> [ 13.117856] [] acpi_processor_init+0x8f/0xfc > >> [ 13.117941] [] kernel_init+0x154/0x330 > >> [ 13.118018] [] child_rip+0xa/0x12 > >> [ 13.118088] [] kernel_init+0x0/0x330 > >> [ 13.118158] [] 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] [] > >acpi_ut_update_ref_count+0x50/0x9d > >> [ 13.125665] [] > >smp_call_function_single+0xbd/0xd0 > >> [ 13.125737] [] _rdmsr_on_cpu+0x5c/0x60 > >> [ 13.125807] [] > >> acpi_processor_get_throttling_ptc+0xf3/0x158 > >> [ 13.125903] [] > >> acpi_processor_get_throttling_info+0x460/0x4af > >> [ 13.125999] [] acpi_processor_start+0x54a/0x606 > >> [ 13.126071] [] acpi_processor_add+0x24/0x6b > >> [ 13.126142] [] > >acpi_start_single_object+0x24/0x46 > >> [ 13.126214] [] acpi_device_probe+0x7d/0x91 > >> [ 13.126285] [] driver_probe_device+0x9c/0x1b0 > >> [ 13.126357] [] __driver_attach+0xc9/0xd0 > >> [ 13.126441] [] __driver_attach+0x0/0xd0 > >> [ 13.126518] [] bus_for_each_dev+0x4d/0x80 > >> [ 13.126600] [] bus_add_driver+0xac/0x220 > >> [ 13.126670] [] acpi_processor_init+0x8f/0xfc > >> [ 13.126755] [] kernel_init+0x154/0x330 > >> [ 13.126832] [] child_rip+0xa/0x12 > >> [ 13.126916] [] kernel_init+0x0/0x330 > >> [ 13.126986] [] 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] [] > >acpi_ut_update_ref_count+0x50/0x9d > >> [ 13.127473] [] smp_call_function_mask+0x8f/0xa0 > >> [ 13.127545] [] _rdmsr_on_cpu+0x5c/0x60 > >> [ 13.127616] [] > >> acpi_processor_get_throttling_ptc+0xf3/0x158 > >> [ 13.127699] [] > >> acpi_processor_get_throttling_info+0x460/0x4af > >> [ 13.127782] [] acpi_processor_start+0x54a/0x606 > >> [ 13.127861] [] acpi_processor_add+0x24/0x6b > >> [ 13.127933] [] > >acpi_start_single_object+0x24/0x46 > >> [ 13.128005] [] acpi_device_probe+0x7d/0x91 > >> [ 13.128076] [] driver_probe_device+0x9c/0x1b0 > >> [ 13.128147] [] __driver_attach+0xc9/0xd0 > >> [ 13.128226] [] __driver_attach+0x0/0xd0 > >> [ 13.128310] [] bus_for_each_dev+0x4d/0x80 > >> [ 13.128381] [] bus_add_driver+0xac/0x220 > >> [ 13.128452] [] acpi_processor_init+0x8f/0xfc > >> [ 13.128523] [] kernel_init+0x154/0x330 > >> [ 13.128594] [] child_rip+0xa/0x12 > >> [ 13.128664] [] kernel_init+0x0/0x330 > >> [ 13.128734] [] 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/