All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] i2c/i2c-ibm_iic: replace schedule_timeout() with
@ 2004-10-14 18:33 Nishanth Aravamudan
  0 siblings, 0 replies; only message in thread
From: Nishanth Aravamudan @ 2004-10-14 18:33 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

Any comments would be appreciated.

Description: Use msleep_interruptible() instead of schedule_timeout() to
guarantee the task delays as expected. Remove the unnecessary
set_current_state() following the if, as schedule_timeout() [and thus,
mlseep_interruptible()] is guaranteed to return in TASK_RUNNING.

--- 2.6.9-rc4-vanilla/drivers/i2c/busses/i2c-ibm_iic.c	2004-10-14 11:24:43.000000000 -0700
+++ 2.6.9-rc4/drivers/i2c/busses/i2c-ibm_iic.c	2004-10-14 11:30:08.000000000 -0700
@@ -416,10 +416,8 @@ static int iic_wait_for_tc(struct ibm_ii
     		init_waitqueue_entry(&wait, current);
 		
 		add_wait_queue(&dev->wq, &wait);
-		set_current_state(TASK_INTERRUPTIBLE);
 		if (in_8(&iic->sts) & STS_PT)
-			schedule_timeout(dev->adap.timeout * HZ);
-		set_current_state(TASK_RUNNING);
+			msleep_interruptible(dev->adap.timeout * 1000);
 		remove_wait_queue(&dev->wq, &wait);
 		
 		if (unlikely(signal_pending(current))){

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-14 18:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-14 18:33 [KJ] [PATCH] i2c/i2c-ibm_iic: replace schedule_timeout() with Nishanth Aravamudan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.