* [patch (for 2.6.25?) 1/3] ACPI: EC: fix regression
@ 2008-03-04 23:00 akpm
2008-03-04 23:24 ` Alexey Starikovskiy
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2008-03-04 23:00 UTC (permalink / raw)
To: lenb; +Cc: linux-acpi, akpm, astarikovskiy, len.brown, m.s.tsirkin, rjw
From: Alexey Starikovskiy <astarikovskiy@suse.de>
no changelog?
Tested-by: "Michael S. Tsirkin" <m.s.tsirkin@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Len Brown <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/acpi/ec.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff -puN drivers/acpi/ec.c~acpi-ec-fix-regression drivers/acpi/ec.c
--- a/drivers/acpi/ec.c~acpi-ec-fix-regression
+++ a/drivers/acpi/ec.c
@@ -129,7 +129,8 @@ static struct acpi_ec {
struct mutex lock;
wait_queue_head_t wait;
struct list_head list;
- u8 handlers_installed;
+ u8 handlers_installed:1;
+ u8 from_ecdt:1;
} *boot_ec, *first_ec;
/* --------------------------------------------------------------------------
@@ -772,16 +773,18 @@ static int acpi_ec_add(struct acpi_devic
/* Check for boot EC */
if (boot_ec) {
- if (boot_ec->handle == device->handle) {
- /* Pre-loaded EC from DSDT, just move pointer */
- ec = boot_ec;
- boot_ec = NULL;
- goto end;
- } else if (boot_ec->handle == ACPI_ROOT_OBJECT) {
+ if (boot_ec->from_ecdt &&
+ (boot_ec->handle == device->handle ||
+ boot_ec->handle == ACPI_ROOT_OBJECT)) {
/* ECDT-based EC, time to shut it down */
ec_remove_handlers(boot_ec);
kfree(boot_ec);
first_ec = boot_ec = NULL;
+ } else if (boot_ec->handle == device->handle) {
+ /* Pre-loaded EC from DSDT, just move pointer */
+ ec = boot_ec;
+ boot_ec = NULL;
+ goto end;
}
}
@@ -943,6 +946,7 @@ int __init acpi_ec_ecdt_probe(void)
boot_ec->command_addr = ecdt_ptr->control.address;
boot_ec->data_addr = ecdt_ptr->data.address;
boot_ec->gpe = ecdt_ptr->gpe;
+ boot_ec->from_ecdt = 1;
if (ACPI_FAILURE(acpi_get_handle(NULL, ecdt_ptr->id,
&boot_ec->handle))) {
pr_info("Failed to locate handle for boot EC\n");
_
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch (for 2.6.25?) 1/3] ACPI: EC: fix regression
2008-03-04 23:00 [patch (for 2.6.25?) 1/3] ACPI: EC: fix regression akpm
@ 2008-03-04 23:24 ` Alexey Starikovskiy
0 siblings, 0 replies; 2+ messages in thread
From: Alexey Starikovskiy @ 2008-03-04 23:24 UTC (permalink / raw)
To: akpm; +Cc: lenb, linux-acpi, len.brown, m.s.tsirkin, rjw
[-- Attachment #1: Type: text/plain, Size: 2183 bytes --]
Andrew,
Please drop this patch. I would like to just revert the patch that causes this bug.
It is appended to #10100, attaching it here too.
Thanks,
Alex.
akpm@linux-foundation.org wrote:
> From: Alexey Starikovskiy <astarikovskiy@suse.de>
>
> no changelog?
>
> Tested-by: "Michael S. Tsirkin" <m.s.tsirkin@gmail.com>
> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> Cc: Len Brown <len.brown@intel.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/acpi/ec.c | 18 +++++++++++-------
> 1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff -puN drivers/acpi/ec.c~acpi-ec-fix-regression drivers/acpi/ec.c
> --- a/drivers/acpi/ec.c~acpi-ec-fix-regression
> +++ a/drivers/acpi/ec.c
> @@ -129,7 +129,8 @@ static struct acpi_ec {
> struct mutex lock;
> wait_queue_head_t wait;
> struct list_head list;
> - u8 handlers_installed;
> + u8 handlers_installed:1;
> + u8 from_ecdt:1;
> } *boot_ec, *first_ec;
>
> /* --------------------------------------------------------------------------
> @@ -772,16 +773,18 @@ static int acpi_ec_add(struct acpi_devic
>
> /* Check for boot EC */
> if (boot_ec) {
> - if (boot_ec->handle == device->handle) {
> - /* Pre-loaded EC from DSDT, just move pointer */
> - ec = boot_ec;
> - boot_ec = NULL;
> - goto end;
> - } else if (boot_ec->handle == ACPI_ROOT_OBJECT) {
> + if (boot_ec->from_ecdt &&
> + (boot_ec->handle == device->handle ||
> + boot_ec->handle == ACPI_ROOT_OBJECT)) {
> /* ECDT-based EC, time to shut it down */
> ec_remove_handlers(boot_ec);
> kfree(boot_ec);
> first_ec = boot_ec = NULL;
> + } else if (boot_ec->handle == device->handle) {
> + /* Pre-loaded EC from DSDT, just move pointer */
> + ec = boot_ec;
> + boot_ec = NULL;
> + goto end;
> }
> }
>
> @@ -943,6 +946,7 @@ int __init acpi_ec_ecdt_probe(void)
> boot_ec->command_addr = ecdt_ptr->control.address;
> boot_ec->data_addr = ecdt_ptr->data.address;
> boot_ec->gpe = ecdt_ptr->gpe;
> + boot_ec->from_ecdt = 1;
> if (ACPI_FAILURE(acpi_get_handle(NULL, ecdt_ptr->id,
> &boot_ec->handle))) {
> pr_info("Failed to locate handle for boot EC\n");
> _
[-- Attachment #2: revert-208c70a45624400fafd7511b96bc426bf01f8f5e --]
[-- Type: text/plain, Size: 1049 bytes --]
ACPI: EC: Revert 208c70a45624400fafd7511b96bc426bf01f8f5e
From: Alexey Starikovskiy <astarikovskiy@suse.de>
This patch for non-fatal error causes some fatal ones.
Just revert it and find better solution for original problem.
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
---
drivers/acpi/ec.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index caf873c..7222a18 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -943,11 +943,7 @@ int __init acpi_ec_ecdt_probe(void)
boot_ec->command_addr = ecdt_ptr->control.address;
boot_ec->data_addr = ecdt_ptr->data.address;
boot_ec->gpe = ecdt_ptr->gpe;
- if (ACPI_FAILURE(acpi_get_handle(NULL, ecdt_ptr->id,
- &boot_ec->handle))) {
- pr_info("Failed to locate handle for boot EC\n");
- boot_ec->handle = ACPI_ROOT_OBJECT;
- }
+ boot_ec->handle = ACPI_ROOT_OBJECT;
} else {
/* This workaround is needed only on some broken machines,
* which require early EC, but fail to provide ECDT */
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-04 23:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-04 23:00 [patch (for 2.6.25?) 1/3] ACPI: EC: fix regression akpm
2008-03-04 23:24 ` Alexey Starikovskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox