All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI : Disable the C2C3_FFH access mode if MWAIT is unsupported
@ 2008-06-05  3:44 Zhao Yakui
  2008-06-05  5:35 ` Len Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Zhao Yakui @ 2008-06-05  3:44 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi

Subject: ACPI: Disable the C2C3_FFH access mode if MWAIT is unsupported
From: Zhao Yakui <yakui.zhao@intel.com>

   After the following commit is merged, C2C3_FFH mode will be enabled and 
passed into the _PDC object. But because MWAIT is unsupported on some laptops, 
the different power states will be returned by the _CST object.
Maybe it will be better to disable C2C3_FFH access mode if MWAIT is unsupported.
 
commit 991528d7348667924176f3e29addea0675298944
Author: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Date:   Mon Sep 25 16:28:13 2006 -0700

    ACPI: Processor native C-states using MWAIT

http://bugzilla.kernel.org/show_bug.cgi?id=10807

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>

---
 arch/x86/kernel/acpi/processor.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux-2.6/arch/x86/kernel/acpi/processor.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/acpi/processor.c
+++ linux-2.6/arch/x86/kernel/acpi/processor.c
@@ -43,6 +43,11 @@ static void init_intel_pdc(struct acpi_p
 	buf[0] = ACPI_PDC_REVISION_ID;
 	buf[1] = 1;
 	buf[2] = ACPI_PDC_C_CAPABILITY_SMP;
+	/*
+	 * If mwait/monitor is unsupported, C2/C3_FFH will be disabled.
+	 */
+	if (!cpu_has(c, X86_FEATURE_MWAIT))
+		buf[2] &= ~ACPI_PDC_C_C2C3_FFH;
 
 	/*
 	 * The default of PDC_SMP_T_SWCOORD bit is set for intel x86 cpu so



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI : Disable the C2C3_FFH access mode if MWAIT is unsupported
  2008-06-05  3:44 [PATCH] ACPI : Disable the C2C3_FFH access mode if MWAIT is unsupported Zhao Yakui
@ 2008-06-05  5:35 ` Len Brown
  2008-06-05  5:45   ` Shaohua Li
  0 siblings, 1 reply; 4+ messages in thread
From: Len Brown @ 2008-06-05  5:35 UTC (permalink / raw)
  To: Zhao Yakui; +Cc: linux-acpi



On Thu, 5 Jun 2008, Zhao Yakui wrote:

> Subject: ACPI: Disable the C2C3_FFH access mode if MWAIT is unsupported
> From: Zhao Yakui <yakui.zhao@intel.com>
> 
>    After the following commit is merged, C2C3_FFH mode will be enabled and 
> passed into the _PDC object. But because MWAIT is unsupported on some laptops, 
> the different power states will be returned by the _CST object.
> Maybe it will be better to disable C2C3_FFH access mode if MWAIT is unsupported.
>  
> commit 991528d7348667924176f3e29addea0675298944
> Author: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> Date:   Mon Sep 25 16:28:13 2006 -0700
> 
>     ACPI: Processor native C-states using MWAIT
 
> http://bugzilla.kernel.org/show_bug.cgi?id=10807

Interesting bug report. 
Unfortunately, it is a BIOS bug that the BIOS exposes C3
when the OS doesn't support MWAIT, but neglects to expose
C3 when the OS does support MWAIT. 

This patch will have no effect on the system in the bug report.
Indeed, it would benefit only a system with a BIOS that thinks
it has MWAIT support but a CPU that thinks it doesn't...

probably good hygine to do this, but I don't think it will
help anything.

I think the fix for the machine in bug 10807 is to
have a bootparam that disables mwait support,
say "idle=!mwait" and a DMI entry for that box
that invokes it to work around the BIOS bug.

thanks,
-Len
 
> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
> Signed-off-by: Li Shaohua <shaohua.li@intel.com>
> 
> ---
>  arch/x86/kernel/acpi/processor.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> Index: linux-2.6/arch/x86/kernel/acpi/processor.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/acpi/processor.c
> +++ linux-2.6/arch/x86/kernel/acpi/processor.c
> @@ -43,6 +43,11 @@ static void init_intel_pdc(struct acpi_p
>  	buf[0] = ACPI_PDC_REVISION_ID;
>  	buf[1] = 1;
>  	buf[2] = ACPI_PDC_C_CAPABILITY_SMP;
> +	/*
> +	 * If mwait/monitor is unsupported, C2/C3_FFH will be disabled.
> +	 */
> +	if (!cpu_has(c, X86_FEATURE_MWAIT))
> +		buf[2] &= ~ACPI_PDC_C_C2C3_FFH;
>  
>  	/*
>  	 * The default of PDC_SMP_T_SWCOORD bit is set for intel x86 cpu so
> 
> 




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI : Disable the C2C3_FFH access mode if MWAIT is unsupported
  2008-06-05  5:35 ` Len Brown
@ 2008-06-05  5:45   ` Shaohua Li
  0 siblings, 0 replies; 4+ messages in thread
From: Shaohua Li @ 2008-06-05  5:45 UTC (permalink / raw)
  To: Len Brown; +Cc: Zhao, Yakui, linux-acpi

On Thu, 2008-06-05 at 13:35 +0800, Len Brown wrote:
> 
> 
> On Thu, 5 Jun 2008, Zhao Yakui wrote:
> 
> > Subject: ACPI: Disable the C2C3_FFH access mode if MWAIT is
> unsupported
> > From: Zhao Yakui <yakui.zhao@intel.com>
> >
> >    After the following commit is merged, C2C3_FFH mode will be
> enabled and
> > passed into the _PDC object. But because MWAIT is unsupported on
> some laptops,
> > the different power states will be returned by the _CST object.
> > Maybe it will be better to disable C2C3_FFH access mode if MWAIT is
> unsupported.
> > 
> > commit 991528d7348667924176f3e29addea0675298944
> > Author: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> > Date:   Mon Sep 25 16:28:13 2006 -0700
> >
> >     ACPI: Processor native C-states using MWAIT
> 
> > http://bugzilla.kernel.org/show_bug.cgi?id=10807
> 
> Interesting bug report.
> Unfortunately, it is a BIOS bug that the BIOS exposes C3
> when the OS doesn't support MWAIT, but neglects to expose
> C3 when the OS does support MWAIT.
> 
> This patch will have no effect on the system in the bug report.
> Indeed, it would benefit only a system with a BIOS that thinks
> it has MWAIT support but a CPU that thinks it doesn't...
> 
> probably good hygine to do this, but I don't think it will
> help anything.
> 
> I think the fix for the machine in bug 10807 is to
> have a bootparam that disables mwait support,
> say "idle=!mwait" and a DMI entry for that box
> that invokes it to work around the BIOS bug.
The patch isn't related to the bug, but we got the idea when debugging
the bug. Yakui should write a new description which doesn't mention the
bugzilla. I thought we need this patch to avoid buggy BIOS.

Thanks,
Shaohua


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ACPI : Disable the C2C3_FFH access mode if MWAIT is unsupported
@ 2008-06-05  6:33 Zhao Yakui
  0 siblings, 0 replies; 4+ messages in thread
From: Zhao Yakui @ 2008-06-05  6:33 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi

Subject: ACPI: Disable the C2C3_FFH access mode if MWAIT is unsupported
From: Zhao Yakui <yakui.zhao@intel.com>

   After the following commit is merged, C2C3_FFH mode will be enabled and 
passed into the _PDC object. If the BIOS thinks that MWAIT is supported and
the CPU doesn't support MWAIT, the incorrect power states will be returned 
by the _CST object. So it will be better to disable C2C3_FFH access mode 
if MWAIT is unsupported.
 
commit 991528d7348667924176f3e29addea0675298944
Author: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Date:   Mon Sep 25 16:28:13 2006 -0700

    ACPI: Processor native C-states using MWAIT

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>

---
 arch/x86/kernel/acpi/processor.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux-2.6/arch/x86/kernel/acpi/processor.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/acpi/processor.c
+++ linux-2.6/arch/x86/kernel/acpi/processor.c
@@ -43,6 +43,11 @@ static void init_intel_pdc(struct acpi_p
 	buf[0] = ACPI_PDC_REVISION_ID;
 	buf[1] = 1;
 	buf[2] = ACPI_PDC_C_CAPABILITY_SMP;
+	/*
+	 * If mwait/monitor is unsupported, C2/C3_FFH will be disabled.
+	 */
+	if (!cpu_has(c, X86_FEATURE_MWAIT))
+		buf[2] &= ~ACPI_PDC_C_C2C3_FFH;
 
 	/*
 	 * The default of PDC_SMP_T_SWCOORD bit is set for intel x86 cpu so



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-06-05  6:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-05  3:44 [PATCH] ACPI : Disable the C2C3_FFH access mode if MWAIT is unsupported Zhao Yakui
2008-06-05  5:35 ` Len Brown
2008-06-05  5:45   ` Shaohua Li
  -- strict thread matches above, loose matches on Subject: below --
2008-06-05  6:33 Zhao Yakui

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.