* [PATCH 1/2] ACPI: EC: Rewrite DMI checks
@ 2009-10-02 16:21 Alexey Starikovskiy
2009-10-02 16:21 ` [PATCH 2/2] ACPI: EC: Don't parse DSDT for EC early init on Compal Alexey Starikovskiy
2009-10-03 5:20 ` [PATCH 1/2] ACPI: EC: Rewrite DMI checks Len Brown
0 siblings, 2 replies; 5+ messages in thread
From: Alexey Starikovskiy @ 2009-10-02 16:21 UTC (permalink / raw)
To: Len Brown; +Cc: Linux-acpi
Use dmi_check_system() for DMI matching.
Don't use string "Notebook" for matching MSI hardware.
Reference: http://bugzilla.kernel.org/show_bug.cgi?id=14081
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
---
drivers/acpi/ec.c | 37 +++++++++++++++++++++++++++++++------
1 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index f707960..3fcb913 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -119,6 +119,7 @@ static struct acpi_ec {
} *boot_ec, *first_ec;
static int EC_FLAGS_MSI; /* Out-of-spec MSI controller */
+static int EC_FLAGS_VALIDATE_ECDT; /* ASUStec ECDTs need to be validated */
/* --------------------------------------------------------------------------
Transaction Management
@@ -899,6 +900,33 @@ static const struct acpi_device_id ec_device_ids[] = {
{"", 0},
};
+/* ASUStek often supplies us with broken ECDT, validate it */
+static int ec_validate_ecdt(const struct dmi_system_id *id)
+{
+ EC_FLAGS_VALIDATE_ECDT = 1;
+ return 0;
+}
+
+/* MSI EC needs special treatment, enable it */
+static int ec_flag_msi(const struct dmi_system_id *id)
+{
+ EC_FLAGS_MSI = 1;
+ EC_FLAGS_VALIDATE_ECDT = 1;
+ return 0;
+}
+
+static struct dmi_system_id __initdata ec_dmi_table[] = {
+ {
+ ec_flag_msi, "MSI hardware", {
+ DMI_MATCH(DMI_BIOS_VENDOR, "Micro-Star"),
+ DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star") }, NULL},
+ {
+ ec_validate_ecdt, "ASUS hardware", {
+ DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL},
+ {},
+};
+
+
int __init acpi_ec_ecdt_probe(void)
{
acpi_status status;
@@ -911,11 +939,7 @@ int __init acpi_ec_ecdt_probe(void)
/*
* Generate a boot ec context
*/
- if (dmi_name_in_vendors("Micro-Star") ||
- dmi_name_in_vendors("Notebook")) {
- pr_info(PREFIX "Enabling special treatment for EC from MSI.\n");
- EC_FLAGS_MSI = 1;
- }
+ dmi_check_system(ec_dmi_table);
status = acpi_get_table(ACPI_SIG_ECDT, 1,
(struct acpi_table_header **)&ecdt_ptr);
if (ACPI_SUCCESS(status)) {
@@ -926,7 +950,7 @@ int __init acpi_ec_ecdt_probe(void)
boot_ec->handle = ACPI_ROOT_OBJECT;
acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle);
/* Don't trust ECDT, which comes from ASUSTek */
- if (!dmi_name_in_vendors("ASUS") && EC_FLAGS_MSI == 0)
+ if (!EC_FLAGS_VALIDATE_ECDT)
goto install;
saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
if (!saved_ec)
@@ -934,6 +958,7 @@ int __init acpi_ec_ecdt_probe(void)
memcpy(saved_ec, boot_ec, sizeof(struct acpi_ec));
/* fall through */
}
+
/* This workaround is needed only on some broken machines,
* which require early EC, but fail to provide ECDT */
printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] ACPI: EC: Don't parse DSDT for EC early init on Compal
2009-10-02 16:21 [PATCH 1/2] ACPI: EC: Rewrite DMI checks Alexey Starikovskiy
@ 2009-10-02 16:21 ` Alexey Starikovskiy
2009-10-02 20:41 ` Maxim Levitsky
2009-10-03 5:23 ` Len Brown
2009-10-03 5:20 ` [PATCH 1/2] ACPI: EC: Rewrite DMI checks Len Brown
1 sibling, 2 replies; 5+ messages in thread
From: Alexey Starikovskiy @ 2009-10-02 16:21 UTC (permalink / raw)
To: Len Brown; +Cc: Linux-acpi
Compal DSDT breaks if scanned early, while we need early scan
for almost all ASUS machines. Safest workaround seems to be to
continue do an early scan for all machines, but this Compal model.
References: http://bugzilla.kernel.org/show_bug.cgi?id=14086
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
---
drivers/acpi/ec.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 3fcb913..2c790b5 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -120,6 +120,7 @@ static struct acpi_ec {
static int EC_FLAGS_MSI; /* Out-of-spec MSI controller */
static int EC_FLAGS_VALIDATE_ECDT; /* ASUStec ECDTs need to be validated */
+static int EC_FLAGS_SKIP_DSDT_SCAN; /* Not all BIOS survive early DSDT scan */
/* --------------------------------------------------------------------------
Transaction Management
@@ -900,6 +901,13 @@ static const struct acpi_device_id ec_device_ids[] = {
{"", 0},
};
+/* Some BIOS do not survive early DSDT scan, skip it */
+static int ec_skip_dsdt_scan(const struct dmi_system_id *id)
+{
+ EC_FLAGS_SKIP_DSDT_SCAN = 1;
+ return 0;
+}
+
/* ASUStek often supplies us with broken ECDT, validate it */
static int ec_validate_ecdt(const struct dmi_system_id *id)
{
@@ -917,6 +925,10 @@ static int ec_flag_msi(const struct dmi_system_id *id)
static struct dmi_system_id __initdata ec_dmi_table[] = {
{
+ ec_skip_dsdt_scan, "Compal JFL92", {
+ DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"),
+ DMI_MATCH(DMI_BOARD_NAME, "JFL92") }, NULL},
+ {
ec_flag_msi, "MSI hardware", {
DMI_MATCH(DMI_BIOS_VENDOR, "Micro-Star"),
DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star") }, NULL},
@@ -959,6 +971,9 @@ int __init acpi_ec_ecdt_probe(void)
/* fall through */
}
+ if (EC_FLAGS_SKIP_DSDT_SCAN)
+ return -ENODEV;
+
/* This workaround is needed only on some broken machines,
* which require early EC, but fail to provide ECDT */
printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] ACPI: EC: Don't parse DSDT for EC early init on Compal
2009-10-02 16:21 ` [PATCH 2/2] ACPI: EC: Don't parse DSDT for EC early init on Compal Alexey Starikovskiy
@ 2009-10-02 20:41 ` Maxim Levitsky
2009-10-03 5:23 ` Len Brown
1 sibling, 0 replies; 5+ messages in thread
From: Maxim Levitsky @ 2009-10-02 20:41 UTC (permalink / raw)
To: Alexey Starikovskiy; +Cc: Len Brown, Linux-acpi
On Fri, 2009-10-02 at 20:21 +0400, Alexey Starikovskiy wrote:
> Compal DSDT breaks if scanned early, while we need early scan
> for almost all ASUS machines. Safest workaround seems to be to
> continue do an early scan for all machines, but this Compal model.
Its not an option, to do a scan without calling _any_ function (even
_sta) to locate the EC, and then call _sta on the path ec was found to
verify?
Best regards,
Maxim Levitsky
>
> References: http://bugzilla.kernel.org/show_bug.cgi?id=14086
> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> ---
>
> drivers/acpi/ec.c | 15 +++++++++++++++
> 1 files changed, 15 insertions(+), 0 deletions(-)
>
>
> diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
> index 3fcb913..2c790b5 100644
> --- a/drivers/acpi/ec.c
> +++ b/drivers/acpi/ec.c
> @@ -120,6 +120,7 @@ static struct acpi_ec {
>
> static int EC_FLAGS_MSI; /* Out-of-spec MSI controller */
> static int EC_FLAGS_VALIDATE_ECDT; /* ASUStec ECDTs need to be validated */
> +static int EC_FLAGS_SKIP_DSDT_SCAN; /* Not all BIOS survive early DSDT scan */
>
> /* --------------------------------------------------------------------------
> Transaction Management
> @@ -900,6 +901,13 @@ static const struct acpi_device_id ec_device_ids[] = {
> {"", 0},
> };
>
> +/* Some BIOS do not survive early DSDT scan, skip it */
> +static int ec_skip_dsdt_scan(const struct dmi_system_id *id)
> +{
> + EC_FLAGS_SKIP_DSDT_SCAN = 1;
> + return 0;
> +}
> +
> /* ASUStek often supplies us with broken ECDT, validate it */
> static int ec_validate_ecdt(const struct dmi_system_id *id)
> {
> @@ -917,6 +925,10 @@ static int ec_flag_msi(const struct dmi_system_id *id)
>
> static struct dmi_system_id __initdata ec_dmi_table[] = {
> {
> + ec_skip_dsdt_scan, "Compal JFL92", {
> + DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"),
> + DMI_MATCH(DMI_BOARD_NAME, "JFL92") }, NULL},
> + {
> ec_flag_msi, "MSI hardware", {
> DMI_MATCH(DMI_BIOS_VENDOR, "Micro-Star"),
> DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star") }, NULL},
> @@ -959,6 +971,9 @@ int __init acpi_ec_ecdt_probe(void)
> /* fall through */
> }
>
> + if (EC_FLAGS_SKIP_DSDT_SCAN)
> + return -ENODEV;
> +
> /* This workaround is needed only on some broken machines,
> * which require early EC, but fail to provide ECDT */
> printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] ACPI: EC: Rewrite DMI checks
2009-10-02 16:21 [PATCH 1/2] ACPI: EC: Rewrite DMI checks Alexey Starikovskiy
2009-10-02 16:21 ` [PATCH 2/2] ACPI: EC: Don't parse DSDT for EC early init on Compal Alexey Starikovskiy
@ 2009-10-03 5:20 ` Len Brown
1 sibling, 0 replies; 5+ messages in thread
From: Len Brown @ 2009-10-03 5:20 UTC (permalink / raw)
To: Alexey Starikovskiy; +Cc: Linux-acpi
applied
thanks,
Len Brown, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] ACPI: EC: Don't parse DSDT for EC early init on Compal
2009-10-02 16:21 ` [PATCH 2/2] ACPI: EC: Don't parse DSDT for EC early init on Compal Alexey Starikovskiy
2009-10-02 20:41 ` Maxim Levitsky
@ 2009-10-03 5:23 ` Len Brown
1 sibling, 0 replies; 5+ messages in thread
From: Len Brown @ 2009-10-03 5:23 UTC (permalink / raw)
To: Alexey Starikovskiy; +Cc: Linux-acpi
i'm not really excited about a DMI workaround,
but I'm applying it b/c it addresses the problem at hand.
Hopefully a more permanent fix will emerge over time.
thanks,
Len Brown, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-10-03 5:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-02 16:21 [PATCH 1/2] ACPI: EC: Rewrite DMI checks Alexey Starikovskiy
2009-10-02 16:21 ` [PATCH 2/2] ACPI: EC: Don't parse DSDT for EC early init on Compal Alexey Starikovskiy
2009-10-02 20:41 ` Maxim Levitsky
2009-10-03 5:23 ` Len Brown
2009-10-03 5:20 ` [PATCH 1/2] ACPI: EC: Rewrite DMI checks Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox