aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2009-07-23 23:25:16 -0400
committerLen Brown <len.brown@intel.com>2009-08-28 19:40:38 -0400
commit2f977b36e5f175e5126f280e7a94f0c53d1b1a16 (patch)
treeeac8df3c29d855b0a5d830d55bea2037a78e2268 /drivers/acpi
parent53e9387bdd8bfef6cffff2d2eb6bd28eca812682 (diff)
ACPICA: Fix fault if acpi_terminate is called twice
Fixes a problem with the mechanism that prevents problems if the acpi_terminate interface is inadvertently called more than once before the ACPICA code is re-initialized. ACPICA BZ 795. http://acpica.org/bugzilla/show_bug.cgi?id=795 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/utinit.c22
-rw-r--r--drivers/acpi/acpica/utxface.c16
2 files changed, 19 insertions, 19 deletions
diff --git a/drivers/acpi/acpica/utinit.c b/drivers/acpi/acpica/utinit.c
index a54ca84eb362..9d0919ebf7b0 100644
--- a/drivers/acpi/acpica/utinit.c
+++ b/drivers/acpi/acpica/utinit.c
@@ -99,33 +99,19 @@ static void acpi_ut_terminate(void)
99 * 99 *
100 * FUNCTION: acpi_ut_subsystem_shutdown 100 * FUNCTION: acpi_ut_subsystem_shutdown
101 * 101 *
102 * PARAMETERS: none 102 * PARAMETERS: None
103 * 103 *
104 * RETURN: none 104 * RETURN: None
105 * 105 *
106 * DESCRIPTION: Shutdown the various subsystems. Don't delete the mutex 106 * DESCRIPTION: Shutdown the various components. Do not delete the mutex
107 * objects here -- because the AML debugger may be still running. 107 * objects here, because the AML debugger may be still running.
108 * 108 *
109 ******************************************************************************/ 109 ******************************************************************************/
110 110
111void acpi_ut_subsystem_shutdown(void) 111void acpi_ut_subsystem_shutdown(void)
112{ 112{
113
114 ACPI_FUNCTION_TRACE(ut_subsystem_shutdown); 113 ACPI_FUNCTION_TRACE(ut_subsystem_shutdown);
115 114
116 /* Just exit if subsystem is already shutdown */
117
118 if (acpi_gbl_shutdown) {
119 ACPI_ERROR((AE_INFO, "ACPI Subsystem is already terminated"));
120 return_VOID;
121 }
122
123 /* Subsystem appears active, go ahead and shut it down */
124
125 acpi_gbl_shutdown = TRUE;
126 acpi_gbl_startup_flags = 0;
127 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
128
129#ifndef ACPI_ASL_COMPILER 115#ifndef ACPI_ASL_COMPILER
130 116
131 /* Close the acpi_event Handling */ 117 /* Close the acpi_event Handling */
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index 078a22728c6b..483edbb3f441 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -318,7 +318,7 @@ ACPI_EXPORT_SYMBOL(acpi_initialize_objects)
318 * 318 *
319 * RETURN: Status 319 * RETURN: Status
320 * 320 *
321 * DESCRIPTION: Shutdown the ACPI subsystem. Release all resources. 321 * DESCRIPTION: Shutdown the ACPICA subsystem and release all resources.
322 * 322 *
323 ******************************************************************************/ 323 ******************************************************************************/
324acpi_status acpi_terminate(void) 324acpi_status acpi_terminate(void)
@@ -327,6 +327,19 @@ acpi_status acpi_terminate(void)
327 327
328 ACPI_FUNCTION_TRACE(acpi_terminate); 328 ACPI_FUNCTION_TRACE(acpi_terminate);
329 329
330 /* Just exit if subsystem is already shutdown */
331
332 if (acpi_gbl_shutdown) {
333 ACPI_ERROR((AE_INFO, "ACPI Subsystem is already terminated"));
334 return_ACPI_STATUS(AE_OK);
335 }
336
337 /* Subsystem appears active, go ahead and shut it down */
338
339 acpi_gbl_shutdown = TRUE;
340 acpi_gbl_startup_flags = 0;
341 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
342
330 /* Terminate the AML Debugger if present */ 343 /* Terminate the AML Debugger if present */
331 344
332 ACPI_DEBUGGER_EXEC(acpi_gbl_db_terminate_threads = TRUE); 345 ACPI_DEBUGGER_EXEC(acpi_gbl_db_terminate_threads = TRUE);
@@ -353,6 +366,7 @@ acpi_status acpi_terminate(void)
353} 366}
354 367
355ACPI_EXPORT_SYMBOL(acpi_terminate) 368ACPI_EXPORT_SYMBOL(acpi_terminate)
369
356#ifndef ACPI_ASL_COMPILER 370#ifndef ACPI_ASL_COMPILER
357#ifdef ACPI_FUTURE_USAGE 371#ifdef ACPI_FUTURE_USAGE
358/******************************************************************************* 372/*******************************************************************************