aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/evgpeinit.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-09-15 18:30:43 -0400
committerLen Brown <len.brown@intel.com>2010-09-24 16:55:47 -0400
commita210080195c95ebca2a517ee3057d71607aa65e0 (patch)
tree96aa2aee4b9bdbc747b7a0d7150d0b41650ebe90 /drivers/acpi/acpica/evgpeinit.c
parent2422084a94fcd5038406261b331672a13c92c050 (diff)
ACPI / ACPICA: Defer enabling of runtime GPEs (v3)
The current ACPI GPEs initialization code has a problem that it enables some GPEs pointed to by device _PRW methods, generally intended for signaling wakeup events (system or device wakeup). These GPEs are then almost immediately disabled by the ACPI namespace scanning code with the help of acpi_gpe_can_wake(), but it would be better not to enable them at all until really necessary. Modify the initialization of GPEs so that the ones that have associated _Lxx or _Exx methods and are not pointed to by any _PRW methods will be enabled after the namespace scan is complete. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/evgpeinit.c')
-rw-r--r--drivers/acpi/acpica/evgpeinit.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index 3084c5de1bba..2c7def95f721 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -210,8 +210,7 @@ acpi_status acpi_ev_gpe_initialize(void)
210 * 210 *
211 * DESCRIPTION: Check for new GPE methods (_Lxx/_Exx) made available as a 211 * DESCRIPTION: Check for new GPE methods (_Lxx/_Exx) made available as a
212 * result of a Load() or load_table() operation. If new GPE 212 * result of a Load() or load_table() operation. If new GPE
213 * methods have been installed, register the new methods and 213 * methods have been installed, register the new methods.
214 * enable and runtime GPEs that are associated with them.
215 * 214 *
216 ******************************************************************************/ 215 ******************************************************************************/
217 216
@@ -239,7 +238,6 @@ void acpi_ev_update_gpes(acpi_owner_id table_owner_id)
239 walk_info.owner_id = table_owner_id; 238 walk_info.owner_id = table_owner_id;
240 walk_info.execute_by_owner_id = TRUE; 239 walk_info.execute_by_owner_id = TRUE;
241 walk_info.count = 0; 240 walk_info.count = 0;
242 walk_info.enable_this_gpe = TRUE;
243 241
244 /* Walk the interrupt level descriptor list */ 242 /* Walk the interrupt level descriptor list */
245 243
@@ -301,8 +299,6 @@ void acpi_ev_update_gpes(acpi_owner_id table_owner_id)
301 * 299 *
302 * If walk_info->execute_by_owner_id is TRUE, we only execute examine GPE methods 300 * If walk_info->execute_by_owner_id is TRUE, we only execute examine GPE methods
303 * with that owner. 301 * with that owner.
304 * If walk_info->enable_this_gpe is TRUE, the GPE that is referred to by a GPE
305 * method is immediately enabled (Used for Load/load_table operators)
306 * 302 *
307 ******************************************************************************/ 303 ******************************************************************************/
308 304
@@ -315,8 +311,6 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,
315 struct acpi_gpe_walk_info *walk_info = 311 struct acpi_gpe_walk_info *walk_info =
316 ACPI_CAST_PTR(struct acpi_gpe_walk_info, context); 312 ACPI_CAST_PTR(struct acpi_gpe_walk_info, context);
317 struct acpi_gpe_event_info *gpe_event_info; 313 struct acpi_gpe_event_info *gpe_event_info;
318 struct acpi_namespace_node *gpe_device;
319 acpi_status status;
320 u32 gpe_number; 314 u32 gpe_number;
321 char name[ACPI_NAME_SIZE + 1]; 315 char name[ACPI_NAME_SIZE + 1];
322 u8 type; 316 u8 type;
@@ -421,29 +415,6 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,
421 gpe_event_info->flags |= (u8)(type | ACPI_GPE_DISPATCH_METHOD); 415 gpe_event_info->flags |= (u8)(type | ACPI_GPE_DISPATCH_METHOD);
422 gpe_event_info->dispatch.method_node = method_node; 416 gpe_event_info->dispatch.method_node = method_node;
423 417
424 /*
425 * Enable this GPE if requested. This only happens when during the
426 * execution of a Load or load_table operator. We have found a new
427 * GPE method and want to immediately enable the GPE if it is a
428 * runtime GPE.
429 */
430 if (walk_info->enable_this_gpe) {
431
432 walk_info->count++;
433 gpe_device = walk_info->gpe_device;
434
435 if (gpe_device == acpi_gbl_fadt_gpe_device) {
436 gpe_device = NULL;
437 }
438
439 status = acpi_enable_gpe(gpe_device, gpe_number);
440 if (ACPI_FAILURE(status)) {
441 ACPI_EXCEPTION((AE_INFO, status,
442 "Could not enable GPE 0x%02X",
443 gpe_number));
444 }
445 }
446
447 ACPI_DEBUG_PRINT((ACPI_DB_LOAD, 418 ACPI_DEBUG_PRINT((ACPI_DB_LOAD,
448 "Registered GPE method %s as GPE number 0x%.2X\n", 419 "Registered GPE method %s as GPE number 0x%.2X\n",
449 name, gpe_number)); 420 name, gpe_number));