aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-06-08 16:29:00 -0400
committerLen Brown <len.brown@intel.com>2006-06-14 02:45:47 -0400
commit4c90ece249992c7a2e3fc921e5cdb8eb92193067 (patch)
treee145ffe472802ef870ba1eaea150b688c19e45ca /drivers/acpi/utilities
parent4119532c95547821dbe72d6916dfa1b2148475b3 (diff)
ACPI: ACPICA 20060608
Converted the locking mutex used for the ACPI hardware to a spinlock. This change should eliminate all problems caused by attempting to acquire a semaphore at interrupt level, and it means that all ACPICA external interfaces that directly access the ACPI hardware can be safely called from interrupt level. Fixed a regression introduced in 20060526 where the ACPI device initialization could be prematurely aborted with an AE_NOT_FOUND if a device did not have an optional _INI method. Fixed an IndexField issue where a write to the Data Register should be limited in size to the AccessSize (width) of the IndexField itself. (BZ 433, Fiodor Suietov) Fixed problem reports (Valery Podrezov) integrated: - Allow store of ThermalZone objects to Debug object. http://bugzilla.kernel.org/show_bug.cgi?id=5369 http://bugzilla.kernel.org/show_bug.cgi?id=5370 Fixed problem reports (Fiodor Suietov) integrated: - acpi_get_table_header() doesn't handle multiple instances correctly (BZ 364) Removed four global mutexes that were obsolete and were no longer being used. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities')
-rw-r--r--drivers/acpi/utilities/utglobal.c4
-rw-r--r--drivers/acpi/utilities/utmutex.c26
2 files changed, 20 insertions, 10 deletions
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 9450f9b5bfb2..e5999c65c0b8 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -691,7 +691,7 @@ char *acpi_ut_get_descriptor_name(void *object)
691char *acpi_ut_get_mutex_name(u32 mutex_id) 691char *acpi_ut_get_mutex_name(u32 mutex_id)
692{ 692{
693 693
694 if (mutex_id > MAX_MUTEX) { 694 if (mutex_id > ACPI_MAX_MUTEX) {
695 return ("Invalid Mutex ID"); 695 return ("Invalid Mutex ID");
696 } 696 }
697 697
@@ -760,7 +760,7 @@ void acpi_ut_init_globals(void)
760 760
761 /* Mutex locked flags */ 761 /* Mutex locked flags */
762 762
763 for (i = 0; i < NUM_MUTEX; i++) { 763 for (i = 0; i < ACPI_NUM_MUTEX; i++) {
764 acpi_gbl_mutex_info[i].mutex = NULL; 764 acpi_gbl_mutex_info[i].mutex = NULL;
765 acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED; 765 acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
766 acpi_gbl_mutex_info[i].use_count = 0; 766 acpi_gbl_mutex_info[i].use_count = 0;
diff --git a/drivers/acpi/utilities/utmutex.c b/drivers/acpi/utilities/utmutex.c
index b851f7be5d58..25eb34369afa 100644
--- a/drivers/acpi/utilities/utmutex.c
+++ b/drivers/acpi/utilities/utmutex.c
@@ -73,14 +73,21 @@ acpi_status acpi_ut_mutex_initialize(void)
73 /* 73 /*
74 * Create each of the predefined mutex objects 74 * Create each of the predefined mutex objects
75 */ 75 */
76 for (i = 0; i < NUM_MUTEX; i++) { 76 for (i = 0; i < ACPI_NUM_MUTEX; i++) {
77 status = acpi_ut_create_mutex(i); 77 status = acpi_ut_create_mutex(i);
78 if (ACPI_FAILURE(status)) { 78 if (ACPI_FAILURE(status)) {
79 return_ACPI_STATUS(status); 79 return_ACPI_STATUS(status);
80 } 80 }
81 } 81 }
82 82
83 /* Create the spinlocks for use at interrupt level */
84
83 status = acpi_os_create_lock(&acpi_gbl_gpe_lock); 85 status = acpi_os_create_lock(&acpi_gbl_gpe_lock);
86 if (ACPI_FAILURE(status)) {
87 return_ACPI_STATUS(status);
88 }
89
90 status = acpi_os_create_lock(&acpi_gbl_hardware_lock);
84 return_ACPI_STATUS(status); 91 return_ACPI_STATUS(status);
85} 92}
86 93
@@ -105,11 +112,14 @@ void acpi_ut_mutex_terminate(void)
105 /* 112 /*
106 * Delete each predefined mutex object 113 * Delete each predefined mutex object
107 */ 114 */
108 for (i = 0; i < NUM_MUTEX; i++) { 115 for (i = 0; i < ACPI_NUM_MUTEX; i++) {
109 (void)acpi_ut_delete_mutex(i); 116 (void)acpi_ut_delete_mutex(i);
110 } 117 }
111 118
119 /* Delete the spinlocks */
120
112 acpi_os_delete_lock(acpi_gbl_gpe_lock); 121 acpi_os_delete_lock(acpi_gbl_gpe_lock);
122 acpi_os_delete_lock(acpi_gbl_hardware_lock);
113 return_VOID; 123 return_VOID;
114} 124}
115 125
@@ -131,7 +141,7 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id)
131 141
132 ACPI_FUNCTION_TRACE_U32(ut_create_mutex, mutex_id); 142 ACPI_FUNCTION_TRACE_U32(ut_create_mutex, mutex_id);
133 143
134 if (mutex_id > MAX_MUTEX) { 144 if (mutex_id > ACPI_MAX_MUTEX) {
135 return_ACPI_STATUS(AE_BAD_PARAMETER); 145 return_ACPI_STATUS(AE_BAD_PARAMETER);
136 } 146 }
137 147
@@ -165,7 +175,7 @@ static acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id)
165 175
166 ACPI_FUNCTION_TRACE_U32(ut_delete_mutex, mutex_id); 176 ACPI_FUNCTION_TRACE_U32(ut_delete_mutex, mutex_id);
167 177
168 if (mutex_id > MAX_MUTEX) { 178 if (mutex_id > ACPI_MAX_MUTEX) {
169 return_ACPI_STATUS(AE_BAD_PARAMETER); 179 return_ACPI_STATUS(AE_BAD_PARAMETER);
170 } 180 }
171 181
@@ -196,7 +206,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
196 206
197 ACPI_FUNCTION_NAME(ut_acquire_mutex); 207 ACPI_FUNCTION_NAME(ut_acquire_mutex);
198 208
199 if (mutex_id > MAX_MUTEX) { 209 if (mutex_id > ACPI_MAX_MUTEX) {
200 return (AE_BAD_PARAMETER); 210 return (AE_BAD_PARAMETER);
201 } 211 }
202 212
@@ -213,7 +223,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
213 * the mutex ordering rule. This indicates a coding error somewhere in 223 * the mutex ordering rule. This indicates a coding error somewhere in
214 * the ACPI subsystem code. 224 * the ACPI subsystem code.
215 */ 225 */
216 for (i = mutex_id; i < MAX_MUTEX; i++) { 226 for (i = mutex_id; i < ACPI_MAX_MUTEX; i++) {
217 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { 227 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) {
218 if (i == mutex_id) { 228 if (i == mutex_id) {
219 ACPI_ERROR((AE_INFO, 229 ACPI_ERROR((AE_INFO,
@@ -284,7 +294,7 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
284 "Thread %X releasing Mutex [%s]\n", this_thread_id, 294 "Thread %X releasing Mutex [%s]\n", this_thread_id,
285 acpi_ut_get_mutex_name(mutex_id))); 295 acpi_ut_get_mutex_name(mutex_id)));
286 296
287 if (mutex_id > MAX_MUTEX) { 297 if (mutex_id > ACPI_MAX_MUTEX) {
288 return (AE_BAD_PARAMETER); 298 return (AE_BAD_PARAMETER);
289 } 299 }
290 300
@@ -309,7 +319,7 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
309 * ordering rule. This indicates a coding error somewhere in 319 * ordering rule. This indicates a coding error somewhere in
310 * the ACPI subsystem code. 320 * the ACPI subsystem code.
311 */ 321 */
312 for (i = mutex_id; i < MAX_MUTEX; i++) { 322 for (i = mutex_id; i < ACPI_MAX_MUTEX; i++) {
313 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { 323 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) {
314 if (i == mutex_id) { 324 if (i == mutex_id) {
315 continue; 325 continue;