aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2006-05-19 10:51:21 -0400
committerJeff Garzik <jeff@garzik.org>2006-05-20 00:14:49 -0400
commit38bb6b288bf4fb954a3793e57c7339774c842a54 (patch)
treed4b16a5f6a38a95a15868d9df8ac1903252ae211 /drivers
parentf34ba4e1edd82272dbc192e488c7dc9e56c4ec62 (diff)
[PATCH] via-rhine: revert "change mdelay to msleep and remove from ISR path"
Revert previous patch with subject "change mdelay to msleep and remove from ISR path". This patch seems to have caused bigger problems than it solved, and it didn't solve much of a problem to begin with... Discussion about backing-out this patch can be found here: http://marc.theaimsgroup.com/?l=linux-netdev&m=114321570402396&w=2 The git commit associated w/ the original patch is: 6ba98d311d0a4ff7dc36d8f435ce60174f4c30ec Signed-off-by: John W. Linville <linville@tuxdriver.com Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/via-rhine.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index a6dc53b4250d..fdc21037f6dc 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -491,8 +491,6 @@ struct rhine_private {
491 u8 tx_thresh, rx_thresh; 491 u8 tx_thresh, rx_thresh;
492 492
493 struct mii_if_info mii_if; 493 struct mii_if_info mii_if;
494 struct work_struct tx_timeout_task;
495 struct work_struct check_media_task;
496 void __iomem *base; 494 void __iomem *base;
497}; 495};
498 496
@@ -500,8 +498,6 @@ static int mdio_read(struct net_device *dev, int phy_id, int location);
500static void mdio_write(struct net_device *dev, int phy_id, int location, int value); 498static void mdio_write(struct net_device *dev, int phy_id, int location, int value);
501static int rhine_open(struct net_device *dev); 499static int rhine_open(struct net_device *dev);
502static void rhine_tx_timeout(struct net_device *dev); 500static void rhine_tx_timeout(struct net_device *dev);
503static void rhine_tx_timeout_task(struct net_device *dev);
504static void rhine_check_media_task(struct net_device *dev);
505static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev); 501static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev);
506static irqreturn_t rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs); 502static irqreturn_t rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
507static void rhine_tx(struct net_device *dev); 503static void rhine_tx(struct net_device *dev);
@@ -856,12 +852,6 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
856 if (rp->quirks & rqRhineI) 852 if (rp->quirks & rqRhineI)
857 dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM; 853 dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
858 854
859 INIT_WORK(&rp->tx_timeout_task,
860 (void (*)(void *))rhine_tx_timeout_task, dev);
861
862 INIT_WORK(&rp->check_media_task,
863 (void (*)(void *))rhine_check_media_task, dev);
864
865 /* dev->name not defined before register_netdev()! */ 855 /* dev->name not defined before register_netdev()! */
866 rc = register_netdev(dev); 856 rc = register_netdev(dev);
867 if (rc) 857 if (rc)
@@ -1108,11 +1098,6 @@ static void rhine_set_carrier(struct mii_if_info *mii)
1108 netif_carrier_ok(mii->dev)); 1098 netif_carrier_ok(mii->dev));
1109} 1099}
1110 1100
1111static void rhine_check_media_task(struct net_device *dev)
1112{
1113 rhine_check_media(dev, 0);
1114}
1115
1116static void init_registers(struct net_device *dev) 1101static void init_registers(struct net_device *dev)
1117{ 1102{
1118 struct rhine_private *rp = netdev_priv(dev); 1103 struct rhine_private *rp = netdev_priv(dev);
@@ -1166,8 +1151,8 @@ static void rhine_disable_linkmon(void __iomem *ioaddr, u32 quirks)
1166 if (quirks & rqRhineI) { 1151 if (quirks & rqRhineI) {
1167 iowrite8(0x01, ioaddr + MIIRegAddr); // MII_BMSR 1152 iowrite8(0x01, ioaddr + MIIRegAddr); // MII_BMSR
1168 1153
1169 /* Do not call from ISR! */ 1154 /* Can be called from ISR. Evil. */
1170 msleep(1); 1155 mdelay(1);
1171 1156
1172 /* 0x80 must be set immediately before turning it off */ 1157 /* 0x80 must be set immediately before turning it off */
1173 iowrite8(0x80, ioaddr + MIICmd); 1158 iowrite8(0x80, ioaddr + MIICmd);
@@ -1257,16 +1242,6 @@ static int rhine_open(struct net_device *dev)
1257static void rhine_tx_timeout(struct net_device *dev) 1242static void rhine_tx_timeout(struct net_device *dev)
1258{ 1243{
1259 struct rhine_private *rp = netdev_priv(dev); 1244 struct rhine_private *rp = netdev_priv(dev);
1260
1261 /*
1262 * Move bulk of work outside of interrupt context
1263 */
1264 schedule_work(&rp->tx_timeout_task);
1265}
1266
1267static void rhine_tx_timeout_task(struct net_device *dev)
1268{
1269 struct rhine_private *rp = netdev_priv(dev);
1270 void __iomem *ioaddr = rp->base; 1245 void __iomem *ioaddr = rp->base;
1271 1246
1272 printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status " 1247 printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status "
@@ -1677,7 +1652,7 @@ static void rhine_error(struct net_device *dev, int intr_status)
1677 spin_lock(&rp->lock); 1652 spin_lock(&rp->lock);
1678 1653
1679 if (intr_status & IntrLinkChange) 1654 if (intr_status & IntrLinkChange)
1680 schedule_work(&rp->check_media_task); 1655 rhine_check_media(dev, 0);
1681 if (intr_status & IntrStatsMax) { 1656 if (intr_status & IntrStatsMax) {
1682 rp->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs); 1657 rp->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs);
1683 rp->stats.rx_missed_errors += ioread16(ioaddr + RxMissed); 1658 rp->stats.rx_missed_errors += ioread16(ioaddr + RxMissed);
@@ -1927,9 +1902,6 @@ static int rhine_close(struct net_device *dev)
1927 spin_unlock_irq(&rp->lock); 1902 spin_unlock_irq(&rp->lock);
1928 1903
1929 free_irq(rp->pdev->irq, dev); 1904 free_irq(rp->pdev->irq, dev);
1930
1931 flush_scheduled_work();
1932
1933 free_rbufs(dev); 1905 free_rbufs(dev);
1934 free_tbufs(dev); 1906 free_tbufs(dev);
1935 free_ring(dev); 1907 free_ring(dev);