diff options
Diffstat (limited to 'drivers/pci/pci-acpi.c')
-rw-r--r-- | drivers/pci/pci-acpi.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index dfe7c8e1b185..ae5ec76dca77 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -63,7 +63,7 @@ static acpi_status acpi_run_osc(acpi_handle handle, | |||
63 | union acpi_object in_params[4]; | 63 | union acpi_object in_params[4]; |
64 | struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL}; | 64 | struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL}; |
65 | union acpi_object *out_obj; | 65 | union acpi_object *out_obj; |
66 | u32 osc_dw0, flags = osc_args->capbuf[OSC_QUERY_TYPE]; | 66 | u32 errors, flags = osc_args->capbuf[OSC_QUERY_TYPE]; |
67 | 67 | ||
68 | /* Setting up input parameters */ | 68 | /* Setting up input parameters */ |
69 | input.count = 4; | 69 | input.count = 4; |
@@ -83,21 +83,25 @@ static acpi_status acpi_run_osc(acpi_handle handle, | |||
83 | if (ACPI_FAILURE(status)) | 83 | if (ACPI_FAILURE(status)) |
84 | return status; | 84 | return status; |
85 | 85 | ||
86 | if (!output.length) | ||
87 | return AE_NULL_OBJECT; | ||
88 | |||
86 | out_obj = output.pointer; | 89 | out_obj = output.pointer; |
87 | if (out_obj->type != ACPI_TYPE_BUFFER) { | 90 | if (out_obj->type != ACPI_TYPE_BUFFER) { |
88 | printk(KERN_DEBUG "Evaluate _OSC returns wrong type\n"); | 91 | printk(KERN_DEBUG "Evaluate _OSC returns wrong type\n"); |
89 | status = AE_TYPE; | 92 | status = AE_TYPE; |
90 | goto out_kfree; | 93 | goto out_kfree; |
91 | } | 94 | } |
92 | osc_dw0 = *((u32 *)out_obj->buffer.pointer); | 95 | /* Need to ignore the bit0 in result code */ |
93 | if (osc_dw0) { | 96 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
94 | if (osc_dw0 & OSC_REQUEST_ERROR) | 97 | if (errors) { |
98 | if (errors & OSC_REQUEST_ERROR) | ||
95 | printk(KERN_DEBUG "_OSC request fails\n"); | 99 | printk(KERN_DEBUG "_OSC request fails\n"); |
96 | if (osc_dw0 & OSC_INVALID_UUID_ERROR) | 100 | if (errors & OSC_INVALID_UUID_ERROR) |
97 | printk(KERN_DEBUG "_OSC invalid UUID\n"); | 101 | printk(KERN_DEBUG "_OSC invalid UUID\n"); |
98 | if (osc_dw0 & OSC_INVALID_REVISION_ERROR) | 102 | if (errors & OSC_INVALID_REVISION_ERROR) |
99 | printk(KERN_DEBUG "_OSC invalid revision\n"); | 103 | printk(KERN_DEBUG "_OSC invalid revision\n"); |
100 | if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) { | 104 | if (errors & OSC_CAPABILITIES_MASK_ERROR) { |
101 | if (flags & OSC_QUERY_ENABLE) | 105 | if (flags & OSC_QUERY_ENABLE) |
102 | goto out_success; | 106 | goto out_success; |
103 | printk(KERN_DEBUG "_OSC FW not grant req. control\n"); | 107 | printk(KERN_DEBUG "_OSC FW not grant req. control\n"); |