Commit c995de37 authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by Greg Kroah-Hartman

[PATCH] pci hotplug/shpchp: replace schedule_timeout() with msleep_interruptible()

Use msleep_interruptible() instead of schedule_timeout() to guarantee
the task delays as expected.
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent a4218e07
......@@ -31,6 +31,7 @@
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <asm/semaphore.h>
#include <asm/io.h>
#include "pci_hotplug.h"
......@@ -381,16 +382,14 @@ static inline int wait_for_ctrl_irq (struct controller *ctrl)
dbg("%s : start\n",__FUNCTION__);
add_wait_queue(&ctrl->queue, &wait);
set_current_state(TASK_INTERRUPTIBLE);
if (!shpchp_poll_mode) {
/* Sleep for up to 1 second */
schedule_timeout(1*HZ);
msleep_interruptible(1000);
} else {
/* Sleep for up to 2 seconds */
schedule_timeout(2*HZ);
msleep_interruptible(2000);
}
set_current_state(TASK_RUNNING);
remove_wait_queue(&ctrl->queue, &wait);
if (signal_pending(current))
retval = -EINTR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment