Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Pull bugzilla-8385 into release branch

Len Brown 3dd6786f f697b677

+181 -126
+7 -5
drivers/acpi/dispatcher/dsmethod.c
··· 231 231 * Obtain the method mutex if necessary. Do not acquire mutex for a 232 232 * recursive call. 233 233 */ 234 - if (acpi_os_get_thread_id() != 235 - obj_desc->method.mutex->mutex.owner_thread_id) { 234 + if (!walk_state || 235 + !obj_desc->method.mutex->mutex.owner_thread || 236 + (walk_state->thread != 237 + obj_desc->method.mutex->mutex.owner_thread)) { 236 238 /* 237 239 * Acquire the method mutex. This releases the interpreter if we 238 240 * block (and reacquires it before it returns) ··· 248 246 } 249 247 250 248 /* Update the mutex and walk info and save the original sync_level */ 251 - obj_desc->method.mutex->mutex.owner_thread_id = 252 - acpi_os_get_thread_id(); 253 249 254 250 if (walk_state) { 255 251 obj_desc->method.mutex->mutex. 256 252 original_sync_level = 257 253 walk_state->thread->current_sync_level; 258 254 255 + obj_desc->method.mutex->mutex.owner_thread = 256 + walk_state->thread; 259 257 walk_state->thread->current_sync_level = 260 258 obj_desc->method.sync_level; 261 259 } else { ··· 569 567 570 568 acpi_os_release_mutex(method_desc->method.mutex->mutex. 571 569 os_mutex); 572 - method_desc->method.mutex->mutex.owner_thread_id = ACPI_MUTEX_NOT_ACQUIRED; 570 + method_desc->method.mutex->mutex.owner_thread = NULL; 573 571 } 574 572 } 575 573
+4 -7
drivers/acpi/events/evmisc.c
··· 196 196 notify_info->notify.value = (u16) notify_value; 197 197 notify_info->notify.handler_obj = handler_obj; 198 198 199 - acpi_ex_exit_interpreter(); 200 - 201 - acpi_ev_notify_dispatch(notify_info); 202 - 203 - status = acpi_ex_enter_interpreter(); 199 + status = 200 + acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch, 201 + notify_info); 204 202 if (ACPI_FAILURE(status)) { 205 - return_ACPI_STATUS(status); 203 + acpi_ut_delete_generic_state(notify_info); 206 204 } 207 - 208 205 } 209 206 210 207 if (!handler_obj) {
+4 -11
drivers/acpi/events/evregion.c
··· 291 291 u32 bit_width, acpi_integer * value) 292 292 { 293 293 acpi_status status; 294 - acpi_status status2; 295 294 acpi_adr_space_handler handler; 296 295 acpi_adr_space_setup region_setup; 297 296 union acpi_operand_object *handler_desc; ··· 344 345 * setup will potentially execute control methods 345 346 * (e.g., _REG method for this region) 346 347 */ 347 - acpi_ex_exit_interpreter(); 348 + acpi_ex_relinquish_interpreter(); 348 349 349 350 status = region_setup(region_obj, ACPI_REGION_ACTIVATE, 350 351 handler_desc->address_space.context, ··· 352 353 353 354 /* Re-enter the interpreter */ 354 355 355 - status2 = acpi_ex_enter_interpreter(); 356 - if (ACPI_FAILURE(status2)) { 357 - return_ACPI_STATUS(status2); 358 - } 356 + acpi_ex_reacquire_interpreter(); 359 357 360 358 /* Check for failure of the Region Setup */ 361 359 ··· 405 409 * exit the interpreter because the handler *might* block -- we don't 406 410 * know what it will do, so we can't hold the lock on the intepreter. 407 411 */ 408 - acpi_ex_exit_interpreter(); 412 + acpi_ex_relinquish_interpreter(); 409 413 } 410 414 411 415 /* Call the handler */ ··· 426 430 * We just returned from a non-default handler, we must re-enter the 427 431 * interpreter 428 432 */ 429 - status2 = acpi_ex_enter_interpreter(); 430 - if (ACPI_FAILURE(status2)) { 431 - return_ACPI_STATUS(status2); 432 - } 433 + acpi_ex_reacquire_interpreter(); 433 434 } 434 435 435 436 return_ACPI_STATUS(status);
+2 -4
drivers/acpi/events/evxface.c
··· 768 768 return (AE_BAD_PARAMETER); 769 769 } 770 770 771 - status = acpi_ex_enter_interpreter(); 772 - if (ACPI_FAILURE(status)) { 773 - return (status); 774 - } 771 + /* Must lock interpreter to prevent race conditions */ 775 772 773 + acpi_ex_enter_interpreter(); 776 774 status = acpi_ev_acquire_global_lock(timeout); 777 775 acpi_ex_exit_interpreter(); 778 776
+1 -4
drivers/acpi/executer/excreate.c
··· 583 583 * Get the sync_level. If method is serialized, a mutex will be 584 584 * created for this method when it is parsed. 585 585 */ 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) { 586 + if (method_flags & AML_METHOD_SERIALIZED) { 590 587 /* 591 588 * ACPI 1.0: sync_level = 0 592 589 * ACPI 2.0: sync_level = sync_level in method declaration
+1 -1
drivers/acpi/executer/exdump.c
··· 134 134 static struct acpi_exdump_info acpi_ex_dump_mutex[5] = { 135 135 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_mutex), NULL}, 136 136 {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(mutex.sync_level), "Sync Level"}, 137 - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread_id), "Owner Thread"}, 137 + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"}, 138 138 {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth), 139 139 "Acquire Depth"}, 140 140 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.os_mutex), "OsMutex"}
+20 -16
drivers/acpi/executer/exmutex.c
··· 66 66 * 67 67 ******************************************************************************/ 68 68 69 - void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc, 70 - struct acpi_thread_state *thread) 69 + void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc) 71 70 { 71 + struct acpi_thread_state *thread = obj_desc->mutex.owner_thread; 72 + 72 73 if (!thread) { 73 74 return; 74 75 } ··· 174 173 175 174 /* Support for multiple acquires by the owning thread */ 176 175 177 - if (obj_desc->mutex.owner_thread_id == acpi_os_get_thread_id()) { 178 - /* 179 - * The mutex is already owned by this thread, just increment the 180 - * acquisition depth 181 - */ 182 - obj_desc->mutex.acquisition_depth++; 183 - return_ACPI_STATUS(AE_OK); 176 + if (obj_desc->mutex.owner_thread) { 177 + if (obj_desc->mutex.owner_thread->thread_id == 178 + walk_state->thread->thread_id) { 179 + /* 180 + * The mutex is already owned by this thread, just increment the 181 + * acquisition depth 182 + */ 183 + obj_desc->mutex.acquisition_depth++; 184 + return_ACPI_STATUS(AE_OK); 185 + } 184 186 } 185 187 186 188 /* Acquire the mutex, wait if necessary. Special case for Global Lock */ ··· 206 202 207 203 /* Have the mutex: update mutex and walk info and save the sync_level */ 208 204 209 - obj_desc->mutex.owner_thread_id = acpi_os_get_thread_id(); 205 + obj_desc->mutex.owner_thread = walk_state->thread; 210 206 obj_desc->mutex.acquisition_depth = 1; 211 207 obj_desc->mutex.original_sync_level = 212 208 walk_state->thread->current_sync_level; ··· 246 242 247 243 /* The mutex must have been previously acquired in order to release it */ 248 244 249 - if (!obj_desc->mutex.owner_thread_id) { 245 + if (!obj_desc->mutex.owner_thread) { 250 246 ACPI_ERROR((AE_INFO, 251 247 "Cannot release Mutex [%4.4s], not acquired", 252 248 acpi_ut_get_node_name(obj_desc->mutex.node))); ··· 266 262 * The Mutex is owned, but this thread must be the owner. 267 263 * Special case for Global Lock, any thread can release 268 264 */ 269 - if ((obj_desc->mutex.owner_thread_id != 265 + if ((obj_desc->mutex.owner_thread->thread_id != 270 266 walk_state->thread->thread_id) 271 267 && (obj_desc->mutex.os_mutex != acpi_gbl_global_lock_mutex)) { 272 268 ACPI_ERROR((AE_INFO, 273 269 "Thread %lX cannot release Mutex [%4.4s] acquired by thread %lX", 274 270 (unsigned long)walk_state->thread->thread_id, 275 271 acpi_ut_get_node_name(obj_desc->mutex.node), 276 - (unsigned long)obj_desc->mutex.owner_thread_id)); 272 + (unsigned long)obj_desc->mutex.owner_thread->thread_id)); 277 273 return_ACPI_STATUS(AE_AML_NOT_OWNER); 278 274 } 279 275 ··· 300 296 301 297 /* Unlink the mutex from the owner's list */ 302 298 303 - acpi_ex_unlink_mutex(obj_desc, walk_state->thread); 299 + acpi_ex_unlink_mutex(obj_desc); 304 300 305 301 /* Release the mutex, special case for Global Lock */ 306 302 ··· 312 308 313 309 /* Update the mutex and restore sync_level */ 314 310 315 - obj_desc->mutex.owner_thread_id = ACPI_MUTEX_NOT_ACQUIRED; 311 + obj_desc->mutex.owner_thread = NULL; 316 312 walk_state->thread->current_sync_level = 317 313 obj_desc->mutex.original_sync_level; 318 314 ··· 367 363 368 364 /* Mark mutex unowned */ 369 365 370 - obj_desc->mutex.owner_thread_id = ACPI_MUTEX_NOT_ACQUIRED; 366 + obj_desc->mutex.owner_thread = NULL; 371 367 372 368 /* Update Thread sync_level (Last mutex is the important one) */ 373 369
+7 -23
drivers/acpi/executer/exsystem.c
··· 66 66 acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) 67 67 { 68 68 acpi_status status; 69 - acpi_status status2; 70 69 71 70 ACPI_FUNCTION_TRACE(ex_system_wait_semaphore); 72 71 ··· 78 79 79 80 /* We must wait, so unlock the interpreter */ 80 81 81 - acpi_ex_exit_interpreter(); 82 + acpi_ex_relinquish_interpreter(); 82 83 83 84 status = acpi_os_wait_semaphore(semaphore, 1, timeout); 84 85 ··· 88 89 89 90 /* Reacquire the interpreter */ 90 91 91 - status2 = acpi_ex_enter_interpreter(); 92 - if (ACPI_FAILURE(status2)) { 93 - 94 - /* Report fatal error, could not acquire interpreter */ 95 - 96 - return_ACPI_STATUS(status2); 97 - } 92 + acpi_ex_reacquire_interpreter(); 98 93 } 99 94 100 95 return_ACPI_STATUS(status); ··· 112 119 acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) 113 120 { 114 121 acpi_status status; 115 - acpi_status status2; 116 122 117 123 ACPI_FUNCTION_TRACE(ex_system_wait_mutex); 118 124 ··· 124 132 125 133 /* We must wait, so unlock the interpreter */ 126 134 127 - acpi_ex_exit_interpreter(); 135 + acpi_ex_relinquish_interpreter(); 128 136 129 137 status = acpi_os_acquire_mutex(mutex, timeout); 130 138 ··· 134 142 135 143 /* Reacquire the interpreter */ 136 144 137 - status2 = acpi_ex_enter_interpreter(); 138 - if (ACPI_FAILURE(status2)) { 139 - 140 - /* Report fatal error, could not acquire interpreter */ 141 - 142 - return_ACPI_STATUS(status2); 143 - } 145 + acpi_ex_reacquire_interpreter(); 144 146 } 145 147 146 148 return_ACPI_STATUS(status); ··· 195 209 196 210 acpi_status acpi_ex_system_do_suspend(acpi_integer how_long) 197 211 { 198 - acpi_status status; 199 - 200 212 ACPI_FUNCTION_ENTRY(); 201 213 202 214 /* Since this thread will sleep, we must release the interpreter */ 203 215 204 - acpi_ex_exit_interpreter(); 216 + acpi_ex_relinquish_interpreter(); 205 217 206 218 acpi_os_sleep(how_long); 207 219 208 220 /* And now we must get the interpreter again */ 209 221 210 - status = acpi_ex_enter_interpreter(); 211 - return (status); 222 + acpi_ex_reacquire_interpreter(); 223 + return (AE_OK); 212 224 } 213 225 214 226 /*******************************************************************************
+84 -20
drivers/acpi/executer/exutils.c
··· 76 76 * 77 77 * PARAMETERS: None 78 78 * 79 - * RETURN: Status 79 + * RETURN: None 80 80 * 81 - * DESCRIPTION: Enter the interpreter execution region. Failure to enter 82 - * the interpreter region is a fatal system error 81 + * DESCRIPTION: Enter the interpreter execution region. Failure to enter 82 + * the interpreter region is a fatal system error. Used in 83 + * conjunction with exit_interpreter. 83 84 * 84 85 ******************************************************************************/ 85 86 86 - acpi_status acpi_ex_enter_interpreter(void) 87 + void acpi_ex_enter_interpreter(void) 87 88 { 88 89 acpi_status status; 89 90 ··· 92 91 93 92 status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); 94 93 if (ACPI_FAILURE(status)) { 95 - ACPI_ERROR((AE_INFO, "Could not acquire interpreter mutex")); 94 + ACPI_ERROR((AE_INFO, 95 + "Could not acquire AML Interpreter mutex")); 96 96 } 97 97 98 - return_ACPI_STATUS(status); 98 + return_VOID; 99 + } 100 + 101 + /******************************************************************************* 102 + * 103 + * FUNCTION: acpi_ex_reacquire_interpreter 104 + * 105 + * PARAMETERS: None 106 + * 107 + * RETURN: None 108 + * 109 + * DESCRIPTION: Reacquire the interpreter execution region from within the 110 + * interpreter code. Failure to enter the interpreter region is a 111 + * fatal system error. Used in conjuction with 112 + * relinquish_interpreter 113 + * 114 + ******************************************************************************/ 115 + 116 + void acpi_ex_reacquire_interpreter(void) 117 + { 118 + ACPI_FUNCTION_TRACE(ex_reacquire_interpreter); 119 + 120 + /* 121 + * If the global serialized flag is set, do not release the interpreter, 122 + * since it was not actually released by acpi_ex_relinquish_interpreter. 123 + * This forces the interpreter to be single threaded. 124 + */ 125 + if (!acpi_gbl_all_methods_serialized) { 126 + acpi_ex_enter_interpreter(); 127 + } 128 + 129 + return_VOID; 99 130 } 100 131 101 132 /******************************************************************************* ··· 138 105 * 139 106 * RETURN: None 140 107 * 141 - * DESCRIPTION: Exit the interpreter execution region 142 - * 143 - * Cases where the interpreter is unlocked: 144 - * 1) Completion of the execution of a control method 145 - * 2) Method blocked on a Sleep() AML opcode 146 - * 3) Method blocked on an Acquire() AML opcode 147 - * 4) Method blocked on a Wait() AML opcode 148 - * 5) Method blocked to acquire the global lock 149 - * 6) Method blocked to execute a serialized control method that is 150 - * already executing 151 - * 7) About to invoke a user-installed opregion handler 108 + * DESCRIPTION: Exit the interpreter execution region. This is the top level 109 + * routine used to exit the interpreter when all processing has 110 + * been completed. 152 111 * 153 112 ******************************************************************************/ 154 113 ··· 152 127 153 128 status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); 154 129 if (ACPI_FAILURE(status)) { 155 - ACPI_ERROR((AE_INFO, "Could not release interpreter mutex")); 130 + ACPI_ERROR((AE_INFO, 131 + "Could not release AML Interpreter mutex")); 132 + } 133 + 134 + return_VOID; 135 + } 136 + 137 + /******************************************************************************* 138 + * 139 + * FUNCTION: acpi_ex_relinquish_interpreter 140 + * 141 + * PARAMETERS: None 142 + * 143 + * RETURN: None 144 + * 145 + * DESCRIPTION: Exit the interpreter execution region, from within the 146 + * interpreter - before attempting an operation that will possibly 147 + * block the running thread. 148 + * 149 + * Cases where the interpreter is unlocked internally 150 + * 1) Method to be blocked on a Sleep() AML opcode 151 + * 2) Method to be blocked on an Acquire() AML opcode 152 + * 3) Method to be blocked on a Wait() AML opcode 153 + * 4) Method to be blocked to acquire the global lock 154 + * 5) Method to be blocked waiting to execute a serialized control method 155 + * that is currently executing 156 + * 6) About to invoke a user-installed opregion handler 157 + * 158 + ******************************************************************************/ 159 + 160 + void acpi_ex_relinquish_interpreter(void) 161 + { 162 + ACPI_FUNCTION_TRACE(ex_relinquish_interpreter); 163 + 164 + /* 165 + * If the global serialized flag is set, do not release the interpreter. 166 + * This forces the interpreter to be single threaded. 167 + */ 168 + if (!acpi_gbl_all_methods_serialized) { 169 + acpi_ex_exit_interpreter(); 156 170 } 157 171 158 172 return_VOID; ··· 205 141 * 206 142 * RETURN: none 207 143 * 208 - * DESCRIPTION: Truncate a number to 32-bits if the currently executing method 209 - * belongs to a 32-bit ACPI table. 144 + * DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is 145 + * 32-bit, as determined by the revision of the DSDT. 210 146 * 211 147 ******************************************************************************/ 212 148
+2 -9
drivers/acpi/namespace/nseval.c
··· 154 154 * Execute the method via the interpreter. The interpreter is locked 155 155 * here before calling into the AML parser 156 156 */ 157 - status = acpi_ex_enter_interpreter(); 158 - if (ACPI_FAILURE(status)) { 159 - return_ACPI_STATUS(status); 160 - } 161 - 157 + acpi_ex_enter_interpreter(); 162 158 status = acpi_ps_execute_method(info); 163 159 acpi_ex_exit_interpreter(); 164 160 } else { ··· 178 182 * resolution, we must lock it because we could access an opregion. 179 183 * The opregion access code assumes that the interpreter is locked. 180 184 */ 181 - status = acpi_ex_enter_interpreter(); 182 - if (ACPI_FAILURE(status)) { 183 - return_ACPI_STATUS(status); 184 - } 185 + acpi_ex_enter_interpreter(); 185 186 186 187 /* Function has a strange interface */ 187 188
+2 -5
drivers/acpi/namespace/nsinit.c
··· 214 214 u32 level, void *context, void **return_value) 215 215 { 216 216 acpi_object_type type; 217 - acpi_status status; 217 + acpi_status status = AE_OK; 218 218 struct acpi_init_walk_info *info = 219 219 (struct acpi_init_walk_info *)context; 220 220 struct acpi_namespace_node *node = ··· 268 268 /* 269 269 * Must lock the interpreter before executing AML code 270 270 */ 271 - status = acpi_ex_enter_interpreter(); 272 - if (ACPI_FAILURE(status)) { 273 - return (status); 274 - } 271 + acpi_ex_enter_interpreter(); 275 272 276 273 /* 277 274 * Each of these types can contain executable AML code within the
+4 -7
drivers/acpi/namespace/nsxfeval.c
··· 170 170 struct acpi_buffer *return_buffer) 171 171 { 172 172 acpi_status status; 173 - acpi_status status2; 174 173 struct acpi_evaluate_info *info; 175 174 acpi_size buffer_space_needed; 176 175 u32 i; ··· 328 329 * Delete the internal return object. NOTE: Interpreter must be 329 330 * locked to avoid race condition. 330 331 */ 331 - status2 = acpi_ex_enter_interpreter(); 332 - if (ACPI_SUCCESS(status2)) { 332 + acpi_ex_enter_interpreter(); 333 333 334 - /* Remove one reference on the return object (should delete it) */ 334 + /* Remove one reference on the return object (should delete it) */ 335 335 336 - acpi_ut_remove_reference(info->return_object); 337 - acpi_ex_exit_interpreter(); 338 - } 336 + acpi_ut_remove_reference(info->return_object); 337 + acpi_ex_exit_interpreter(); 339 338 } 340 339 341 340 cleanup:
+35 -10
drivers/acpi/osl.c
··· 71 71 static acpi_osd_handler acpi_irq_handler; 72 72 static void *acpi_irq_context; 73 73 static struct workqueue_struct *kacpid_wq; 74 + static struct workqueue_struct *kacpi_notify_wq; 74 75 75 76 static void __init acpi_request_region (struct acpi_generic_address *addr, 76 77 unsigned int length, char *desc) ··· 138 137 return AE_NULL_ENTRY; 139 138 } 140 139 kacpid_wq = create_singlethread_workqueue("kacpid"); 140 + kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify"); 141 141 BUG_ON(!kacpid_wq); 142 - 142 + BUG_ON(!kacpi_notify_wq); 143 143 return AE_OK; 144 144 } 145 145 ··· 152 150 } 153 151 154 152 destroy_workqueue(kacpid_wq); 153 + destroy_workqueue(kacpi_notify_wq); 155 154 156 155 return AE_OK; 157 156 } ··· 606 603 static void acpi_os_execute_deferred(struct work_struct *work) 607 604 { 608 605 struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work); 606 + if (!dpc) { 607 + printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); 608 + return; 609 + } 610 + 611 + dpc->function(dpc->context); 612 + kfree(dpc); 613 + 614 + /* Yield cpu to notify thread */ 615 + cond_resched(); 616 + 617 + return; 618 + } 619 + 620 + static void acpi_os_execute_notify(struct work_struct *work) 621 + { 622 + struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work); 609 623 610 624 if (!dpc) { 611 625 printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); ··· 657 637 acpi_status status = AE_OK; 658 638 struct acpi_os_dpc *dpc; 659 639 660 - ACPI_FUNCTION_TRACE("os_queue_for_execution"); 661 - 662 640 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 663 641 "Scheduling function [%p(%p)] for deferred execution.\n", 664 642 function, context)); 665 643 666 644 if (!function) 667 - return_ACPI_STATUS(AE_BAD_PARAMETER); 645 + return AE_BAD_PARAMETER; 668 646 669 647 /* 670 648 * Allocate/initialize DPC structure. Note that this memory will be ··· 680 662 dpc->function = function; 681 663 dpc->context = context; 682 664 683 - INIT_WORK(&dpc->work, acpi_os_execute_deferred); 684 - if (!queue_work(kacpid_wq, &dpc->work)) { 685 - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 665 + if (type == OSL_NOTIFY_HANDLER) { 666 + INIT_WORK(&dpc->work, acpi_os_execute_notify); 667 + if (!queue_work(kacpi_notify_wq, &dpc->work)) { 668 + status = AE_ERROR; 669 + kfree(dpc); 670 + } 671 + } else { 672 + INIT_WORK(&dpc->work, acpi_os_execute_deferred); 673 + if (!queue_work(kacpid_wq, &dpc->work)) { 674 + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 686 675 "Call to queue_work() failed.\n")); 687 - kfree(dpc); 688 - status = AE_ERROR; 676 + status = AE_ERROR; 677 + kfree(dpc); 678 + } 689 679 } 690 - 691 680 return_ACPI_STATUS(status); 692 681 } 693 682
+1
drivers/acpi/utilities/utdelete.c
··· 170 170 acpi_os_delete_mutex(object->mutex.os_mutex); 171 171 acpi_gbl_global_lock_mutex = NULL; 172 172 } else { 173 + acpi_ex_unlink_mutex(object); 173 174 acpi_os_delete_mutex(object->mutex.os_mutex); 174 175 } 175 176 break;
+6 -3
include/acpi/acinterp.h
··· 253 253 254 254 void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread); 255 255 256 - void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc, 257 - struct acpi_thread_state *thread); 256 + void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc); 258 257 259 258 /* 260 259 * exprep - ACPI AML execution - prep utilities ··· 445 446 /* 446 447 * exutils - interpreter/scanner utilities 447 448 */ 448 - acpi_status acpi_ex_enter_interpreter(void); 449 + void acpi_ex_enter_interpreter(void); 449 450 450 451 void acpi_ex_exit_interpreter(void); 452 + 453 + void acpi_ex_reacquire_interpreter(void); 454 + 455 + void acpi_ex_relinquish_interpreter(void); 451 456 452 457 void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc); 453 458
+1 -1
include/acpi/acobject.h
··· 155 155 struct acpi_object_mutex { 156 156 ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ 157 157 u16 acquisition_depth; /* Allow multiple Acquires, same thread */ 158 - acpi_thread_id owner_thread_id; /* Current owner of the mutex */ 158 + struct acpi_thread_state *owner_thread; /* Current owner of the mutex */ 159 159 acpi_mutex os_mutex; /* Actual OS synchronization object */ 160 160 union acpi_operand_object *prev; /* Link for list of acquired mutexes */ 161 161 union acpi_operand_object *next; /* Link for list of acquired mutexes */