[PATCH] drivers/acpi/osl.c: correct HZ dependencies From: Nishanth Aravamudan The osl driver has a few dependencies on HZ which are not handled correctly for all values. Use msleep_interruptible() and jiffies_to_msecs() to rectify the situation. Patch is compile-tested. Signed-off-by: Nishanth Aravamudan Signed-off-by: Domen Puncer Signed-off-by: Alexey Dobriyan Index: linux-kj/drivers/acpi/osl.c =================================================================== --- linux-kj.orig/drivers/acpi/osl.c 2005-09-21 01:19:07.000000000 +0400 +++ linux-kj/drivers/acpi/osl.c 2005-09-21 01:24:19.000000000 +0400 @@ -313,8 +313,7 @@ acpi_status acpi_os_remove_interrupt_han void acpi_os_sleep(acpi_integer ms) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(((signed long)ms * HZ) / 1000); + msleep_interruptible((unsigned int)ms); } EXPORT_SYMBOL(acpi_os_sleep); @@ -834,7 +833,7 @@ acpi_status acpi_os_wait_semaphore(acpi_ // TODO: A better timeout algorithm? { int i = 0; - static const int quantum_ms = 1000 / HZ; + unsigned int quantum_ms = jiffies_to_msecs(1); ret = down_trylock(sem); for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) {