aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2011-02-14 03:13:25 -0500
committerLen Brown <len.brown@intel.com>2011-03-02 19:38:06 -0500
commitef09c4f578147464524041cbe3205bb25f900598 (patch)
treec4270c7cf7f257fad6d8e8e7f5107c54f9d9b8d6 /drivers/acpi
parent47863b9cbec29f137b3a7718ec851be879b41137 (diff)
ACPICA: Add mechanism to defer _REG methods for some installed handlers
The memory/io/pci/dataTable regions must always be available. For any user installed handlers for these spaces, defer execution of _REG methods until acpi_enable_subsystem. This prevents any chicken/egg problems and ensures that no methods are executed until all of these regions are ready and available. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpica/acglobal.h4
-rw-r--r--drivers/acpi/acpica/evregion.c2
-rw-r--r--drivers/acpi/acpica/evxfregn.c34
-rw-r--r--drivers/acpi/acpica/utglobal.c1
4 files changed, 39 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 82a1bd283db8..d69750b83b36 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -273,6 +273,10 @@ ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS];
273ACPI_EXTERN u8 acpi_gbl_last_owner_id_index; 273ACPI_EXTERN u8 acpi_gbl_last_owner_id_index;
274ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset; 274ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset;
275 275
276/* Initialization sequencing */
277
278ACPI_EXTERN u8 acpi_gbl_reg_methods_executed;
279
276/* Misc */ 280/* Misc */
277 281
278ACPI_EXTERN u32 acpi_gbl_original_mode; 282ACPI_EXTERN u32 acpi_gbl_original_mode;
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index 785a5ee64585..bea7223d7a71 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -231,6 +231,8 @@ acpi_status acpi_ev_initialize_op_regions(void)
231 } 231 }
232 } 232 }
233 233
234 acpi_gbl_reg_methods_executed = TRUE;
235
234 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 236 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
235 return_ACPI_STATUS(status); 237 return_ACPI_STATUS(status);
236} 238}
diff --git a/drivers/acpi/acpica/evxfregn.c b/drivers/acpi/acpica/evxfregn.c
index eb7386763712..c85c8c45599d 100644
--- a/drivers/acpi/acpica/evxfregn.c
+++ b/drivers/acpi/acpica/evxfregn.c
@@ -110,9 +110,39 @@ acpi_install_address_space_handler(acpi_handle device,
110 goto unlock_and_exit; 110 goto unlock_and_exit;
111 } 111 }
112 112
113 /* Run all _REG methods for this address space */ 113 /*
114 * For the default space_iDs, (the IDs for which there are default region handlers
115 * installed) Only execute the _REG methods if the global initialization _REG
116 * methods have already been run (via acpi_initialize_objects). In other words,
117 * we will defer the execution of the _REG methods for these space_iDs until
118 * execution of acpi_initialize_objects. This is done because we need the handlers
119 * for the default spaces (mem/io/pci/table) to be installed before we can run
120 * any control methods (or _REG methods). There is known BIOS code that depends
121 * on this.
122 *
123 * For all other space_iDs, we can safely execute the _REG methods immediately.
124 * This means that for IDs like embedded_controller, this function should be called
125 * only after acpi_enable_subsystem has been called.
126 */
127 switch (space_id) {
128 case ACPI_ADR_SPACE_SYSTEM_MEMORY:
129 case ACPI_ADR_SPACE_SYSTEM_IO:
130 case ACPI_ADR_SPACE_PCI_CONFIG:
131 case ACPI_ADR_SPACE_DATA_TABLE:
132
133 if (acpi_gbl_reg_methods_executed) {
134
135 /* Run all _REG methods for this address space */
136
137 status = acpi_ev_execute_reg_methods(node, space_id);
138 }
139 break;
140
141 default:
114 142
115 status = acpi_ev_execute_reg_methods(node, space_id); 143 status = acpi_ev_execute_reg_methods(node, space_id);
144 break;
145 }
116 146
117 unlock_and_exit: 147 unlock_and_exit:
118 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 148 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index fc9097821516..833a38a9c905 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -323,6 +323,7 @@ acpi_status acpi_ut_init_globals(void)
323 acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT; 323 acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;
324 acpi_gbl_osi_data = 0; 324 acpi_gbl_osi_data = 0;
325 acpi_gbl_osi_mutex = NULL; 325 acpi_gbl_osi_mutex = NULL;
326 acpi_gbl_reg_methods_executed = FALSE;
326 327
327 /* Hardware oriented */ 328 /* Hardware oriented */
328 329