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

[PATCH] pci hotplug/pciehp: 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 c995de37
......@@ -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"
......@@ -261,14 +262,12 @@ 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 (!pciehp_poll_mode) {
if (!pciehp_poll_mode)
/* Sleep for up to 1 second */
schedule_timeout(1*HZ);
} else
schedule_timeout(2.5*HZ);
msleep_interruptible(1000);
else
msleep_interruptible(2500);
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