powerpc/eeh: Fix use of set_current_state() in eeh event handling set_current_state...
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 28 Mar 2012 12:20:58 +0000 (12:20 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 2 Apr 2012 04:31:19 +0000 (14:31 +1000)
That set_current_state() won't work very well: the subsequent mutex_lock()
might flip the task back into TASK_RUNNING.

Attempt to put it somewhere where it might have been meant to be, and
attempt to describe why it might have been added.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/pseries/eeh_event.c

index 92dd84c124f18f6ce9aa158d83c390045ca66577..4cb375c0f8d173ff545c665971d8054d61fdfc17 100644 (file)
@@ -60,7 +60,6 @@ static int eeh_event_handler(void * dummy)
        struct eeh_dev *edev;
 
        set_task_comm(current, "eehd");
-       set_current_state(TASK_INTERRUPTIBLE);
 
        spin_lock_irqsave(&eeh_eventlist_lock, flags);
        event = NULL;
@@ -83,6 +82,7 @@ static int eeh_event_handler(void * dummy)
        printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n",
               eeh_pci_name(edev->pdev));
 
+       set_current_state(TASK_INTERRUPTIBLE);  /* Don't add to load average */
        edev = handle_eeh_events(event);
 
        eeh_clear_slot(eeh_dev_to_of_node(edev), EEH_MODE_RECOVERING);