diff options
| -rw-r--r-- | drivers/acpi/acpica/tbdata.c | 9 | ||||
| -rw-r--r-- | drivers/acpi/acpica/tbinstal.c | 17 |
2 files changed, 17 insertions, 9 deletions
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c index 82b0b5710979..b0399e8f6d27 100644 --- a/drivers/acpi/acpica/tbdata.c +++ b/drivers/acpi/acpica/tbdata.c | |||
| @@ -852,23 +852,18 @@ acpi_tb_install_and_load_table(acpi_physical_address address, | |||
| 852 | 852 | ||
| 853 | ACPI_FUNCTION_TRACE(tb_install_and_load_table); | 853 | ACPI_FUNCTION_TRACE(tb_install_and_load_table); |
| 854 | 854 | ||
| 855 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
| 856 | |||
| 857 | /* Install the table and load it into the namespace */ | 855 | /* Install the table and load it into the namespace */ |
| 858 | 856 | ||
| 859 | status = acpi_tb_install_standard_table(address, flags, TRUE, | 857 | status = acpi_tb_install_standard_table(address, flags, TRUE, |
| 860 | override, &i); | 858 | override, &i); |
| 861 | if (ACPI_FAILURE(status)) { | 859 | if (ACPI_FAILURE(status)) { |
| 862 | goto unlock_and_exit; | 860 | goto exit; |
| 863 | } | 861 | } |
| 864 | 862 | ||
| 865 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
| 866 | status = acpi_tb_load_table(i, acpi_gbl_root_node); | 863 | status = acpi_tb_load_table(i, acpi_gbl_root_node); |
| 867 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
| 868 | 864 | ||
| 869 | unlock_and_exit: | 865 | exit: |
| 870 | *table_index = i; | 866 | *table_index = i; |
| 871 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
| 872 | return_ACPI_STATUS(status); | 867 | return_ACPI_STATUS(status); |
| 873 | } | 868 | } |
| 874 | 869 | ||
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index 5fdf251a9f97..01e1b3d63fc0 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c | |||
| @@ -217,6 +217,10 @@ acpi_tb_install_standard_table(acpi_physical_address address, | |||
| 217 | goto release_and_exit; | 217 | goto release_and_exit; |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | /* Acquire the table lock */ | ||
| 221 | |||
| 222 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
| 223 | |||
| 220 | if (reload) { | 224 | if (reload) { |
| 221 | /* | 225 | /* |
| 222 | * Validate the incoming table signature. | 226 | * Validate the incoming table signature. |
| @@ -244,7 +248,7 @@ acpi_tb_install_standard_table(acpi_physical_address address, | |||
| 244 | new_table_desc.signature.integer)); | 248 | new_table_desc.signature.integer)); |
| 245 | 249 | ||
| 246 | status = AE_BAD_SIGNATURE; | 250 | status = AE_BAD_SIGNATURE; |
| 247 | goto release_and_exit; | 251 | goto unlock_and_exit; |
| 248 | } | 252 | } |
| 249 | 253 | ||
| 250 | /* Check if table is already registered */ | 254 | /* Check if table is already registered */ |
| @@ -279,7 +283,7 @@ acpi_tb_install_standard_table(acpi_physical_address address, | |||
| 279 | /* Table is still loaded, this is an error */ | 283 | /* Table is still loaded, this is an error */ |
| 280 | 284 | ||
| 281 | status = AE_ALREADY_EXISTS; | 285 | status = AE_ALREADY_EXISTS; |
| 282 | goto release_and_exit; | 286 | goto unlock_and_exit; |
| 283 | } else { | 287 | } else { |
| 284 | /* | 288 | /* |
| 285 | * Table was unloaded, allow it to be reloaded. | 289 | * Table was unloaded, allow it to be reloaded. |
| @@ -290,6 +294,7 @@ acpi_tb_install_standard_table(acpi_physical_address address, | |||
| 290 | * indicate the re-installation. | 294 | * indicate the re-installation. |
| 291 | */ | 295 | */ |
| 292 | acpi_tb_uninstall_table(&new_table_desc); | 296 | acpi_tb_uninstall_table(&new_table_desc); |
| 297 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
| 293 | *table_index = i; | 298 | *table_index = i; |
| 294 | return_ACPI_STATUS(AE_OK); | 299 | return_ACPI_STATUS(AE_OK); |
| 295 | } | 300 | } |
| @@ -303,11 +308,19 @@ acpi_tb_install_standard_table(acpi_physical_address address, | |||
| 303 | 308 | ||
| 304 | /* Invoke table handler if present */ | 309 | /* Invoke table handler if present */ |
| 305 | 310 | ||
| 311 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
| 306 | if (acpi_gbl_table_handler) { | 312 | if (acpi_gbl_table_handler) { |
| 307 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_INSTALL, | 313 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_INSTALL, |
| 308 | new_table_desc.pointer, | 314 | new_table_desc.pointer, |
| 309 | acpi_gbl_table_handler_context); | 315 | acpi_gbl_table_handler_context); |
| 310 | } | 316 | } |
| 317 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
| 318 | |||
| 319 | unlock_and_exit: | ||
| 320 | |||
| 321 | /* Release the table lock */ | ||
| 322 | |||
| 323 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
| 311 | 324 | ||
| 312 | release_and_exit: | 325 | release_and_exit: |
| 313 | 326 | ||
