diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-09-11 05:09:55 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-14 08:33:24 -0400 |
commit | 3173c8907ffb2c64456142da3df2bd0500bd59e0 (patch) | |
tree | dcd3700a2c37e24a2b5911bb5429aee715684926 | |
parent | 343c686c04eec556645f251f7d6c9b3d7335dae0 (diff) |
[PATCH] drivers/net: fix-up schedule_timeout() usage
Use schedule_timeout_interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r-- | drivers/net/8139cp.c | 3 | ||||
-rw-r--r-- | drivers/net/hp100.c | 48 | ||||
-rw-r--r-- | drivers/net/irda/stir4200.c | 7 | ||||
-rw-r--r-- | drivers/net/ixgb/ixgb_ethtool.c | 7 | ||||
-rw-r--r-- | drivers/net/ns83820.c | 3 | ||||
-rw-r--r-- | drivers/net/tokenring/ibmtr.c | 9 | ||||
-rw-r--r-- | drivers/net/tokenring/olympic.c | 2 | ||||
-rw-r--r-- | drivers/net/tokenring/tms380tr.c | 3 | ||||
-rw-r--r-- | drivers/net/typhoon.c | 7 | ||||
-rw-r--r-- | drivers/net/wan/cosa.c | 6 | ||||
-rw-r--r-- | drivers/net/wan/dscc4.c | 9 | ||||
-rw-r--r-- | drivers/net/wan/farsync.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2100.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_dev.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_mgt.c | 5 | ||||
-rw-r--r-- | include/linux/ibmtr.h | 4 | ||||
-rw-r--r-- | include/linux/netdevice.h | 6 |
17 files changed, 53 insertions, 92 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index ebc20d9e7d7b..bd99c268e2da 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1029,8 +1029,7 @@ static void cp_reset_hw (struct cp_private *cp) | |||
1029 | if (!(cpr8(Cmd) & CmdReset)) | 1029 | if (!(cpr8(Cmd) & CmdReset)) |
1030 | return; | 1030 | return; |
1031 | 1031 | ||
1032 | set_current_state(TASK_UNINTERRUPTIBLE); | 1032 | schedule_timeout_uninterruptible(10); |
1033 | schedule_timeout(10); | ||
1034 | } | 1033 | } |
1035 | 1034 | ||
1036 | printk(KERN_ERR "%s: hardware reset timeout\n", cp->dev->name); | 1035 | printk(KERN_ERR "%s: hardware reset timeout\n", cp->dev->name); |
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index cf0ac6fda1a1..b71fab6e34f4 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -2517,10 +2517,8 @@ static int hp100_down_vg_link(struct net_device *dev) | |||
2517 | do { | 2517 | do { |
2518 | if (hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST) | 2518 | if (hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST) |
2519 | break; | 2519 | break; |
2520 | if (!in_interrupt()) { | 2520 | if (!in_interrupt()) |
2521 | set_current_state(TASK_INTERRUPTIBLE); | 2521 | schedule_timeout_interruptible(1); |
2522 | schedule_timeout(1); | ||
2523 | } | ||
2524 | } while (time_after(time, jiffies)); | 2522 | } while (time_after(time, jiffies)); |
2525 | 2523 | ||
2526 | if (time_after_eq(jiffies, time)) /* no signal->no logout */ | 2524 | if (time_after_eq(jiffies, time)) /* no signal->no logout */ |
@@ -2536,10 +2534,8 @@ static int hp100_down_vg_link(struct net_device *dev) | |||
2536 | do { | 2534 | do { |
2537 | if (!(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST)) | 2535 | if (!(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST)) |
2538 | break; | 2536 | break; |
2539 | if (!in_interrupt()) { | 2537 | if (!in_interrupt()) |
2540 | set_current_state(TASK_INTERRUPTIBLE); | 2538 | schedule_timeout_interruptible(1); |
2541 | schedule_timeout(1); | ||
2542 | } | ||
2543 | } while (time_after(time, jiffies)); | 2539 | } while (time_after(time, jiffies)); |
2544 | 2540 | ||
2545 | #ifdef HP100_DEBUG | 2541 | #ifdef HP100_DEBUG |
@@ -2577,10 +2573,8 @@ static int hp100_down_vg_link(struct net_device *dev) | |||
2577 | do { | 2573 | do { |
2578 | if (!(hp100_inb(MAC_CFG_4) & HP100_MAC_SEL_ST)) | 2574 | if (!(hp100_inb(MAC_CFG_4) & HP100_MAC_SEL_ST)) |
2579 | break; | 2575 | break; |
2580 | if (!in_interrupt()) { | 2576 | if (!in_interrupt()) |
2581 | set_current_state(TASK_INTERRUPTIBLE); | 2577 | schedule_timeout_interruptible(1); |
2582 | schedule_timeout(1); | ||
2583 | } | ||
2584 | } while (time_after(time, jiffies)); | 2578 | } while (time_after(time, jiffies)); |
2585 | 2579 | ||
2586 | hp100_orb(HP100_AUTO_MODE, MAC_CFG_3); /* Autosel back on */ | 2580 | hp100_orb(HP100_AUTO_MODE, MAC_CFG_3); /* Autosel back on */ |
@@ -2591,10 +2585,8 @@ static int hp100_down_vg_link(struct net_device *dev) | |||
2591 | do { | 2585 | do { |
2592 | if ((hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST) == 0) | 2586 | if ((hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST) == 0) |
2593 | break; | 2587 | break; |
2594 | if (!in_interrupt()) { | 2588 | if (!in_interrupt()) |
2595 | set_current_state(TASK_INTERRUPTIBLE); | 2589 | schedule_timeout_interruptible(1); |
2596 | schedule_timeout(1); | ||
2597 | } | ||
2598 | } while (time_after(time, jiffies)); | 2590 | } while (time_after(time, jiffies)); |
2599 | 2591 | ||
2600 | if (time_before_eq(time, jiffies)) { | 2592 | if (time_before_eq(time, jiffies)) { |
@@ -2606,10 +2598,8 @@ static int hp100_down_vg_link(struct net_device *dev) | |||
2606 | 2598 | ||
2607 | time = jiffies + (2 * HZ); /* This seems to take a while.... */ | 2599 | time = jiffies + (2 * HZ); /* This seems to take a while.... */ |
2608 | do { | 2600 | do { |
2609 | if (!in_interrupt()) { | 2601 | if (!in_interrupt()) |
2610 | set_current_state(TASK_INTERRUPTIBLE); | 2602 | schedule_timeout_interruptible(1); |
2611 | schedule_timeout(1); | ||
2612 | } | ||
2613 | } while (time_after(time, jiffies)); | 2603 | } while (time_after(time, jiffies)); |
2614 | 2604 | ||
2615 | return 0; | 2605 | return 0; |
@@ -2659,10 +2649,8 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin) | |||
2659 | do { | 2649 | do { |
2660 | if (~(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST)) | 2650 | if (~(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST)) |
2661 | break; | 2651 | break; |
2662 | if (!in_interrupt()) { | 2652 | if (!in_interrupt()) |
2663 | set_current_state(TASK_INTERRUPTIBLE); | 2653 | schedule_timeout_interruptible(1); |
2664 | schedule_timeout(1); | ||
2665 | } | ||
2666 | } while (time_after(time, jiffies)); | 2654 | } while (time_after(time, jiffies)); |
2667 | 2655 | ||
2668 | /* Start an addressed training and optionally request promiscuous port */ | 2656 | /* Start an addressed training and optionally request promiscuous port */ |
@@ -2697,10 +2685,8 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin) | |||
2697 | do { | 2685 | do { |
2698 | if (hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST) | 2686 | if (hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST) |
2699 | break; | 2687 | break; |
2700 | if (!in_interrupt()) { | 2688 | if (!in_interrupt()) |
2701 | set_current_state(TASK_INTERRUPTIBLE); | 2689 | schedule_timeout_interruptible(1); |
2702 | schedule_timeout(1); | ||
2703 | } | ||
2704 | } while (time_before(jiffies, time)); | 2690 | } while (time_before(jiffies, time)); |
2705 | 2691 | ||
2706 | if (time_after_eq(jiffies, time)) { | 2692 | if (time_after_eq(jiffies, time)) { |
@@ -2723,10 +2709,8 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin) | |||
2723 | #endif | 2709 | #endif |
2724 | break; | 2710 | break; |
2725 | } | 2711 | } |
2726 | if (!in_interrupt()) { | 2712 | if (!in_interrupt()) |
2727 | set_current_state(TASK_INTERRUPTIBLE); | 2713 | schedule_timeout_interruptible(1); |
2728 | schedule_timeout(1); | ||
2729 | } | ||
2730 | } while (time_after(time, jiffies)); | 2714 | } while (time_after(time, jiffies)); |
2731 | } | 2715 | } |
2732 | 2716 | ||
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c index 15f207323d97..3961a754e920 100644 --- a/drivers/net/irda/stir4200.c +++ b/drivers/net/irda/stir4200.c | |||
@@ -678,10 +678,9 @@ static void turnaround_delay(const struct stir_cb *stir, long us) | |||
678 | return; | 678 | return; |
679 | 679 | ||
680 | ticks = us / (1000000 / HZ); | 680 | ticks = us / (1000000 / HZ); |
681 | if (ticks > 0) { | 681 | if (ticks > 0) |
682 | current->state = TASK_INTERRUPTIBLE; | 682 | schedule_timeout_interruptible(1 + ticks); |
683 | schedule_timeout(1 + ticks); | 683 | else |
684 | } else | ||
685 | udelay(us); | 684 | udelay(us); |
686 | } | 685 | } |
687 | 686 | ||
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c index 319ee4cd70d8..04e47189d830 100644 --- a/drivers/net/ixgb/ixgb_ethtool.c +++ b/drivers/net/ixgb/ixgb_ethtool.c | |||
@@ -645,11 +645,10 @@ ixgb_phys_id(struct net_device *netdev, uint32_t data) | |||
645 | 645 | ||
646 | mod_timer(&adapter->blink_timer, jiffies); | 646 | mod_timer(&adapter->blink_timer, jiffies); |
647 | 647 | ||
648 | set_current_state(TASK_INTERRUPTIBLE); | 648 | if (data) |
649 | if(data) | 649 | schedule_timeout_interruptible(data * HZ); |
650 | schedule_timeout(data * HZ); | ||
651 | else | 650 | else |
652 | schedule_timeout(MAX_SCHEDULE_TIMEOUT); | 651 | schedule_timeout_interruptible(MAX_SCHEDULE_TIMEOUT); |
653 | 652 | ||
654 | del_timer_sync(&adapter->blink_timer); | 653 | del_timer_sync(&adapter->blink_timer); |
655 | ixgb_led_off(&adapter->hw); | 654 | ixgb_led_off(&adapter->hw); |
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index e64df4d0800b..ed72a23c85dd 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c | |||
@@ -1632,8 +1632,7 @@ static void ns83820_run_bist(struct net_device *ndev, const char *name, u32 enab | |||
1632 | timed_out = 1; | 1632 | timed_out = 1; |
1633 | break; | 1633 | break; |
1634 | } | 1634 | } |
1635 | set_current_state(TASK_UNINTERRUPTIBLE); | 1635 | schedule_timeout_uninterruptible(1); |
1636 | schedule_timeout(1); | ||
1637 | } | 1636 | } |
1638 | 1637 | ||
1639 | if (status & fail) | 1638 | if (status & fail) |
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c index e7b001017b9a..8154bbbb7792 100644 --- a/drivers/net/tokenring/ibmtr.c +++ b/drivers/net/tokenring/ibmtr.c | |||
@@ -318,7 +318,7 @@ static void ibmtr_cleanup_card(struct net_device *dev) | |||
318 | if (dev->base_addr) { | 318 | if (dev->base_addr) { |
319 | outb(0,dev->base_addr+ADAPTRESET); | 319 | outb(0,dev->base_addr+ADAPTRESET); |
320 | 320 | ||
321 | schedule_timeout(TR_RST_TIME); /* wait 50ms */ | 321 | schedule_timeout_uninterruptible(TR_RST_TIME); /* wait 50ms */ |
322 | 322 | ||
323 | outb(0,dev->base_addr+ADAPTRESETREL); | 323 | outb(0,dev->base_addr+ADAPTRESETREL); |
324 | } | 324 | } |
@@ -859,8 +859,7 @@ static int tok_init_card(struct net_device *dev) | |||
859 | writeb(~INT_ENABLE, ti->mmio + ACA_OFFSET + ACA_RESET + ISRP_EVEN); | 859 | writeb(~INT_ENABLE, ti->mmio + ACA_OFFSET + ACA_RESET + ISRP_EVEN); |
860 | outb(0, PIOaddr + ADAPTRESET); | 860 | outb(0, PIOaddr + ADAPTRESET); |
861 | 861 | ||
862 | current->state=TASK_UNINTERRUPTIBLE; | 862 | schedule_timeout_uninterruptible(TR_RST_TIME); /* wait 50ms */ |
863 | schedule_timeout(TR_RST_TIME); /* wait 50ms */ | ||
864 | 863 | ||
865 | outb(0, PIOaddr + ADAPTRESETREL); | 864 | outb(0, PIOaddr + ADAPTRESETREL); |
866 | #ifdef ENABLE_PAGING | 865 | #ifdef ENABLE_PAGING |
@@ -908,8 +907,8 @@ static int tok_open(struct net_device *dev) | |||
908 | DPRINTK("Adapter is up and running\n"); | 907 | DPRINTK("Adapter is up and running\n"); |
909 | return 0; | 908 | return 0; |
910 | } | 909 | } |
911 | current->state=TASK_INTERRUPTIBLE; | 910 | i=schedule_timeout_interruptible(TR_RETRY_INTERVAL); |
912 | i=schedule_timeout(TR_RETRY_INTERVAL); /* wait 30 seconds */ | 911 | /* wait 30 seconds */ |
913 | if(i!=0) break; /*prob. a signal, like the i>24*HZ case above */ | 912 | if(i!=0) break; /*prob. a signal, like the i>24*HZ case above */ |
914 | } | 913 | } |
915 | outb(0, dev->base_addr + ADAPTRESET);/* kill pending interrupts*/ | 914 | outb(0, dev->base_addr + ADAPTRESET);/* kill pending interrupts*/ |
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index 9e7923192a49..05477d24fd49 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c | |||
@@ -1101,7 +1101,7 @@ static int olympic_close(struct net_device *dev) | |||
1101 | 1101 | ||
1102 | while(olympic_priv->srb_queued) { | 1102 | while(olympic_priv->srb_queued) { |
1103 | 1103 | ||
1104 | t = schedule_timeout(60*HZ); | 1104 | t = schedule_timeout_interruptible(60*HZ); |
1105 | 1105 | ||
1106 | if(signal_pending(current)) { | 1106 | if(signal_pending(current)) { |
1107 | printk(KERN_WARNING "%s: SRB timed out.\n",dev->name); | 1107 | printk(KERN_WARNING "%s: SRB timed out.\n",dev->name); |
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c index 2e39bf1f7462..c1925590a0e1 100644 --- a/drivers/net/tokenring/tms380tr.c +++ b/drivers/net/tokenring/tms380tr.c | |||
@@ -1243,8 +1243,7 @@ void tms380tr_wait(unsigned long time) | |||
1243 | 1243 | ||
1244 | tmp = jiffies + time/(1000000/HZ); | 1244 | tmp = jiffies + time/(1000000/HZ); |
1245 | do { | 1245 | do { |
1246 | current->state = TASK_INTERRUPTIBLE; | 1246 | tmp = schedule_timeout_interruptible(tmp); |
1247 | tmp = schedule_timeout(tmp); | ||
1248 | } while(time_after(tmp, jiffies)); | 1247 | } while(time_after(tmp, jiffies)); |
1249 | #else | 1248 | #else |
1250 | udelay(time); | 1249 | udelay(time); |
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index ecfa6f8805ce..4c76cb794bfb 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c | |||
@@ -419,10 +419,9 @@ typhoon_reset(void __iomem *ioaddr, int wait_type) | |||
419 | TYPHOON_STATUS_WAITING_FOR_HOST) | 419 | TYPHOON_STATUS_WAITING_FOR_HOST) |
420 | goto out; | 420 | goto out; |
421 | 421 | ||
422 | if(wait_type == WaitSleep) { | 422 | if(wait_type == WaitSleep) |
423 | set_current_state(TASK_UNINTERRUPTIBLE); | 423 | schedule_timeout_uninterruptible(1); |
424 | schedule_timeout(1); | 424 | else |
425 | } else | ||
426 | udelay(TYPHOON_UDELAY); | 425 | udelay(TYPHOON_UDELAY); |
427 | } | 426 | } |
428 | 427 | ||
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index 7ff814fd65d0..ae9e897c255e 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c | |||
@@ -1617,8 +1617,7 @@ static int get_wait_data(struct cosa_data *cosa) | |||
1617 | return r; | 1617 | return r; |
1618 | } | 1618 | } |
1619 | /* sleep if not ready to read */ | 1619 | /* sleep if not ready to read */ |
1620 | set_current_state(TASK_INTERRUPTIBLE); | 1620 | schedule_timeout_interruptible(1); |
1621 | schedule_timeout(1); | ||
1622 | } | 1621 | } |
1623 | printk(KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n", | 1622 | printk(KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n", |
1624 | cosa_getstatus(cosa)); | 1623 | cosa_getstatus(cosa)); |
@@ -1644,8 +1643,7 @@ static int put_wait_data(struct cosa_data *cosa, int data) | |||
1644 | } | 1643 | } |
1645 | #if 0 | 1644 | #if 0 |
1646 | /* sleep if not ready to read */ | 1645 | /* sleep if not ready to read */ |
1647 | current->state = TASK_INTERRUPTIBLE; | 1646 | schedule_timeout_interruptible(1); |
1648 | schedule_timeout(1); | ||
1649 | #endif | 1647 | #endif |
1650 | } | 1648 | } |
1651 | printk(KERN_INFO "cosa%d: timeout in put_wait_data (status 0x%x)\n", | 1649 | printk(KERN_INFO "cosa%d: timeout in put_wait_data (status 0x%x)\n", |
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c index 520a77a798e2..0c1ab4ac8bdb 100644 --- a/drivers/net/wan/dscc4.c +++ b/drivers/net/wan/dscc4.c | |||
@@ -542,8 +542,7 @@ static int dscc4_wait_ack_cec(struct dscc4_dev_priv *dpriv, | |||
542 | msg, i); | 542 | msg, i); |
543 | goto done; | 543 | goto done; |
544 | } | 544 | } |
545 | set_current_state(TASK_UNINTERRUPTIBLE); | 545 | schedule_timeout_uninterruptible(10); |
546 | schedule_timeout(10); | ||
547 | rmb(); | 546 | rmb(); |
548 | } while (++i > 0); | 547 | } while (++i > 0); |
549 | printk(KERN_ERR "%s: %s timeout\n", dev->name, msg); | 548 | printk(KERN_ERR "%s: %s timeout\n", dev->name, msg); |
@@ -588,8 +587,7 @@ static inline int dscc4_xpr_ack(struct dscc4_dev_priv *dpriv) | |||
588 | (dpriv->iqtx[cur] & Xpr)) | 587 | (dpriv->iqtx[cur] & Xpr)) |
589 | break; | 588 | break; |
590 | smp_rmb(); | 589 | smp_rmb(); |
591 | set_current_state(TASK_UNINTERRUPTIBLE); | 590 | schedule_timeout_uninterruptible(10); |
592 | schedule_timeout(10); | ||
593 | } while (++i > 0); | 591 | } while (++i > 0); |
594 | 592 | ||
595 | return (i >= 0 ) ? i : -EAGAIN; | 593 | return (i >= 0 ) ? i : -EAGAIN; |
@@ -1035,8 +1033,7 @@ static void dscc4_pci_reset(struct pci_dev *pdev, void __iomem *ioaddr) | |||
1035 | /* Flush posted writes */ | 1033 | /* Flush posted writes */ |
1036 | readl(ioaddr + GSTAR); | 1034 | readl(ioaddr + GSTAR); |
1037 | 1035 | ||
1038 | set_current_state(TASK_UNINTERRUPTIBLE); | 1036 | schedule_timeout_uninterruptible(10); |
1039 | schedule_timeout(10); | ||
1040 | 1037 | ||
1041 | for (i = 0; i < 16; i++) | 1038 | for (i = 0; i < 16; i++) |
1042 | pci_write_config_dword(pdev, i << 2, dscc4_pci_config_store[i]); | 1039 | pci_write_config_dword(pdev, i << 2, dscc4_pci_config_store[i]); |
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index 2c83cca34b86..10befb02d768 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
@@ -980,8 +980,7 @@ fst_issue_cmd(struct fst_port_info *port, unsigned short cmd) | |||
980 | /* Wait for any previous command to complete */ | 980 | /* Wait for any previous command to complete */ |
981 | while (mbval > NAK) { | 981 | while (mbval > NAK) { |
982 | spin_unlock_irqrestore(&card->card_lock, flags); | 982 | spin_unlock_irqrestore(&card->card_lock, flags); |
983 | set_current_state(TASK_UNINTERRUPTIBLE); | 983 | schedule_timeout_uninterruptible(1); |
984 | schedule_timeout(1); | ||
985 | spin_lock_irqsave(&card->card_lock, flags); | 984 | spin_lock_irqsave(&card->card_lock, flags); |
986 | 985 | ||
987 | if (++safety > 2000) { | 986 | if (++safety > 2000) { |
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 2414e6493aa5..e5cdb5bfabc8 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -800,8 +800,7 @@ static int ipw2100_hw_send_command(struct ipw2100_priv *priv, | |||
800 | * doesn't seem to have as many firmware restart cycles... | 800 | * doesn't seem to have as many firmware restart cycles... |
801 | * | 801 | * |
802 | * As a test, we're sticking in a 1/100s delay here */ | 802 | * As a test, we're sticking in a 1/100s delay here */ |
803 | set_current_state(TASK_UNINTERRUPTIBLE); | 803 | schedule_timeout_uninterruptible(msecs_to_jiffies(10)); |
804 | schedule_timeout(HZ / 100); | ||
805 | 804 | ||
806 | return 0; | 805 | return 0; |
807 | 806 | ||
@@ -1256,8 +1255,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv) | |||
1256 | IPW_DEBUG_FW("Waiting for f/w initialization to complete...\n"); | 1255 | IPW_DEBUG_FW("Waiting for f/w initialization to complete...\n"); |
1257 | i = 5000; | 1256 | i = 5000; |
1258 | do { | 1257 | do { |
1259 | set_current_state(TASK_UNINTERRUPTIBLE); | 1258 | schedule_timeout_uninterruptible(msecs_to_jiffies(40)); |
1260 | schedule_timeout(40 * HZ / 1000); | ||
1261 | /* Todo... wait for sync command ... */ | 1259 | /* Todo... wait for sync command ... */ |
1262 | 1260 | ||
1263 | read_register(priv->net_dev, IPW_REG_INTA, &inta); | 1261 | read_register(priv->net_dev, IPW_REG_INTA, &inta); |
@@ -1411,8 +1409,7 @@ static int ipw2100_hw_phy_off(struct ipw2100_priv *priv) | |||
1411 | (val2 & IPW2100_COMMAND_PHY_OFF)) | 1409 | (val2 & IPW2100_COMMAND_PHY_OFF)) |
1412 | return 0; | 1410 | return 0; |
1413 | 1411 | ||
1414 | set_current_state(TASK_UNINTERRUPTIBLE); | 1412 | schedule_timeout_uninterruptible(HW_PHY_OFF_LOOP_DELAY); |
1415 | schedule_timeout(HW_PHY_OFF_LOOP_DELAY); | ||
1416 | } | 1413 | } |
1417 | 1414 | ||
1418 | return -EIO; | 1415 | return -EIO; |
@@ -1466,7 +1463,7 @@ fail_up: | |||
1466 | 1463 | ||
1467 | static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv) | 1464 | static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv) |
1468 | { | 1465 | { |
1469 | #define HW_POWER_DOWN_DELAY (HZ / 10) | 1466 | #define HW_POWER_DOWN_DELAY (msecs_to_jiffies(100)) |
1470 | 1467 | ||
1471 | struct host_command cmd = { | 1468 | struct host_command cmd = { |
1472 | .host_command = HOST_PRE_POWER_DOWN, | 1469 | .host_command = HOST_PRE_POWER_DOWN, |
@@ -1520,10 +1517,8 @@ static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv) | |||
1520 | printk(KERN_WARNING DRV_NAME ": " | 1517 | printk(KERN_WARNING DRV_NAME ": " |
1521 | "%s: Power down command failed: Error %d\n", | 1518 | "%s: Power down command failed: Error %d\n", |
1522 | priv->net_dev->name, err); | 1519 | priv->net_dev->name, err); |
1523 | else { | 1520 | else |
1524 | set_current_state(TASK_UNINTERRUPTIBLE); | 1521 | schedule_timeout_uninterruptible(HW_POWER_DOWN_DELAY); |
1525 | schedule_timeout(HW_POWER_DOWN_DELAY); | ||
1526 | } | ||
1527 | } | 1522 | } |
1528 | 1523 | ||
1529 | priv->status &= ~STATUS_ENABLED; | 1524 | priv->status &= ~STATUS_ENABLED; |
diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c index 6f13d4a8e2d3..10cce514c15d 100644 --- a/drivers/net/wireless/prism54/islpci_dev.c +++ b/drivers/net/wireless/prism54/islpci_dev.c | |||
@@ -439,8 +439,7 @@ prism54_bring_down(islpci_private *priv) | |||
439 | wmb(); | 439 | wmb(); |
440 | 440 | ||
441 | /* wait a while for the device to reset */ | 441 | /* wait a while for the device to reset */ |
442 | set_current_state(TASK_UNINTERRUPTIBLE); | 442 | schedule_timeout_uninterruptible(msecs_to_jiffies(50)); |
443 | schedule_timeout(50*HZ/1000); | ||
444 | 443 | ||
445 | return 0; | 444 | return 0; |
446 | } | 445 | } |
@@ -491,8 +490,7 @@ islpci_reset_if(islpci_private *priv) | |||
491 | /* The software reset acknowledge needs about 220 msec here. | 490 | /* The software reset acknowledge needs about 220 msec here. |
492 | * Be conservative and wait for up to one second. */ | 491 | * Be conservative and wait for up to one second. */ |
493 | 492 | ||
494 | set_current_state(TASK_UNINTERRUPTIBLE); | 493 | remaining = schedule_timeout_uninterruptible(HZ); |
495 | remaining = schedule_timeout(HZ); | ||
496 | 494 | ||
497 | if(remaining > 0) { | 495 | if(remaining > 0) { |
498 | result = 0; | 496 | result = 0; |
diff --git a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c index b6f2e5a223be..4937a5ad4b2c 100644 --- a/drivers/net/wireless/prism54/islpci_mgt.c +++ b/drivers/net/wireless/prism54/islpci_mgt.c | |||
@@ -455,7 +455,7 @@ islpci_mgt_transaction(struct net_device *ndev, | |||
455 | struct islpci_mgmtframe **recvframe) | 455 | struct islpci_mgmtframe **recvframe) |
456 | { | 456 | { |
457 | islpci_private *priv = netdev_priv(ndev); | 457 | islpci_private *priv = netdev_priv(ndev); |
458 | const long wait_cycle_jiffies = (ISL38XX_WAIT_CYCLE * 10 * HZ) / 1000; | 458 | const long wait_cycle_jiffies = msecs_to_jiffies(ISL38XX_WAIT_CYCLE * 10); |
459 | long timeout_left = ISL38XX_MAX_WAIT_CYCLES * wait_cycle_jiffies; | 459 | long timeout_left = ISL38XX_MAX_WAIT_CYCLES * wait_cycle_jiffies; |
460 | int err; | 460 | int err; |
461 | DEFINE_WAIT(wait); | 461 | DEFINE_WAIT(wait); |
@@ -475,8 +475,7 @@ islpci_mgt_transaction(struct net_device *ndev, | |||
475 | int timeleft; | 475 | int timeleft; |
476 | struct islpci_mgmtframe *frame; | 476 | struct islpci_mgmtframe *frame; |
477 | 477 | ||
478 | set_current_state(TASK_UNINTERRUPTIBLE); | 478 | timeleft = schedule_timeout_uninterruptible(wait_cycle_jiffies); |
479 | timeleft = schedule_timeout(wait_cycle_jiffies); | ||
480 | frame = xchg(&priv->mgmt_received, NULL); | 479 | frame = xchg(&priv->mgmt_received, NULL); |
481 | if (frame) { | 480 | if (frame) { |
482 | if (frame->header->oid == oid) { | 481 | if (frame->header->oid == oid) { |
diff --git a/include/linux/ibmtr.h b/include/linux/ibmtr.h index 2ef0b21517fb..1c7a0dd5536a 100644 --- a/include/linux/ibmtr.h +++ b/include/linux/ibmtr.h | |||
@@ -7,8 +7,8 @@ | |||
7 | /* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */ | 7 | /* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */ |
8 | 8 | ||
9 | #define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */ | 9 | #define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */ |
10 | #define TR_RST_TIME (HZ/20) /* 5 on PC = 50 ms */ | 10 | #define TR_RST_TIME (msecs_to_jiffies(50)) /* 5 on PC = 50 ms */ |
11 | #define TR_BUSY_INTERVAL (HZ/5) /* 5 on PC = 200 ms */ | 11 | #define TR_BUSY_INTERVAL (msecs_to_jiffies(200)) /* 5 on PC = 200 ms */ |
12 | #define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */ | 12 | #define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */ |
13 | 13 | ||
14 | #define TR_ISA 1 | 14 | #define TR_ISA 1 |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7c717907896d..98c98e6cd4f3 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -852,11 +852,9 @@ static inline void netif_rx_complete(struct net_device *dev) | |||
852 | 852 | ||
853 | static inline void netif_poll_disable(struct net_device *dev) | 853 | static inline void netif_poll_disable(struct net_device *dev) |
854 | { | 854 | { |
855 | while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { | 855 | while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) |
856 | /* No hurry. */ | 856 | /* No hurry. */ |
857 | current->state = TASK_INTERRUPTIBLE; | 857 | schedule_timeout_interruptible(1); |
858 | schedule_timeout(1); | ||
859 | } | ||
860 | } | 858 | } |
861 | 859 | ||
862 | static inline void netif_poll_enable(struct net_device *dev) | 860 | static inline void netif_poll_enable(struct net_device *dev) |