[PATCH] net/lanstreamer: replace schedule_timeout() with ssleep()/msleep_interruptible()
Use ssleep() / msleep_interruptible() [as appropriate] instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Maximilian Attems <janitor@sternwelten.at> Signed-off-by: Domen Puncer <domen@coderock.org>
This commit is contained in:
parent
f17697a37c
commit
4f2ad81104
|
@ -455,8 +455,7 @@ static int streamer_reset(struct net_device *dev)
|
||||||
writew(readw(streamer_mmio + BCTL) | BCTL_SOFTRESET, streamer_mmio + BCTL);
|
writew(readw(streamer_mmio + BCTL) | BCTL_SOFTRESET, streamer_mmio + BCTL);
|
||||||
t = jiffies;
|
t = jiffies;
|
||||||
/* Hold soft reset bit for a while */
|
/* Hold soft reset bit for a while */
|
||||||
current->state = TASK_UNINTERRUPTIBLE;
|
ssleep(1);
|
||||||
schedule_timeout(HZ);
|
|
||||||
|
|
||||||
writew(readw(streamer_mmio + BCTL) & ~BCTL_SOFTRESET,
|
writew(readw(streamer_mmio + BCTL) & ~BCTL_SOFTRESET,
|
||||||
streamer_mmio + BCTL);
|
streamer_mmio + BCTL);
|
||||||
|
@ -512,8 +511,7 @@ static int streamer_reset(struct net_device *dev)
|
||||||
writew(SISR_MI, streamer_mmio + SISR_MASK_SUM);
|
writew(SISR_MI, streamer_mmio + SISR_MASK_SUM);
|
||||||
|
|
||||||
while (!((readw(streamer_mmio + SISR)) & SISR_SRB_REPLY)) {
|
while (!((readw(streamer_mmio + SISR)) & SISR_SRB_REPLY)) {
|
||||||
current->state = TASK_INTERRUPTIBLE;
|
msleep_interruptible(100);
|
||||||
schedule_timeout(HZ/10);
|
|
||||||
if (jiffies - t > 40 * HZ) {
|
if (jiffies - t > 40 * HZ) {
|
||||||
printk(KERN_ERR
|
printk(KERN_ERR
|
||||||
"IBM PCI tokenring card not responding\n");
|
"IBM PCI tokenring card not responding\n");
|
||||||
|
|
Loading…
Reference in New Issue