[patch 3/7] net/lanstreamer: replace schedule_timeout() with ssleep()/msleep_interruptible()

From: domen
Date: Sun Mar 06 2005 - 17:32:10 EST






Use ssleep() / msleep_interruptible() [as appropriate]
instead of schedule_timeout() to guarantee the task delays as expected.

Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>
Signed-off-by: Maximilian Attems <janitor@xxxxxxxxxxxxxx>
Signed-off-by: Domen Puncer <domen@xxxxxxxxxxxx>
---


kj-domen/drivers/net/tokenring/lanstreamer.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff -puN drivers/net/tokenring/lanstreamer.c~ssleep+msleep_interruptible-drivers_net_tokenring_lanstreamer drivers/net/tokenring/lanstreamer.c
--- kj/drivers/net/tokenring/lanstreamer.c~ssleep+msleep_interruptible-drivers_net_tokenring_lanstreamer 2005-03-05 16:09:51.000000000 +0100
+++ kj-domen/drivers/net/tokenring/lanstreamer.c 2005-03-05 16:09:51.000000000 +0100
@@ -454,8 +454,7 @@ static int streamer_reset(struct net_dev
writew(readw(streamer_mmio + BCTL) | BCTL_SOFTRESET, streamer_mmio + BCTL);
t = jiffies;
/* Hold soft reset bit for a while */
- current->state = TASK_UNINTERRUPTIBLE;
- schedule_timeout(HZ);
+ ssleep(1);

writew(readw(streamer_mmio + BCTL) & ~BCTL_SOFTRESET,
streamer_mmio + BCTL);
@@ -511,8 +510,7 @@ static int streamer_reset(struct net_dev
writew(SISR_MI, streamer_mmio + SISR_MASK_SUM);

while (!((readw(streamer_mmio + SISR)) & SISR_SRB_REPLY)) {
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(HZ/10);
+ msleep_interruptible(100);
if (jiffies - t > 40 * HZ) {
printk(KERN_ERR
"IBM PCI tokenring card not responding\n");
_
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html