提交 a947a39d 编写于 作者: M Mike McCormack 提交者: David S. Miller

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: NMike McCormack <mikem@ring3k.org>
Acked-by: NStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 86669530
...@@ -1818,12 +1818,6 @@ static int sky2_down(struct net_device *dev) ...@@ -1818,12 +1818,6 @@ static int sky2_down(struct net_device *dev)
if (netif_msg_ifdown(sky2)) if (netif_msg_ifdown(sky2))
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
/* Disable port IRQ */
imask = sky2_read32(hw, B0_IMSK);
imask &= ~portirq_msk[port];
sky2_write32(hw, B0_IMSK, imask);
sky2_read32(hw, B0_IMSK);
/* Force flow control off */ /* Force flow control off */
sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
...@@ -1863,8 +1857,6 @@ static int sky2_down(struct net_device *dev) ...@@ -1863,8 +1857,6 @@ static int sky2_down(struct net_device *dev)
sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), RB_RST_SET); sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), RB_RST_SET);
sky2_rx_stop(sky2);
sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET);
...@@ -1874,6 +1866,14 @@ static int sky2_down(struct net_device *dev) ...@@ -1874,6 +1866,14 @@ static int sky2_down(struct net_device *dev)
sky2_write32(hw, STAT_ISR_TIMER_CNT, 0); sky2_write32(hw, STAT_ISR_TIMER_CNT, 0);
sky2_read8(hw, STAT_ISR_TIMER_CTRL); sky2_read8(hw, STAT_ISR_TIMER_CTRL);
sky2_rx_stop(sky2);
/* Disable port IRQ */
imask = sky2_read32(hw, B0_IMSK);
imask &= ~portirq_msk[port];
sky2_write32(hw, B0_IMSK, imask);
sky2_read32(hw, B0_IMSK);
synchronize_irq(hw->pdev->irq); synchronize_irq(hw->pdev->irq);
napi_synchronize(&hw->napi); napi_synchronize(&hw->napi);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册