diff options
author | Bob Moore <robert.moore@intel.com> | 2011-02-14 03:13:25 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-03-02 19:38:06 -0500 |
commit | ef09c4f578147464524041cbe3205bb25f900598 (patch) | |
tree | c4270c7cf7f257fad6d8e8e7f5107c54f9d9b8d6 /drivers/acpi/acpica/evxfregn.c | |
parent | 47863b9cbec29f137b3a7718ec851be879b41137 (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/acpica/evxfregn.c')
-rw-r--r-- | drivers/acpi/acpica/evxfregn.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/evxfregn.c b/drivers/acpi/acpica/evxfregn.c index eb738676371..c85c8c45599 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); |