Skip to contentSkip to conversation

acpi/osl: correct HZ dependencies

PATCH New [email protected] 1 participant 1 message Jun 20, 2005 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 acpi/osl: correct HZ dependencies

From: Nishanth Aravamudan <nacc-r/[email protected]>

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.

---
 osl.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/acpi/osl.c +2 -3
Index: quilt/drivers/acpi/osl.c
===================================================================
@@ -317,8 +317,7 @@ acpi_os_remove_interrupt_handler(u32 irq
 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);
 
@@ -938,7 +937,7 @@ acpi_os_wait_semaphore(
 		// 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) {

--

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click