aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/kernel-parameters.txt55
-rw-r--r--drivers/acpi/bus.c53
-rw-r--r--drivers/acpi/pci_link.c4
-rw-r--r--drivers/acpi/power.c68
-rw-r--r--drivers/acpi/scan.c62
-rw-r--r--drivers/acpi/wmi.c10
-rw-r--r--drivers/misc/acer-wmi.c10
-rw-r--r--drivers/pnp/pnpacpi/core.c6
-rw-r--r--include/acpi/acpi_drivers.h1
9 files changed, 183 insertions, 86 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 1150444a21ab..99cf83fd6947 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -217,20 +217,47 @@ and is between 256 and 4096 characters. It is defined in the file
217 acpi.debug_level= [HW,ACPI] 217 acpi.debug_level= [HW,ACPI]
218 Format: <int> 218 Format: <int>
219 Each bit of the <int> indicates an ACPI debug level, 219 Each bit of the <int> indicates an ACPI debug level,
220 1: enable, 0: disable. It is useful for boot time 220 which corresponds to the level in an ACPI_DEBUG_PRINT
221 debugging. After system has booted up, it can be set 221 statement. After system has booted up, this mask
222 via /sys/module/acpi/parameters/debug_level. 222 can be set via /sys/module/acpi/parameters/debug_level.
223 CONFIG_ACPI_DEBUG must be enabled for this to produce any output. 223
224 Available bits (add the numbers together) to enable different 224 CONFIG_ACPI_DEBUG must be enabled for this to produce
225 debug output levels of the ACPI subsystem: 225 any output. The number can be in decimal or prefixed
226 0x01 error 0x02 warn 0x04 init 0x08 debug object 226 with 0x in hex. Some of these options produce so much
227 0x10 info 0x20 init names 0x40 parse 0x80 load 227 output that the system is unusable.
228 0x100 dispatch 0x200 execute 0x400 names 0x800 operation region 228
229 0x1000 bfield 0x2000 tables 0x4000 values 0x8000 objects 229 The following global components are defined by the
230 0x10000 resources 0x20000 user requests 0x40000 package. 230 ACPI CA:
231 The number can be in decimal or prefixed with 0x in hex. 231 0x01 error
232 Warning: Many of these options can produce a lot of 232 0x02 warn
233 output and make your system unusable. Be very careful. 233 0x04 init
234 0x08 debug object
235 0x10 info
236 0x20 init names
237 0x40 parse
238 0x80 load
239 0x100 dispatch
240 0x200 execute
241 0x400 names
242 0x800 operation region
243 0x1000 bfield
244 0x2000 tables
245 0x4000 values
246 0x8000 objects
247 0x10000 resources
248 0x20000 user requests
249 0x40000 package
250 The number can be in decimal or prefixed with 0x in hex.
251 Warning: Many of these options can produce a lot of
252 output and make your system unusable. Be very careful.
253
254 acpi.power_nocheck= [HW,ACPI]
255 Format: 1/0 enable/disable the check of power state.
256 On some bogus BIOS the _PSC object/_STA object of
257 power resource can't return the correct device power
258 state. In such case it is unneccessary to check its
259 power state again in power transition.
260 1 : disable the power state check
234 261
235 acpi_pm_good [X86-32,X86-64] 262 acpi_pm_good [X86-32,X86-64]
236 Override the pmtimer bug detection: force the kernel 263 Override the pmtimer bug detection: force the kernel
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
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index cf47805a7448..65bf4fa59633 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -709,7 +709,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
709 acpi_device_bid(link->device))); 709 acpi_device_bid(link->device)));
710 710
711 if (link->refcnt == 0) { 711 if (link->refcnt == 0) {
712 acpi_ut_evaluate_object(link->device->handle, "_DIS", 0, NULL); 712 acpi_evaluate_object(link->device->handle, "_DIS", NULL, NULL);
713 } 713 }
714 mutex_unlock(&acpi_link_lock); 714 mutex_unlock(&acpi_link_lock);
715 return (link->irq.active); 715 return (link->irq.active);
@@ -773,7 +773,7 @@ static int acpi_pci_link_add(struct acpi_device *device)
773 773
774 end: 774 end:
775 /* disable all links -- to be activated on use */ 775 /* disable all links -- to be activated on use */
776 acpi_ut_evaluate_object(device->handle, "_DIS", 0, NULL); 776 acpi_evaluate_object(device->handle, "_DIS", NULL, NULL);
777 mutex_unlock(&acpi_link_lock); 777 mutex_unlock(&acpi_link_lock);
778 778
779 if (result) 779 if (result)
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 4ab21cb1c8c7..7ff7349c0c52 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -54,6 +54,14 @@ ACPI_MODULE_NAME("power");
54#define ACPI_POWER_RESOURCE_STATE_OFF 0x00 54#define ACPI_POWER_RESOURCE_STATE_OFF 0x00
55#define ACPI_POWER_RESOURCE_STATE_ON 0x01 55#define ACPI_POWER_RESOURCE_STATE_ON 0x01
56#define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF 56#define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF
57
58#ifdef MODULE_PARAM_PREFIX
59#undef MODULE_PARAM_PREFIX
60#endif
61#define MODULE_PARAM_PREFIX "acpi."
62int acpi_power_nocheck;
63module_param_named(power_nocheck, acpi_power_nocheck, bool, 000);
64
57static int acpi_power_add(struct acpi_device *device); 65static int acpi_power_add(struct acpi_device *device);
58static int acpi_power_remove(struct acpi_device *device, int type); 66static int acpi_power_remove(struct acpi_device *device, int type);
59static int acpi_power_resume(struct acpi_device *device); 67static int acpi_power_resume(struct acpi_device *device);
@@ -128,16 +136,16 @@ acpi_power_get_context(acpi_handle handle,
128 return 0; 136 return 0;
129} 137}
130 138
131static int acpi_power_get_state(struct acpi_power_resource *resource, int *state) 139static int acpi_power_get_state(acpi_handle handle, int *state)
132{ 140{
133 acpi_status status = AE_OK; 141 acpi_status status = AE_OK;
134 unsigned long sta = 0; 142 unsigned long sta = 0;
135 143
136 144
137 if (!resource || !state) 145 if (!handle || !state)
138 return -EINVAL; 146 return -EINVAL;
139 147
140 status = acpi_evaluate_integer(resource->device->handle, "_STA", NULL, &sta); 148 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
141 if (ACPI_FAILURE(status)) 149 if (ACPI_FAILURE(status))
142 return -ENODEV; 150 return -ENODEV;
143 151
@@ -145,7 +153,7 @@ static int acpi_power_get_state(struct acpi_power_resource *resource, int *state
145 ACPI_POWER_RESOURCE_STATE_OFF; 153 ACPI_POWER_RESOURCE_STATE_OFF;
146 154
147 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n", 155 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
148 resource->name, state ? "on" : "off")); 156 acpi_ut_get_node_name(handle), state ? "on" : "off"));
149 157
150 return 0; 158 return 0;
151} 159}
@@ -153,7 +161,6 @@ static int acpi_power_get_state(struct acpi_power_resource *resource, int *state
153static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state) 161static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
154{ 162{
155 int result = 0, state1; 163 int result = 0, state1;
156 struct acpi_power_resource *resource = NULL;
157 u32 i = 0; 164 u32 i = 0;
158 165
159 166
@@ -161,12 +168,15 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
161 return -EINVAL; 168 return -EINVAL;
162 169
163 /* The state of the list is 'on' IFF all resources are 'on'. */ 170 /* The state of the list is 'on' IFF all resources are 'on'. */
171 /* */
164 172
165 for (i = 0; i < list->count; i++) { 173 for (i = 0; i < list->count; i++) {
166 result = acpi_power_get_context(list->handles[i], &resource); 174 /*
167 if (result) 175 * The state of the power resource can be obtained by
168 return result; 176 * using the ACPI handle. In such case it is unnecessary to
169 result = acpi_power_get_state(resource, &state1); 177 * get the Power resource first and then get its state again.
178 */
179 result = acpi_power_get_state(list->handles[i], &state1);
170 if (result) 180 if (result)
171 return result; 181 return result;
172 182
@@ -226,12 +236,18 @@ static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
226 if (ACPI_FAILURE(status)) 236 if (ACPI_FAILURE(status))
227 return -ENODEV; 237 return -ENODEV;
228 238
229 result = acpi_power_get_state(resource, &state); 239 if (!acpi_power_nocheck) {
230 if (result) 240 /*
231 return result; 241 * If acpi_power_nocheck is set, it is unnecessary to check
232 if (state != ACPI_POWER_RESOURCE_STATE_ON) 242 * the power state after power transition.
233 return -ENOEXEC; 243 */
234 244 result = acpi_power_get_state(resource->device->handle,
245 &state);
246 if (result)
247 return result;
248 if (state != ACPI_POWER_RESOURCE_STATE_ON)
249 return -ENOEXEC;
250 }
235 /* Update the power resource's _device_ power state */ 251 /* Update the power resource's _device_ power state */
236 resource->device->power.state = ACPI_STATE_D0; 252 resource->device->power.state = ACPI_STATE_D0;
237 253
@@ -277,11 +293,17 @@ static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
277 if (ACPI_FAILURE(status)) 293 if (ACPI_FAILURE(status))
278 return -ENODEV; 294 return -ENODEV;
279 295
280 result = acpi_power_get_state(resource, &state); 296 if (!acpi_power_nocheck) {
281 if (result) 297 /*
282 return result; 298 * If acpi_power_nocheck is set, it is unnecessary to check
283 if (state != ACPI_POWER_RESOURCE_STATE_OFF) 299 * the power state after power transition.
284 return -ENOEXEC; 300 */
301 result = acpi_power_get_state(handle, &state);
302 if (result)
303 return result;
304 if (state != ACPI_POWER_RESOURCE_STATE_OFF)
305 return -ENOEXEC;
306 }
285 307
286 /* Update the power resource's _device_ power state */ 308 /* Update the power resource's _device_ power state */
287 resource->device->power.state = ACPI_STATE_D3; 309 resource->device->power.state = ACPI_STATE_D3;
@@ -555,7 +577,7 @@ static int acpi_power_seq_show(struct seq_file *seq, void *offset)
555 if (!resource) 577 if (!resource)
556 goto end; 578 goto end;
557 579
558 result = acpi_power_get_state(resource, &state); 580 result = acpi_power_get_state(resource->device->handle, &state);
559 if (result) 581 if (result)
560 goto end; 582 goto end;
561 583
@@ -668,7 +690,7 @@ static int acpi_power_add(struct acpi_device *device)
668 resource->system_level = acpi_object.power_resource.system_level; 690 resource->system_level = acpi_object.power_resource.system_level;
669 resource->order = acpi_object.power_resource.resource_order; 691 resource->order = acpi_object.power_resource.resource_order;
670 692
671 result = acpi_power_get_state(resource, &state); 693 result = acpi_power_get_state(device->handle, &state);
672 if (result) 694 if (result)
673 goto end; 695 goto end;
674 696
@@ -735,7 +757,7 @@ static int acpi_power_resume(struct acpi_device *device)
735 757
736 resource = (struct acpi_power_resource *)acpi_driver_data(device); 758 resource = (struct acpi_power_resource *)acpi_driver_data(device);
737 759
738 result = acpi_power_get_state(resource, &state); 760 result = acpi_power_get_state(device->handle, &state);
739 if (result) 761 if (result)
740 return result; 762 return result;
741 763
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index f6f52c1a2aba..91fed422bae8 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -276,6 +276,13 @@ int acpi_match_device_ids(struct acpi_device *device,
276{ 276{
277 const struct acpi_device_id *id; 277 const struct acpi_device_id *id;
278 278
279 /*
280 * If the device is not present, it is unnecessary to load device
281 * driver for it.
282 */
283 if (!device->status.present)
284 return -ENODEV;
285
279 if (device->flags.hardware_id) { 286 if (device->flags.hardware_id) {
280 for (id = ids; id->id[0]; id++) { 287 for (id = ids; id->id[0]; id++) {
281 if (!strcmp((char*)id->id, device->pnp.hardware_id)) 288 if (!strcmp((char*)id->id, device->pnp.hardware_id))
@@ -807,6 +814,7 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
807 /* TBD: System wake support and resource requirements. */ 814 /* TBD: System wake support and resource requirements. */
808 815
809 device->power.state = ACPI_STATE_UNKNOWN; 816 device->power.state = ACPI_STATE_UNKNOWN;
817 acpi_bus_get_power(device->handle, &(device->power.state));
810 818
811 return 0; 819 return 0;
812} 820}
@@ -1153,20 +1161,6 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
1153} 1161}
1154 1162
1155static int 1163static int
1156acpi_is_child_device(struct acpi_device *device,
1157 int (*matcher)(struct acpi_device *))
1158{
1159 int result = -ENODEV;
1160
1161 do {
1162 if (ACPI_SUCCESS(matcher(device)))
1163 return AE_OK;
1164 } while ((device = device->parent));
1165
1166 return result;
1167}
1168
1169static int
1170acpi_add_single_object(struct acpi_device **child, 1164acpi_add_single_object(struct acpi_device **child,
1171 struct acpi_device *parent, acpi_handle handle, int type, 1165 struct acpi_device *parent, acpi_handle handle, int type,
1172 struct acpi_bus_ops *ops) 1166 struct acpi_bus_ops *ops)
@@ -1221,15 +1215,18 @@ acpi_add_single_object(struct acpi_device **child,
1221 result = -ENODEV; 1215 result = -ENODEV;
1222 goto end; 1216 goto end;
1223 } 1217 }
1224 if (!device->status.present) { 1218 /*
1225 /* Bay and dock should be handled even if absent */ 1219 * When the device is neither present nor functional, the
1226 if (!ACPI_SUCCESS( 1220 * device should not be added to Linux ACPI device tree.
1227 acpi_is_child_device(device, acpi_bay_match)) && 1221 * When the status of the device is not present but functinal,
1228 !ACPI_SUCCESS( 1222 * it should be added to Linux ACPI tree. For example : bay
1229 acpi_is_child_device(device, acpi_dock_match))) { 1223 * device , dock device.
1230 result = -ENODEV; 1224 * In such conditions it is unncessary to check whether it is
1231 goto end; 1225 * bay device or dock device.
1232 } 1226 */
1227 if (!device->status.present && !device->status.functional) {
1228 result = -ENODEV;
1229 goto end;
1233 } 1230 }
1234 break; 1231 break;
1235 default: 1232 default:
@@ -1252,6 +1249,16 @@ acpi_add_single_object(struct acpi_device **child,
1252 acpi_device_set_id(device, parent, handle, type); 1249 acpi_device_set_id(device, parent, handle, type);
1253 1250
1254 /* 1251 /*
1252 * The ACPI device is attached to acpi handle before getting
1253 * the power/wakeup/peformance flags. Otherwise OS can't get
1254 * the corresponding ACPI device by the acpi handle in the course
1255 * of getting the power/wakeup/performance flags.
1256 */
1257 result = acpi_device_set_context(device, type);
1258 if (result)
1259 goto end;
1260
1261 /*
1255 * Power Management 1262 * Power Management
1256 * ---------------- 1263 * ----------------
1257 */ 1264 */
@@ -1281,8 +1288,6 @@ acpi_add_single_object(struct acpi_device **child,
1281 goto end; 1288 goto end;
1282 } 1289 }
1283 1290
1284 if ((result = acpi_device_set_context(device, type)))
1285 goto end;
1286 1291
1287 result = acpi_device_register(device, parent); 1292 result = acpi_device_register(device, parent);
1288 1293
@@ -1402,7 +1407,12 @@ static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops)
1402 * TBD: Need notifications and other detection mechanisms 1407 * TBD: Need notifications and other detection mechanisms
1403 * in place before we can fully implement this. 1408 * in place before we can fully implement this.
1404 */ 1409 */
1405 if (child->status.present) { 1410 /*
1411 * When the device is not present but functional, it is also
1412 * necessary to scan the children of this device.
1413 */
1414 if (child->status.present || (!child->status.present &&
1415 child->status.functional)) {
1406 status = acpi_get_next_object(ACPI_TYPE_ANY, chandle, 1416 status = acpi_get_next_object(ACPI_TYPE_ANY, chandle,
1407 NULL, NULL); 1417 NULL, NULL);
1408 if (ACPI_SUCCESS(status)) { 1418 if (ACPI_SUCCESS(status)) {
diff --git a/drivers/acpi/wmi.c b/drivers/acpi/wmi.c
index 5464cfcf8297..47cd7baf9b1b 100644
--- a/drivers/acpi/wmi.c
+++ b/drivers/acpi/wmi.c
@@ -271,7 +271,7 @@ u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
271 char method[4] = "WM"; 271 char method[4] = "WM";
272 272
273 if (!find_guid(guid_string, &wblock)) 273 if (!find_guid(guid_string, &wblock))
274 return AE_BAD_ADDRESS; 274 return AE_ERROR;
275 275
276 block = &wblock->gblock; 276 block = &wblock->gblock;
277 handle = wblock->handle; 277 handle = wblock->handle;
@@ -333,7 +333,7 @@ struct acpi_buffer *out)
333 return AE_BAD_PARAMETER; 333 return AE_BAD_PARAMETER;
334 334
335 if (!find_guid(guid_string, &wblock)) 335 if (!find_guid(guid_string, &wblock))
336 return AE_BAD_ADDRESS; 336 return AE_ERROR;
337 337
338 block = &wblock->gblock; 338 block = &wblock->gblock;
339 handle = wblock->handle; 339 handle = wblock->handle;
@@ -343,7 +343,7 @@ struct acpi_buffer *out)
343 343
344 /* Check GUID is a data block */ 344 /* Check GUID is a data block */
345 if (block->flags & (ACPI_WMI_EVENT | ACPI_WMI_METHOD)) 345 if (block->flags & (ACPI_WMI_EVENT | ACPI_WMI_METHOD))
346 return AE_BAD_ADDRESS; 346 return AE_ERROR;
347 347
348 input.count = 1; 348 input.count = 1;
349 input.pointer = wq_params; 349 input.pointer = wq_params;
@@ -414,7 +414,7 @@ const struct acpi_buffer *in)
414 return AE_BAD_DATA; 414 return AE_BAD_DATA;
415 415
416 if (!find_guid(guid_string, &wblock)) 416 if (!find_guid(guid_string, &wblock))
417 return AE_BAD_ADDRESS; 417 return AE_ERROR;
418 418
419 block = &wblock->gblock; 419 block = &wblock->gblock;
420 handle = wblock->handle; 420 handle = wblock->handle;
@@ -424,7 +424,7 @@ const struct acpi_buffer *in)
424 424
425 /* Check GUID is a data block */ 425 /* Check GUID is a data block */
426 if (block->flags & (ACPI_WMI_EVENT | ACPI_WMI_METHOD)) 426 if (block->flags & (ACPI_WMI_EVENT | ACPI_WMI_METHOD))
427 return AE_BAD_ADDRESS; 427 return AE_ERROR;
428 428
429 input.count = 2; 429 input.count = 2;
430 input.pointer = params; 430 input.pointer = params;
diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c
index cf4c39fbc66f..0532a2de2ce4 100644
--- a/drivers/misc/acer-wmi.c
+++ b/drivers/misc/acer-wmi.c
@@ -473,7 +473,7 @@ struct wmi_interface *iface)
473 } 473 }
474 break; 474 break;
475 default: 475 default:
476 return AE_BAD_ADDRESS; 476 return AE_ERROR;
477 } 477 }
478 return AE_OK; 478 return AE_OK;
479} 479}
@@ -511,7 +511,7 @@ static acpi_status AMW0_set_u32(u32 value, u32 cap, struct wmi_interface *iface)
511 break; 511 break;
512 } 512 }
513 default: 513 default:
514 return AE_BAD_ADDRESS; 514 return AE_ERROR;
515 } 515 }
516 516
517 /* Actually do the set */ 517 /* Actually do the set */
@@ -686,7 +686,7 @@ struct wmi_interface *iface)
686 return 0; 686 return 0;
687 } 687 }
688 default: 688 default:
689 return AE_BAD_ADDRESS; 689 return AE_ERROR;
690 } 690 }
691 status = WMI_execute_u32(method_id, 0, &result); 691 status = WMI_execute_u32(method_id, 0, &result);
692 692
@@ -732,7 +732,7 @@ static acpi_status WMID_set_u32(u32 value, u32 cap, struct wmi_interface *iface)
732 } 732 }
733 break; 733 break;
734 default: 734 default:
735 return AE_BAD_ADDRESS; 735 return AE_ERROR;
736 } 736 }
737 return WMI_execute_u32(method_id, (u32)value, NULL); 737 return WMI_execute_u32(method_id, (u32)value, NULL);
738} 738}
@@ -782,7 +782,7 @@ static struct wmi_interface wmid_interface = {
782 782
783static acpi_status get_u32(u32 *value, u32 cap) 783static acpi_status get_u32(u32 *value, u32 cap)
784{ 784{
785 acpi_status status = AE_BAD_ADDRESS; 785 acpi_status status = AE_ERROR;
786 786
787 switch (interface->type) { 787 switch (interface->type) {
788 case ACER_AMW0: 788 case ACER_AMW0:
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index c1b9ea34977b..98b9df7776e9 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -148,9 +148,13 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
148 acpi_status status; 148 acpi_status status;
149 struct pnp_dev *dev; 149 struct pnp_dev *dev;
150 150
151 /*
152 * If a PnPacpi device is not present , the device
153 * driver should not be loaded.
154 */
151 status = acpi_get_handle(device->handle, "_CRS", &temp); 155 status = acpi_get_handle(device->handle, "_CRS", &temp);
152 if (ACPI_FAILURE(status) || !ispnpidacpi(acpi_device_hid(device)) || 156 if (ACPI_FAILURE(status) || !ispnpidacpi(acpi_device_hid(device)) ||
153 is_exclusive_device(device)) 157 is_exclusive_device(device) || (!device->status.present))
154 return 0; 158 return 0;
155 159
156 dev = pnp_alloc_dev(&pnpacpi_protocol, num, acpi_device_hid(device)); 160 dev = pnp_alloc_dev(&pnpacpi_protocol, num, acpi_device_hid(device));
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index e5f38e5ce86f..efbaa271ee11 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -93,6 +93,7 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int sleep_state);
93int acpi_disable_wakeup_device_power(struct acpi_device *dev); 93int acpi_disable_wakeup_device_power(struct acpi_device *dev);
94int acpi_power_get_inferred_state(struct acpi_device *device); 94int acpi_power_get_inferred_state(struct acpi_device *device);
95int acpi_power_transition(struct acpi_device *device, int state); 95int acpi_power_transition(struct acpi_device *device, int state);
96extern int acpi_power_nocheck;
96#endif 97#endif
97 98
98/* -------------------------------------------------------------------------- 99/* --------------------------------------------------------------------------