Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Nishanth Aravamudan and committed by
Jeff Garzik
4f2ad811 f17697a3

+2 -4
+2 -4
drivers/net/tokenring/lanstreamer.c
··· 455 455 writew(readw(streamer_mmio + BCTL) | BCTL_SOFTRESET, streamer_mmio + BCTL); 456 456 t = jiffies; 457 457 /* Hold soft reset bit for a while */ 458 - current->state = TASK_UNINTERRUPTIBLE; 459 - schedule_timeout(HZ); 458 + ssleep(1); 460 459 461 460 writew(readw(streamer_mmio + BCTL) & ~BCTL_SOFTRESET, 462 461 streamer_mmio + BCTL); ··· 511 512 writew(SISR_MI, streamer_mmio + SISR_MASK_SUM); 512 513 513 514 while (!((readw(streamer_mmio + SISR)) & SISR_SRB_REPLY)) { 514 - current->state = TASK_INTERRUPTIBLE; 515 - schedule_timeout(HZ/10); 515 + msleep_interruptible(100); 516 516 if (jiffies - t > 40 * HZ) { 517 517 printk(KERN_ERR 518 518 "IBM PCI tokenring card not responding\n");