]> err.no Git - linux-2.6/blobdiff - drivers/acpi/events/evgpe.c
ACPICA: Eliminate acpi_native_uint type v2
[linux-2.6] / drivers / acpi / events / evgpe.c
index 0dadd2adc8001a109669b4ae62c673da60f4747b..c5e53aae86f7c53385f48ec2b30bc47178ed8d45 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2007, R. Byron Moore
+ * Copyright (C) 2000 - 2008, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -248,10 +248,6 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
 
        ACPI_FUNCTION_TRACE(ev_disable_gpe);
 
-       if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
-               return_ACPI_STATUS(AE_OK);
-       }
-
        /* Make sure HW enable masks are updated */
 
        status =
@@ -260,7 +256,7 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
                return_ACPI_STATUS(status);
        }
 
-       /* Mark wake-disabled or HW disable, or both */
+       /* Clear the appropriate enabled flags for this GPE */
 
        switch (gpe_event_info->flags & ACPI_GPE_TYPE_MASK) {
        case ACPI_GPE_TYPE_WAKE:
@@ -277,13 +273,23 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
                /* Disable the requested runtime GPE */
 
                ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_RUN_ENABLED);
-
-               /* fallthrough */
+               break;
 
        default:
-               acpi_hw_write_gpe_enable_reg(gpe_event_info);
+               break;
        }
 
+       /*
+        * Even if we don't know the GPE type, make sure that we always
+        * disable it. low_disable_gpe will just clear the enable bit for this
+        * GPE and write it. It will not write out the current GPE enable mask,
+        * since this may inadvertently enable GPEs too early, if a rogue GPE has
+        * come in during ACPICA initialization - possibly as a result of AML or
+        * other code that has enabled the GPE.
+        */
+       status = acpi_hw_low_disable_gpe(gpe_event_info);
+       return_ACPI_STATUS(status);
+
        return_ACPI_STATUS(AE_OK);
 }
 
@@ -309,7 +315,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
 {
        union acpi_operand_object *obj_desc;
        struct acpi_gpe_block_info *gpe_block;
-       acpi_native_uint i;
+       u32 i;
 
        ACPI_FUNCTION_ENTRY();
 
@@ -383,8 +389,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
        u32 status_reg;
        u32 enable_reg;
        acpi_cpu_flags flags;
-       acpi_native_uint i;
-       acpi_native_uint j;
+       u32 i;
+       u32 j;
 
        ACPI_FUNCTION_NAME(ev_gpe_detect);
 
@@ -466,13 +472,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
                                         */
                                        int_status |=
                                            acpi_ev_gpe_dispatch(&gpe_block->
-                                                                event_info[(i *
-                                                                            ACPI_GPE_REGISTER_WIDTH)
-                                                                           +
-                                                                           j],
-                                                                (u32) j +
-                                                                gpe_register_info->
-                                                                base_gpe_number);
+                                               event_info[((acpi_size) i * ACPI_GPE_REGISTER_WIDTH) + j], j + gpe_register_info->base_gpe_number);
                                }
                        }
                }
@@ -559,10 +559,6 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
                         */
                        info->prefix_node =
                            local_gpe_event_info.dispatch.method_node;
-                       info->parameters =
-                           ACPI_CAST_PTR(union acpi_operand_object *,
-                                         gpe_event_info);
-                       info->parameter_type = ACPI_PARAM_GPE;
                        info->flags = ACPI_IGNORE_RETURN_VALUE;
 
                        status = acpi_ns_evaluate(info);