* [KJ] [PATCH 4/28] net/cosa: replace schedule_timeout() with msleep()
@ 2005-01-06 23:41 Nishanth Aravamudan
0 siblings, 0 replies; only message in thread
From: Nishanth Aravamudan @ 2005-01-06 23:41 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-net, netdev
[-- Attachment #1: Type: text/plain, Size: 1572 bytes --]
Hi,
Description: Use msleep() instead of schedule_timeout() to guarantee the task
delays as expected. Also uses the set_current_state() macro instead of direct
assignment in a pair of spots. I am still concerned about those sleeps, as
TASK_INTERRUPTIBLE() is used without any checking for signals. Hence I used
msleep() for the longer delay. Perhaps the 30 jiffy delay has not been
updated for the larger HZ values and thus could be changed to msleep(300).
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- 2.6.10-v/drivers/net/wan/cosa.c 2004-12-24 13:33:49.000000000 -0800
+++ 2.6.10/drivers/net/wan/cosa.c 2005-01-04 14:57:49.000000000 -0800
@@ -543,7 +543,7 @@ static int cosa_probe(int base, int irq,
* FIXME: When this code is not used as module, we should
* probably call udelay() instead of the interruptible sleep.
*/
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
cosa_putstatus(cosa, SR_TX_INT_ENA);
schedule_timeout(30);
irq = probe_irq_off(irqs);
@@ -1564,8 +1564,7 @@ static int cosa_reset_and_read_id(struct
cosa_getdata8(cosa);
cosa_putstatus(cosa, SR_RST);
#ifdef MODULE
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(HZ/2);
+ msleep(500);
#else
udelay(5*100000);
#endif
@@ -1618,7 +1617,7 @@ static int get_wait_data(struct cosa_dat
return r;
}
/* sleep if not ready to read */
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(1);
}
printk(KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n",
[-- 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:[~2005-01-06 23:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-06 23:41 [KJ] [PATCH 4/28] net/cosa: replace schedule_timeout() with msleep() Nishanth Aravamudan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).