diff -U3 -r linux-2.6.16-old/drivers/acpi/events/evgpe.c linux-2.6.16/drivers/acpi/events/evgpe.c --- linux-2.6.16-old/drivers/acpi/events/evgpe.c 2006-03-25 07:53:06.000000000 +0000 +++ linux-2.6.16/drivers/acpi/events/evgpe.c 2006-03-25 08:03:41.000000000 +0000 @@ -628,6 +628,10 @@ switch (gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) { case ACPI_GPE_DISPATCH_HANDLER: + printk(KERN_INFO "acpi_ev_gpe_dispatch handler flags=0x%x bit=0x%x gpe=0x%x addr=%p\n", + gpe_event_info->flags, gpe_event_info->register_bit, gpe_number, + gpe_event_info->dispatch.handler->address); + /* * Invoke the installed handler (at interrupt level) * Ignore return status for now. TBD: leave GPE disabled on error? @@ -653,6 +657,16 @@ case ACPI_GPE_DISPATCH_METHOD: + { + char buf[5]; + int i; + for (i = 0; i < 4; i++) + buf[i] = gpe_event_info->dispatch.method_node->name.ascii[i]; + buf[5] = '\0'; + printk(KERN_INFO "acpi_ev_gpe_dispatch method flags=0x%x bit=0x%x gpe=0x%x name=%s\n", + gpe_event_info->flags, gpe_event_info->register_bit, gpe_number, buf); + } + /* * Disable GPE, so it doesn't keep firing before the method has a * chance to run. diff -U3 -r linux-2.6.16-old/drivers/acpi/events/evmisc.c linux-2.6.16/drivers/acpi/events/evmisc.c --- linux-2.6.16-old/drivers/acpi/events/evmisc.c 2006-03-25 07:52:59.000000000 +0000 +++ linux-2.6.16/drivers/acpi/events/evmisc.c 2006-03-25 08:13:54.000000000 +0000 @@ -152,6 +152,10 @@ if (obj_desc) { /* We have the notify object, Get the right handler */ + if (node->type == ACPI_TYPE_THERMAL && notify_value == 0x80) { + printk(KERN_INFO "acpi_ev_queue_notify_request node=%p value=0x%lx\n", node, notify_value); + } + switch (node->type) { case ACPI_TYPE_DEVICE: case ACPI_TYPE_THERMAL: @@ -234,6 +238,8 @@ ACPI_FUNCTION_ENTRY(); + printk(KERN_INFO "acpi_ev_notify_dispatch context=%p\n", context); + /* * We will invoke a global notify handler if installed. * This is done _before_ we invoke the per-device handler attached @@ -265,7 +271,19 @@ /* Now invoke the per-device handler, if present */ handler_obj = notify_info->notify.handler_obj; + printk(KERN_INFO "acpi_ev_notify_dispatch handler_obj=%p\n", handler_obj); if (handler_obj) { + if (notify_info->notify.node) { + printk(KERN_INFO "acpi_ev_notify_dispatch node type=0x%x\n", + notify_info->notify.node->type); + if (notify_info->notify.node->type == ACPI_TYPE_THERMAL && notify_info->notify.value == 0x80) { + printk(KERN_INFO "acpi_ev_notify_dispatch thermal device handler=%p\n", + handler_obj->notify.handler); + printk(KERN_INFO "acpi_ev_notify_dispatch thermal node=%p value=0x%x\n", + notify_info->notify.node, + notify_info->notify.value); + } + } handler_obj->notify.handler(notify_info->notify.node, notify_info->notify.value, handler_obj->notify.context); diff -U3 -r linux-2.6.16-old/drivers/acpi/events/evxface.c linux-2.6.16/drivers/acpi/events/evxface.c --- linux-2.6.16-old/drivers/acpi/events/evxface.c 2006-03-25 07:52:53.000000000 +0000 +++ linux-2.6.16/drivers/acpi/events/evxface.c 2006-03-25 08:06:50.000000000 +0000 @@ -248,15 +248,20 @@ ACPI_FUNCTION_TRACE("acpi_install_notify_handler"); + printk(KERN_INFO "acpi_install_notify_handler device=%p, type=0x%lx, handler=%p, context=%p\n", + device, handler_type, handler, context); + /* Parameter validation */ if ((!device) || (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { + printk(KERN_ERR "acpi_install_notify_handler failed (1)\n"); return_ACPI_STATUS(AE_BAD_PARAMETER); } status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); if (ACPI_FAILURE(status)) { + printk(KERN_ERR "acpi_install_notify_handler failed (2)\n"); return_ACPI_STATUS(status); } @@ -265,6 +270,7 @@ node = acpi_ns_map_handle_to_node(device); if (!node) { status = AE_BAD_PARAMETER; + printk(KERN_ERR "acpi_install_notify_handler failed (3)\n"); goto unlock_and_exit; } @@ -282,6 +288,7 @@ ((handler_type & ACPI_DEVICE_NOTIFY) && acpi_gbl_device_notify.handler)) { status = AE_ALREADY_EXISTS; + printk(KERN_ERR "acpi_install_notify_handler failed (4)\n"); goto unlock_and_exit; } @@ -310,6 +317,7 @@ if (!acpi_ev_is_notify_object(node)) { status = AE_TYPE; + printk(KERN_ERR "acpi_install_notify_handler failed (5)\n"); goto unlock_and_exit; } @@ -324,6 +332,7 @@ ((handler_type & ACPI_DEVICE_NOTIFY) && obj_desc->common_notify.device_notify)) { status = AE_ALREADY_EXISTS; + printk(KERN_ERR "acpi_install_notify_handler failed (6)\n"); goto unlock_and_exit; } } else { @@ -332,6 +341,7 @@ obj_desc = acpi_ut_create_internal_object(node->type); if (!obj_desc) { status = AE_NO_MEMORY; + printk("acpi_install_notify_handler failed (7)\n"); goto unlock_and_exit; } @@ -344,6 +354,7 @@ acpi_ut_remove_reference(obj_desc); if (ACPI_FAILURE(status)) { + printk(KERN_ERR "acpi_install_notify_handler failed (8)\n"); goto unlock_and_exit; } } @@ -354,6 +365,7 @@ acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_NOTIFY); if (!notify_obj) { status = AE_NO_MEMORY; + printk(KERN_ERR "acpi_install_notify_handler failed (9)\n"); goto unlock_and_exit; } @@ -378,6 +390,7 @@ unlock_and_exit: (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); + printk(KERN_INFO "acpi_install_notify_handler returns %d\n", status); return_ACPI_STATUS(status); } diff -U3 -r linux-2.6.16-old/drivers/acpi/osl.c linux-2.6.16/drivers/acpi/osl.c --- linux-2.6.16-old/drivers/acpi/osl.c 2006-03-25 07:52:59.000000000 +0000 +++ linux-2.6.16/drivers/acpi/osl.c 2006-03-25 07:53:44.000000000 +0000 @@ -81,6 +81,8 @@ return AE_OK; } +extern struct workqueue_struct *print_this_workqueue; + acpi_status acpi_os_initialize1(void) { /* @@ -93,6 +95,7 @@ return AE_NULL_ENTRY; } kacpid_wq = create_nofreeze_singlethread_workqueue("kacpid"); + print_this_workqueue = kacpid_wq; BUG_ON(!kacpid_wq); return AE_OK; @@ -670,6 +673,8 @@ return_VOID; } + printk(KERN_INFO "acpi_os_execute_deferred 0x%llx(0x%llx)\n", + (unsigned long long)dpc->function, (unsigned long long)dpc->context); dpc->function(dpc->context); kfree(dpc); @@ -714,6 +719,9 @@ dpc->function = function; dpc->context = context; + printk(KERN_INFO "acpi_os_queue_for_execution 0x%llx(0x%llx)\n", + (unsigned long long)dpc->function, (unsigned long long)dpc->context); + task = (void *)(dpc + 1); INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc); diff -U3 -r linux-2.6.16-old/kernel/workqueue.c linux-2.6.16/kernel/workqueue.c --- linux-2.6.16-old/kernel/workqueue.c 2006-03-25 07:52:59.000000000 +0000 +++ linux-2.6.16/kernel/workqueue.c 2006-03-25 08:12:12.000000000 +0000 @@ -147,6 +147,8 @@ return ret; } +struct workqueue_struct *print_this_workqueue = NULL; + static void run_workqueue(struct cpu_workqueue_struct *cwq) { unsigned long flags; @@ -174,6 +176,9 @@ BUG_ON(work->wq_data != cwq); clear_bit(0, &work->pending); + if (cwq->wq == print_this_workqueue) { + printk(KERN_INFO "run_workqueue f=%p data=%p\n", f, data); + } f(data); spin_lock_irqsave(&cwq->lock, flags); @@ -184,6 +189,17 @@ spin_unlock_irqrestore(&cwq->lock, flags); } +void debug_worker_thread_init(void) +{ + printk(KERN_INFO "debug_worker_thread: started\n"); +} + +static unsigned long long worker_thread_counter = 0ULL; +void debug_worker_thread_loop(void) +{ + worker_thread_counter++; +} + static int worker_thread(void *__cwq) { struct cpu_workqueue_struct *cwq = __cwq; @@ -193,6 +209,9 @@ set_user_nice(current, -5); + if (cwq->wq == print_this_workqueue) { + debug_worker_thread_init(); + } /* Block and flush all signals */ sigfillset(&blocked); sigprocmask(SIG_BLOCK, &blocked, NULL); @@ -206,6 +225,8 @@ set_current_state(TASK_INTERRUPTIBLE); while (!kthread_should_stop()) { + if (cwq->wq == print_this_workqueue) + debug_worker_thread_loop(); add_wait_queue(&cwq->more_work, &wait); if (list_empty(&cwq->worklist)) schedule(); @@ -214,6 +235,8 @@ try_to_freeze(); remove_wait_queue(&cwq->more_work, &wait); + if (cwq->wq == print_this_workqueue) + printk(KERN_INFO "worker_thread\n"); if (!list_empty(&cwq->worklist)) run_workqueue(cwq); set_current_state(TASK_INTERRUPTIBLE);