aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2007-03-15 04:10:36 -0400
committerLen Brown <len.brown@intel.com>2007-03-15 04:10:36 -0400
commita8f4af6dc6600980885c594f52eecd60edd62013 (patch)
tree818ff31a6fddaefc0a861cf967bb0120029f5fa3 /drivers/acpi/executer
parent4e337adae4e960f64043b9f433c4a825c902616c (diff)
ACPICA: revert "acpi_serialize" changes
This reverts 977a6226feae3e2c10a4d8227625ff0f04b49239 and reverts 1ba753acb372c2955a4843302e92e49ce82e2fea and updates acpi_ev_queue_notify_request() to restore the previous implementation of the "acpi_serialize" workaround. http://bugzilla.kernel.org/show_bug.cgi?id=8171 Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r--drivers/acpi/executer/excreate.c5
-rw-r--r--drivers/acpi/executer/exsystem.c30
-rw-r--r--drivers/acpi/executer/exutils.c104
3 files changed, 47 insertions, 92 deletions
diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c
index 7c38528a7e83..ae97812681a3 100644
--- a/drivers/acpi/executer/excreate.c
+++ b/drivers/acpi/executer/excreate.c
@@ -583,7 +583,10 @@ acpi_ex_create_method(u8 * aml_start,
583 * Get the sync_level. If method is serialized, a mutex will be 583 * Get the sync_level. If method is serialized, a mutex will be
584 * created for this method when it is parsed. 584 * created for this method when it is parsed.
585 */ 585 */
586 if (method_flags & AML_METHOD_SERIALIZED) { 586 if (acpi_gbl_all_methods_serialized) {
587 obj_desc->method.sync_level = 0;
588 obj_desc->method.method_flags |= AML_METHOD_SERIALIZED;
589 } else if (method_flags & AML_METHOD_SERIALIZED) {
587 /* 590 /*
588 * ACPI 1.0: sync_level = 0 591 * ACPI 1.0: sync_level = 0
589 * ACPI 2.0: sync_level = sync_level in method declaration 592 * ACPI 2.0: sync_level = sync_level in method declaration
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c
index 9460baff3032..b2edf620ba89 100644
--- a/drivers/acpi/executer/exsystem.c
+++ b/drivers/acpi/executer/exsystem.c
@@ -66,6 +66,7 @@ ACPI_MODULE_NAME("exsystem")
66acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) 66acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
67{ 67{
68 acpi_status status; 68 acpi_status status;
69 acpi_status status2;
69 70
70 ACPI_FUNCTION_TRACE(ex_system_wait_semaphore); 71 ACPI_FUNCTION_TRACE(ex_system_wait_semaphore);
71 72
@@ -78,7 +79,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
78 79
79 /* We must wait, so unlock the interpreter */ 80 /* We must wait, so unlock the interpreter */
80 81
81 acpi_ex_relinquish_interpreter(); 82 acpi_ex_exit_interpreter();
82 83
83 status = acpi_os_wait_semaphore(semaphore, 1, timeout); 84 status = acpi_os_wait_semaphore(semaphore, 1, timeout);
84 85
@@ -88,7 +89,13 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
88 89
89 /* Reacquire the interpreter */ 90 /* Reacquire the interpreter */
90 91
91 acpi_ex_reacquire_interpreter(); 92 status2 = acpi_ex_enter_interpreter();
93 if (ACPI_FAILURE(status2)) {
94
95 /* Report fatal error, could not acquire interpreter */
96
97 return_ACPI_STATUS(status2);
98 }
92 } 99 }
93 100
94 return_ACPI_STATUS(status); 101 return_ACPI_STATUS(status);
@@ -112,6 +119,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
112acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) 119acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
113{ 120{
114 acpi_status status; 121 acpi_status status;
122 acpi_status status2;
115 123
116 ACPI_FUNCTION_TRACE(ex_system_wait_mutex); 124 ACPI_FUNCTION_TRACE(ex_system_wait_mutex);
117 125
@@ -124,7 +132,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
124 132
125 /* We must wait, so unlock the interpreter */ 133 /* We must wait, so unlock the interpreter */
126 134
127 acpi_ex_relinquish_interpreter(); 135 acpi_ex_exit_interpreter();
128 136
129 status = acpi_os_acquire_mutex(mutex, timeout); 137 status = acpi_os_acquire_mutex(mutex, timeout);
130 138
@@ -134,7 +142,13 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
134 142
135 /* Reacquire the interpreter */ 143 /* Reacquire the interpreter */
136 144
137 acpi_ex_reacquire_interpreter(); 145 status2 = acpi_ex_enter_interpreter();
146 if (ACPI_FAILURE(status2)) {
147
148 /* Report fatal error, could not acquire interpreter */
149
150 return_ACPI_STATUS(status2);
151 }
138 } 152 }
139 153
140 return_ACPI_STATUS(status); 154 return_ACPI_STATUS(status);
@@ -195,18 +209,20 @@ acpi_status acpi_ex_system_do_stall(u32 how_long)
195 209
196acpi_status acpi_ex_system_do_suspend(acpi_integer how_long) 210acpi_status acpi_ex_system_do_suspend(acpi_integer how_long)
197{ 211{
212 acpi_status status;
213
198 ACPI_FUNCTION_ENTRY(); 214 ACPI_FUNCTION_ENTRY();
199 215
200 /* Since this thread will sleep, we must release the interpreter */ 216 /* Since this thread will sleep, we must release the interpreter */
201 217
202 acpi_ex_relinquish_interpreter(); 218 acpi_ex_exit_interpreter();
203 219
204 acpi_os_sleep(how_long); 220 acpi_os_sleep(how_long);
205 221
206 /* And now we must get the interpreter again */ 222 /* And now we must get the interpreter again */
207 223
208 acpi_ex_reacquire_interpreter(); 224 status = acpi_ex_enter_interpreter();
209 return (AE_OK); 225 return (status);
210} 226}
211 227
212/******************************************************************************* 228/*******************************************************************************
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index 6b0aeccbb69b..aea461f3a48c 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -76,15 +76,14 @@ static u32 acpi_ex_digits_needed(acpi_integer value, u32 base);
76 * 76 *
77 * PARAMETERS: None 77 * PARAMETERS: None
78 * 78 *
79 * RETURN: None 79 * RETURN: Status
80 * 80 *
81 * DESCRIPTION: Enter the interpreter execution region. Failure to enter 81 * DESCRIPTION: Enter the interpreter execution region. Failure to enter
82 * the interpreter region is a fatal system error. Used in 82 * the interpreter region is a fatal system error
83 * conjunction with exit_interpreter.
84 * 83 *
85 ******************************************************************************/ 84 ******************************************************************************/
86 85
87void acpi_ex_enter_interpreter(void) 86acpi_status acpi_ex_enter_interpreter(void)
88{ 87{
89 acpi_status status; 88 acpi_status status;
90 89
@@ -92,42 +91,10 @@ void acpi_ex_enter_interpreter(void)
92 91
93 status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); 92 status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);
94 if (ACPI_FAILURE(status)) { 93 if (ACPI_FAILURE(status)) {
95 ACPI_ERROR((AE_INFO, 94 ACPI_ERROR((AE_INFO, "Could not acquire interpreter mutex"));
96 "Could not acquire AML Interpreter mutex"));
97 } 95 }
98 96
99 return_VOID; 97 return_ACPI_STATUS(status);
100}
101
102/*******************************************************************************
103 *
104 * FUNCTION: acpi_ex_reacquire_interpreter
105 *
106 * PARAMETERS: None
107 *
108 * RETURN: None
109 *
110 * DESCRIPTION: Reacquire the interpreter execution region from within the
111 * interpreter code. Failure to enter the interpreter region is a
112 * fatal system error. Used in conjuction with
113 * relinquish_interpreter
114 *
115 ******************************************************************************/
116
117void acpi_ex_reacquire_interpreter(void)
118{
119 ACPI_FUNCTION_TRACE(ex_reacquire_interpreter);
120
121 /*
122 * If the global serialized flag is set, do not release the interpreter,
123 * since it was not actually released by acpi_ex_relinquish_interpreter.
124 * This forces the interpreter to be single threaded.
125 */
126 if (!acpi_gbl_all_methods_serialized) {
127 acpi_ex_enter_interpreter();
128 }
129
130 return_VOID;
131} 98}
132 99
133/******************************************************************************* 100/*******************************************************************************
@@ -138,9 +105,17 @@ void acpi_ex_reacquire_interpreter(void)
138 * 105 *
139 * RETURN: None 106 * RETURN: None
140 * 107 *
141 * DESCRIPTION: Exit the interpreter execution region. This is the top level 108 * DESCRIPTION: Exit the interpreter execution region
142 * routine used to exit the interpreter when all processing has 109 *
143 * been completed. 110 * Cases where the interpreter is unlocked:
111 * 1) Completion of the execution of a control method
112 * 2) Method blocked on a Sleep() AML opcode
113 * 3) Method blocked on an Acquire() AML opcode
114 * 4) Method blocked on a Wait() AML opcode
115 * 5) Method blocked to acquire the global lock
116 * 6) Method blocked to execute a serialized control method that is
117 * already executing
118 * 7) About to invoke a user-installed opregion handler
144 * 119 *
145 ******************************************************************************/ 120 ******************************************************************************/
146 121
@@ -152,46 +127,7 @@ void acpi_ex_exit_interpreter(void)
152 127
153 status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); 128 status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);
154 if (ACPI_FAILURE(status)) { 129 if (ACPI_FAILURE(status)) {
155 ACPI_ERROR((AE_INFO, 130 ACPI_ERROR((AE_INFO, "Could not release interpreter mutex"));
156 "Could not release AML Interpreter mutex"));
157 }
158
159 return_VOID;
160}
161
162/*******************************************************************************
163 *
164 * FUNCTION: acpi_ex_relinquish_interpreter
165 *
166 * PARAMETERS: None
167 *
168 * RETURN: None
169 *
170 * DESCRIPTION: Exit the interpreter execution region, from within the
171 * interpreter - before attempting an operation that will possibly
172 * block the running thread.
173 *
174 * Cases where the interpreter is unlocked internally
175 * 1) Method to be blocked on a Sleep() AML opcode
176 * 2) Method to be blocked on an Acquire() AML opcode
177 * 3) Method to be blocked on a Wait() AML opcode
178 * 4) Method to be blocked to acquire the global lock
179 * 5) Method to be blocked waiting to execute a serialized control method
180 * that is currently executing
181 * 6) About to invoke a user-installed opregion handler
182 *
183 ******************************************************************************/
184
185void acpi_ex_relinquish_interpreter(void)
186{
187 ACPI_FUNCTION_TRACE(ex_relinquish_interpreter);
188
189 /*
190 * If the global serialized flag is set, do not release the interpreter.
191 * This forces the interpreter to be single threaded.
192 */
193 if (!acpi_gbl_all_methods_serialized) {
194 acpi_ex_exit_interpreter();
195 } 131 }
196 132
197 return_VOID; 133 return_VOID;
@@ -205,8 +141,8 @@ void acpi_ex_relinquish_interpreter(void)
205 * 141 *
206 * RETURN: none 142 * RETURN: none
207 * 143 *
208 * DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is 144 * DESCRIPTION: Truncate a number to 32-bits if the currently executing method
209 * 32-bit, as determined by the revision of the DSDT. 145 * belongs to a 32-bit ACPI table.
210 * 146 *
211 ******************************************************************************/ 147 ******************************************************************************/
212 148