diff options
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/blacklist.c | 14 | ||||
-rw-r--r-- | drivers/acpi/bus.c | 26 | ||||
-rw-r--r-- | drivers/acpi/ec.c | 10 |
3 files changed, 40 insertions, 10 deletions
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index 23e5a0519af5..2815df66f6f7 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c | |||
@@ -185,6 +185,12 @@ static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) | |||
185 | acpi_osi_setup("!Windows 2006"); | 185 | acpi_osi_setup("!Windows 2006"); |
186 | return 0; | 186 | return 0; |
187 | } | 187 | } |
188 | static int __init dmi_disable_osi_win7(const struct dmi_system_id *d) | ||
189 | { | ||
190 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); | ||
191 | acpi_osi_setup("!Windows 2009"); | ||
192 | return 0; | ||
193 | } | ||
188 | 194 | ||
189 | static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | 195 | static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { |
190 | { | 196 | { |
@@ -211,6 +217,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
211 | DMI_MATCH(DMI_PRODUCT_NAME, "Sony VGN-SR290J"), | 217 | DMI_MATCH(DMI_PRODUCT_NAME, "Sony VGN-SR290J"), |
212 | }, | 218 | }, |
213 | }, | 219 | }, |
220 | { | ||
221 | .callback = dmi_disable_osi_win7, | ||
222 | .ident = "ASUS K50IJ", | ||
223 | .matches = { | ||
224 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), | ||
225 | DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"), | ||
226 | }, | ||
227 | }, | ||
214 | 228 | ||
215 | /* | 229 | /* |
216 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. | 230 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 0bdf24a6fd01..cf761b904e4a 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -397,6 +397,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context) | |||
397 | union acpi_object *out_obj; | 397 | union acpi_object *out_obj; |
398 | u8 uuid[16]; | 398 | u8 uuid[16]; |
399 | u32 errors; | 399 | u32 errors; |
400 | struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL}; | ||
400 | 401 | ||
401 | if (!context) | 402 | if (!context) |
402 | return AE_ERROR; | 403 | return AE_ERROR; |
@@ -419,16 +420,16 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context) | |||
419 | in_params[3].buffer.length = context->cap.length; | 420 | in_params[3].buffer.length = context->cap.length; |
420 | in_params[3].buffer.pointer = context->cap.pointer; | 421 | in_params[3].buffer.pointer = context->cap.pointer; |
421 | 422 | ||
422 | status = acpi_evaluate_object(handle, "_OSC", &input, &context->ret); | 423 | status = acpi_evaluate_object(handle, "_OSC", &input, &output); |
423 | if (ACPI_FAILURE(status)) | 424 | if (ACPI_FAILURE(status)) |
424 | return status; | 425 | return status; |
425 | 426 | ||
426 | /* return buffer should have the same length as cap buffer */ | 427 | if (!output.length) |
427 | if (context->ret.length != context->cap.length) | ||
428 | return AE_NULL_OBJECT; | 428 | return AE_NULL_OBJECT; |
429 | 429 | ||
430 | out_obj = context->ret.pointer; | 430 | out_obj = output.pointer; |
431 | if (out_obj->type != ACPI_TYPE_BUFFER) { | 431 | if (out_obj->type != ACPI_TYPE_BUFFER |
432 | || out_obj->buffer.length != context->cap.length) { | ||
432 | acpi_print_osc_error(handle, context, | 433 | acpi_print_osc_error(handle, context, |
433 | "_OSC evaluation returned wrong type"); | 434 | "_OSC evaluation returned wrong type"); |
434 | status = AE_TYPE; | 435 | status = AE_TYPE; |
@@ -457,11 +458,20 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context) | |||
457 | goto out_kfree; | 458 | goto out_kfree; |
458 | } | 459 | } |
459 | out_success: | 460 | out_success: |
460 | return AE_OK; | 461 | context->ret.length = out_obj->buffer.length; |
462 | context->ret.pointer = kmalloc(context->ret.length, GFP_KERNEL); | ||
463 | if (!context->ret.pointer) { | ||
464 | status = AE_NO_MEMORY; | ||
465 | goto out_kfree; | ||
466 | } | ||
467 | memcpy(context->ret.pointer, out_obj->buffer.pointer, | ||
468 | context->ret.length); | ||
469 | status = AE_OK; | ||
461 | 470 | ||
462 | out_kfree: | 471 | out_kfree: |
463 | kfree(context->ret.pointer); | 472 | kfree(output.pointer); |
464 | context->ret.pointer = NULL; | 473 | if (status != AE_OK) |
474 | context->ret.pointer = NULL; | ||
465 | return status; | 475 | return status; |
466 | } | 476 | } |
467 | EXPORT_SYMBOL(acpi_run_osc); | 477 | EXPORT_SYMBOL(acpi_run_osc); |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 75b147f5c8fd..fd1801bdee66 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -916,6 +916,7 @@ static int ec_validate_ecdt(const struct dmi_system_id *id) | |||
916 | /* MSI EC needs special treatment, enable it */ | 916 | /* MSI EC needs special treatment, enable it */ |
917 | static int ec_flag_msi(const struct dmi_system_id *id) | 917 | static int ec_flag_msi(const struct dmi_system_id *id) |
918 | { | 918 | { |
919 | printk(KERN_DEBUG PREFIX "Detected MSI hardware, enabling workarounds.\n"); | ||
919 | EC_FLAGS_MSI = 1; | 920 | EC_FLAGS_MSI = 1; |
920 | EC_FLAGS_VALIDATE_ECDT = 1; | 921 | EC_FLAGS_VALIDATE_ECDT = 1; |
921 | return 0; | 922 | return 0; |
@@ -928,8 +929,13 @@ static struct dmi_system_id __initdata ec_dmi_table[] = { | |||
928 | DMI_MATCH(DMI_BOARD_NAME, "JFL92") }, NULL}, | 929 | DMI_MATCH(DMI_BOARD_NAME, "JFL92") }, NULL}, |
929 | { | 930 | { |
930 | ec_flag_msi, "MSI hardware", { | 931 | ec_flag_msi, "MSI hardware", { |
931 | DMI_MATCH(DMI_BIOS_VENDOR, "Micro-Star"), | 932 | DMI_MATCH(DMI_BIOS_VENDOR, "Micro-Star")}, NULL}, |
932 | DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star") }, NULL}, | 933 | { |
934 | ec_flag_msi, "MSI hardware", { | ||
935 | DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star")}, NULL}, | ||
936 | { | ||
937 | ec_flag_msi, "MSI hardware", { | ||
938 | DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star")}, NULL}, | ||
933 | { | 939 | { |
934 | ec_validate_ecdt, "ASUS hardware", { | 940 | ec_validate_ecdt, "ASUS hardware", { |
935 | DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL}, | 941 | DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL}, |