Hi, Please consider applying. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. The code is not wrong as is, but I see two benefits to using msleep(): 1) real time delays (milliseconds) and 2) consistency across the kernel with respect to longer delays. Change the units of the WaitDelay and AssertDelay constants accordingly. Signed-off-by: Nishanth Aravamudan Signed-off-by: Domen Puncer --- kj-domen/arch/ppc64/kernel/iSeries_pci_reset.c | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff -puN arch/ppc64/kernel/iSeries_pci_reset.c~msleep-arch_ppc64_kernel_iSeries_pci_reset arch/ppc64/kernel/iSeries_pci_reset.c --- kj/arch/ppc64/kernel/iSeries_pci_reset.c~msleep-arch_ppc64_kernel_iSeries_pci_reset 2005-01-23 00:24:08.000000000 +0100 +++ kj-domen/arch/ppc64/kernel/iSeries_pci_reset.c 2005-01-23 00:24:08.000000000 +0100 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -49,7 +50,7 @@ int iSeries_Device_ToggleReset(struct pci_dev *PciDev, int AssertTime, int DelayTime) { - unsigned long AssertDelay, WaitDelay; + unsigned int AssertDelay, WaitDelay; struct iSeries_Device_Node *DeviceNode = (struct iSeries_Device_Node *)PciDev->sysdata; @@ -62,14 +63,14 @@ int iSeries_Device_ToggleReset(struct pc * Set defaults, Assert is .5 second, Wait is 3 seconds. */ if (AssertTime == 0) - AssertDelay = (5 * HZ) / 10; + AssertDelay = 500; else - AssertDelay = (AssertTime * HZ) / 10; + AssertDelay = AssertTime * 100; if (DelayTime == 0) - WaitDelay = (30 * HZ) / 10; + WaitDelay = 3000; else - WaitDelay = (DelayTime * HZ) / 10; + WaitDelay = DelayTime * 100; /* * Assert reset @@ -77,8 +78,7 @@ int iSeries_Device_ToggleReset(struct pc DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode), 0x00, DeviceNode->AgentId, 1); if (DeviceNode->ReturnCode == 0) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(AssertDelay); /* Sleep for the time */ + msleep(AssertDelay); /* Sleep for the time */ DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode), 0x00, DeviceNode->AgentId, 0); @@ -86,8 +86,7 @@ int iSeries_Device_ToggleReset(struct pc /* * Wait for device to reset */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(WaitDelay); + msleep(WaitDelay); } if (DeviceNode->ReturnCode == 0) PCIFR("Slot 0x%04X.%02 Reset\n", ISERIES_BUS(DeviceNode), _