aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/tbinstal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/tbinstal.c')
-rw-r--r--drivers/acpi/acpica/tbinstal.c17
1 files changed, 15 insertions, 2 deletions
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
319unlock_and_exit:
320
321 /* Release the table lock */
322
323 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
311 324
312release_and_exit: 325release_and_exit:
313 326