diff options
author | Mike McCormack <mikem@ring3k.org> | 2009-07-21 23:57:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-21 23:57:56 -0400 |
commit | a947a39d52f5b647a2fd5eca55d39e722a2fa90f (patch) | |
tree | 5378a344f99d3206c63376cfd73fe336eb2049b9 /drivers | |
parent | 86669530d966ca21f4245b9990e7ae188d433d1e (diff) |
sky2: Avoid races in sky2_down
Reset rx chain before trying to drain it.
Shut interrupts off last, incase there's something to report.
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sky2.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index ba768dfa59e0..3550c5dcd93c 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1818,12 +1818,6 @@ static int sky2_down(struct net_device *dev) | |||
1818 | if (netif_msg_ifdown(sky2)) | 1818 | if (netif_msg_ifdown(sky2)) |
1819 | printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); | 1819 | printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); |
1820 | 1820 | ||
1821 | /* Disable port IRQ */ | ||
1822 | imask = sky2_read32(hw, B0_IMSK); | ||
1823 | imask &= ~portirq_msk[port]; | ||
1824 | sky2_write32(hw, B0_IMSK, imask); | ||
1825 | sky2_read32(hw, B0_IMSK); | ||
1826 | |||
1827 | /* Force flow control off */ | 1821 | /* Force flow control off */ |
1828 | sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); | 1822 | sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); |
1829 | 1823 | ||
@@ -1863,8 +1857,6 @@ static int sky2_down(struct net_device *dev) | |||
1863 | 1857 | ||
1864 | sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), RB_RST_SET); | 1858 | sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), RB_RST_SET); |
1865 | 1859 | ||
1866 | sky2_rx_stop(sky2); | ||
1867 | |||
1868 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); | 1860 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); |
1869 | sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); | 1861 | sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); |
1870 | 1862 | ||
@@ -1874,6 +1866,14 @@ static int sky2_down(struct net_device *dev) | |||
1874 | sky2_write32(hw, STAT_ISR_TIMER_CNT, 0); | 1866 | sky2_write32(hw, STAT_ISR_TIMER_CNT, 0); |
1875 | sky2_read8(hw, STAT_ISR_TIMER_CTRL); | 1867 | sky2_read8(hw, STAT_ISR_TIMER_CTRL); |
1876 | 1868 | ||
1869 | sky2_rx_stop(sky2); | ||
1870 | |||
1871 | /* Disable port IRQ */ | ||
1872 | imask = sky2_read32(hw, B0_IMSK); | ||
1873 | imask &= ~portirq_msk[port]; | ||
1874 | sky2_write32(hw, B0_IMSK, imask); | ||
1875 | sky2_read32(hw, B0_IMSK); | ||
1876 | |||
1877 | synchronize_irq(hw->pdev->irq); | 1877 | synchronize_irq(hw->pdev->irq); |
1878 | napi_synchronize(&hw->napi); | 1878 | napi_synchronize(&hw->napi); |
1879 | 1879 | ||