aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/bus.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2008-10-22 23:19:50 -0400
committerLen Brown <len.brown@intel.com>2008-10-22 23:19:50 -0400
commit955ba395616a78780e70dc3f3b0b56ca4db52e5c (patch)
treef5978cfdc2b5ede82445de6675301a0171e66ea0 /drivers/acpi/bus.c
parentaa58329fc8ec50b379388fcad55f62c3493730d3 (diff)
parent383d7a11c9989205db44c7f1be339e5097062f03 (diff)
Merge branch 'bugfixes' into test
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r--drivers/acpi/bus.c53
1 files changed, 43 insertions, 10 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index ccae305ee55d..e9b116d2b56d 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -48,6 +48,23 @@ EXPORT_SYMBOL(acpi_root_dir);
48 48
49#define STRUCT_TO_INT(s) (*((int*)&s)) 49#define STRUCT_TO_INT(s) (*((int*)&s))
50 50
51static int set_power_nocheck(const struct dmi_system_id *id)
52{
53 printk(KERN_NOTICE PREFIX "%s detected - "
54 "disable power check in power transistion\n", id->ident);
55 acpi_power_nocheck = 1;
56 return 0;
57}
58static struct dmi_system_id __cpuinitdata power_nocheck_dmi_table[] = {
59 {
60 set_power_nocheck, "HP Pavilion 05", {
61 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
62 DMI_MATCH(DMI_SYS_VENDOR, "HP Pavilion 05"),
63 DMI_MATCH(DMI_PRODUCT_VERSION, "2001211RE101GLEND") }, NULL},
64 {},
65};
66
67
51/* -------------------------------------------------------------------------- 68/* --------------------------------------------------------------------------
52 Device Management 69 Device Management
53 -------------------------------------------------------------------------- */ 70 -------------------------------------------------------------------------- */
@@ -95,21 +112,21 @@ int acpi_bus_get_status(struct acpi_device *device)
95 } 112 }
96 113
97 /* 114 /*
98 * Otherwise we assume the status of our parent (unless we don't 115 * According to ACPI spec some device can be present and functional
99 * have one, in which case status is implied). 116 * even if the parent is not present but functional.
117 * In such conditions the child device should not inherit the status
118 * from the parent.
100 */ 119 */
101 else if (device->parent)
102 device->status = device->parent->status;
103 else 120 else
104 STRUCT_TO_INT(device->status) = 121 STRUCT_TO_INT(device->status) =
105 ACPI_STA_DEVICE_PRESENT | ACPI_STA_DEVICE_ENABLED | 122 ACPI_STA_DEVICE_PRESENT | ACPI_STA_DEVICE_ENABLED |
106 ACPI_STA_DEVICE_UI | ACPI_STA_DEVICE_FUNCTIONING; 123 ACPI_STA_DEVICE_UI | ACPI_STA_DEVICE_FUNCTIONING;
107 124
108 if (device->status.functional && !device->status.present) { 125 if (device->status.functional && !device->status.present) {
109 printk(KERN_WARNING PREFIX "Device [%s] status [%08x]: " 126 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]: "
110 "functional but not present; setting present\n", 127 "functional but not present;\n",
111 device->pnp.bus_id, (u32) STRUCT_TO_INT(device->status)); 128 device->pnp.bus_id,
112 device->status.present = 1; 129 (u32) STRUCT_TO_INT(device->status)));
113 } 130 }
114 131
115 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n", 132 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n",
@@ -223,7 +240,19 @@ int acpi_bus_set_power(acpi_handle handle, int state)
223 /* 240 /*
224 * Get device's current power state 241 * Get device's current power state
225 */ 242 */
226 acpi_bus_get_power(device->handle, &device->power.state); 243 if (!acpi_power_nocheck) {
244 /*
245 * Maybe the incorrect power state is returned on the bogus
246 * bios, which is different with the real power state.
247 * For example: the bios returns D0 state and the real power
248 * state is D3. OS expects to set the device to D0 state. In
249 * such case if OS uses the power state returned by the BIOS,
250 * the device can't be transisted to the correct power state.
251 * So if the acpi_power_nocheck is set, it is unnecessary to
252 * get the power state by calling acpi_bus_get_power.
253 */
254 acpi_bus_get_power(device->handle, &device->power.state);
255 }
227 if ((state == device->power.state) && !device->flags.force_power_state) { 256 if ((state == device->power.state) && !device->flags.force_power_state) {
228 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", 257 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
229 state)); 258 state));
@@ -818,7 +847,11 @@ static int __init acpi_init(void)
818 } 847 }
819 } else 848 } else
820 disable_acpi(); 849 disable_acpi();
821 850 /*
851 * If the laptop falls into the DMI check table, the power state check
852 * will be disabled in the course of device power transistion.
853 */
854 dmi_check_system(power_nocheck_dmi_table);
822 return result; 855 return result;
823} 856}
824 857