diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2008-11-09 23:54:43 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-11-11 16:33:05 -0500 |
commit | 2485b8674bf5762822e14e1554938e36511c0ae4 (patch) | |
tree | 9594d7366d234f9b23c33da9b087c120562b0070 /drivers/pci | |
parent | f21f237cf55494c3a4209de323281a3b0528da10 (diff) |
PCI: ignore bit0 of _OSC return code
Currently acpi_run_osc() checks all the bits in _OSC result code (the
first DWORD in the capabilities buffer) to see error condition. But the
bit 0, which doesn't indicate any error, must be ignored.
The bit 0 is used as the query flag at _OSC invocation time. Some
platforms clear it during _OSC evaluation, but the others don't. On
latter platforms, current acpi_run_osc() mis-detects error when _OSC is
evaluated with query flag set because it doesn't ignore the bit 0.
Because of this, the __acpi_query_osc() always fails on such platforms.
And this is the cause of the problem that pci_osc_control_set() doesn't
work since the commit 4e39432f4df544d3dfe4fc90a22d87de64d15815 which
changed pci_osc_control_set() to use __acpi_query_osc().
Tested-by:"Tomasz Czernecki <czernecki@gmail.com>
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci-acpi.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index b3a63edb6901..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; |
@@ -92,15 +92,16 @@ static acpi_status acpi_run_osc(acpi_handle handle, | |||
92 | status = AE_TYPE; | 92 | status = AE_TYPE; |
93 | goto out_kfree; | 93 | goto out_kfree; |
94 | } | 94 | } |
95 | osc_dw0 = *((u32 *)out_obj->buffer.pointer); | 95 | /* Need to ignore the bit0 in result code */ |
96 | if (osc_dw0) { | 96 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
97 | if (osc_dw0 & OSC_REQUEST_ERROR) | 97 | if (errors) { |
98 | if (errors & OSC_REQUEST_ERROR) | ||
98 | printk(KERN_DEBUG "_OSC request fails\n"); | 99 | printk(KERN_DEBUG "_OSC request fails\n"); |
99 | if (osc_dw0 & OSC_INVALID_UUID_ERROR) | 100 | if (errors & OSC_INVALID_UUID_ERROR) |
100 | printk(KERN_DEBUG "_OSC invalid UUID\n"); | 101 | printk(KERN_DEBUG "_OSC invalid UUID\n"); |
101 | if (osc_dw0 & OSC_INVALID_REVISION_ERROR) | 102 | if (errors & OSC_INVALID_REVISION_ERROR) |
102 | printk(KERN_DEBUG "_OSC invalid revision\n"); | 103 | printk(KERN_DEBUG "_OSC invalid revision\n"); |
103 | if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) { | 104 | if (errors & OSC_CAPABILITIES_MASK_ERROR) { |
104 | if (flags & OSC_QUERY_ENABLE) | 105 | if (flags & OSC_QUERY_ENABLE) |
105 | goto out_success; | 106 | goto out_success; |
106 | printk(KERN_DEBUG "_OSC FW not grant req. control\n"); | 107 | printk(KERN_DEBUG "_OSC FW not grant req. control\n"); |