All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] ACPI: Ignore AE_NOT_FOUND error of EC _REG method and continue to initialize EC
@ 2008-07-31  2:03 Joshua C.
  2008-07-31  2:11 ` Moore, Robert
  0 siblings, 1 reply; 15+ messages in thread
From: Joshua C. @ 2008-07-31  2:03 UTC (permalink / raw)
  To: linux-acpi

On Mon, Jul 28, 2008 at 14:59:26AM +0800, Andi Kleen wrote:
> >Subject:ACPI: Ignore AE_NOT_FOUND error of EC _REG method and continue to initialize EC
> >From: Zhao Yakui <yakui.zhao@intel.com>
>Thanks. Queued for test. How urgent is this? Do we need to consider it
>for .27?
>
>-Andi

It will be great if you can put this in .27.

--joshua

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH]  ACPI:  Ignore AE_NOT_FOUND error of EC _REG method and continue to initialize EC
@ 2008-08-28  1:29 Zhao Yakui
  2008-10-17  6:05 ` Len Brown
  0 siblings, 1 reply; 15+ messages in thread
From: Zhao Yakui @ 2008-08-28  1:29 UTC (permalink / raw)
  To: AndiKleen; +Cc: linux-acpi, lenb, joshuacov

Subject:ACPI: Ignore AE_NOT_FOUND error of EC _REG method and continue to initialize EC 
From: Zhao Yakui <yakui.zhao@intel.com>

On some broken BIOS the ACPI object in EC _REG method can't be found in
ACPI namespace, which causes that the status code of AE_NOT_FOUND is returned by
the EC _REG object. In such case the EC device can't be initialized correctly, 
which causes that battery/AC adapter can't work normally. As the EC address
space handler is not removed and the memory pointed by its input argument is
already free, sometimes the kernel will also be panic when EC internal register
is still accessed. But the windows can work well on such broken BIOS.

Maybe it will be reasonable that OS ignores the AE_NOT_FOUND error 
returned by the EC _REG object and continues to initialize EC device 
on some broken BIOS. 
For example: the ACPI object in EC _REG method can't be found and status error
code is AE_NOT_FOUND. 

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>

---
 drivers/acpi/ec.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

Index: linux-2.6/drivers/acpi/ec.c
===================================================================
--- linux-2.6.orig/drivers/acpi/ec.c
+++ linux-2.6/drivers/acpi/ec.c
@@ -862,8 +862,19 @@ static int ec_install_handlers(struct ac
 						    &acpi_ec_space_handler,
 						    NULL, ec);
 	if (ACPI_FAILURE(status)) {
-		acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
-		return -ENODEV;
+		if (status == AE_NOT_FOUND) {
+			/*
+			 * Maybe OS fails in evaluating the _REG object.
+			 * The AE_NOT_FOUND error will be ignored and OS
+			 * continue to initialize EC.
+			 */
+			printk(KERN_ERR "Fail in evaluating the _REG object"
+				" of EC device. Broken bios is suspected.\n");
+		} else {
+			acpi_remove_gpe_handler(NULL, ec->gpe,
+				&acpi_ec_gpe_handler);
+			return -ENODEV;
+		}
 	}
 
 	ec->handlers_installed = 1;



^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH]  ACPI:  Ignore AE_NOT_FOUND error of EC _REG method and continue to initialize EC
@ 2008-07-28  3:25 Zhao Yakui
  2008-07-28 14:59 ` Andi Kleen
  0 siblings, 1 reply; 15+ messages in thread
From: Zhao Yakui @ 2008-07-28  3:25 UTC (permalink / raw)
  To: AndiKleen; +Cc: linux-acpi, lenb

Subject:ACPI: Ignore AE_NOT_FOUND error of EC _REG method and continue to initialize EC 
From: Zhao Yakui <yakui.zhao@intel.com>

On some broken BIOS the ACPI object in EC _REG method can't be found in
ACPI namespace, which causes that the AE_NOT_FOUND status code is returned by
the EC _REG object. In such case the EC device can't be initialized correctly, 
which causes that battery/AC adapter can't work normally. As the EC address
space handler is not removed and the memory pointed by its input argument is
already free, sometimes the kernel will also be panic when EC internal register
is still accessed. But the windows can work well on such broken BIOS.

Maybe it will be reasonable that OS ignores the AE_NOT_FOUND error 
returned by the EC _REG object and continues to initialize EC device 
for some broken BIOS. Of course the warning message will be printed.
For example: the ACPI object in EC _REG method can't be found and status error
code is AE_NOT_FOUND. 

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>

---
 drivers/acpi/ec.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

Index: linux-2.6/drivers/acpi/ec.c
===================================================================
--- linux-2.6.orig/drivers/acpi/ec.c
+++ linux-2.6/drivers/acpi/ec.c
@@ -835,8 +835,19 @@ static int ec_install_handlers(struct ac
 						    &acpi_ec_space_handler,
 						    NULL, ec);
 	if (ACPI_FAILURE(status)) {
-		acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
-		return -ENODEV;
+		if (status == AE_NOT_FOUND) {
+			/*
+			 * Maybe OS fails in evaluating the _REG object.
+			 * The AE_NOT_FOUND error will be ignored and OS
+			 * continue to initialize EC.
+			 */
+			printk(KERN_ERR "Fail in evaluating _REG object."
+				" It is broken BIOS.\n");
+		} else {
+			acpi_remove_gpe_handler(NULL, ec->gpe,
+				&acpi_ec_gpe_handler);
+			return -ENODEV;
+		}
 	}
 
 	ec->handlers_installed = 1;



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

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

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-31  2:03 [PATCH] ACPI: Ignore AE_NOT_FOUND error of EC _REG method and continue to initialize EC Joshua C.
2008-07-31  2:11 ` Moore, Robert
2008-07-31  2:19   ` Kleen, Andi
2008-07-31  3:06     ` Moore, Robert
2008-07-31  6:28   ` Zhao Yakui
     [not found]     ` <5f6f8c5f0807310219y2f7ddd6p85531c464bd9bde3@mail.gmail.com>
2008-07-31 11:21       ` Joshua C.
2008-07-31 19:13     ` Alexey Starikovskiy
2008-07-31 20:04       ` Kleen, Andi
2008-08-01  2:03       ` Zhao Yakui
2008-08-02  5:32         ` Joshua C.
  -- strict thread matches above, loose matches on Subject: below --
2008-08-28  1:29 Zhao Yakui
2008-10-17  6:05 ` Len Brown
2008-07-28  3:25 Zhao Yakui
2008-07-28 14:59 ` Andi Kleen
2008-07-29  0:54   ` 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.