diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-10-17 13:23:56 -0400 |
---|---|---|
committer | Stephen Hemminger <shemminger@osdl.org> | 2006-10-17 13:23:56 -0400 |
commit | ebc646f681a6ad5a81989a6906832e82155df283 (patch) | |
tree | 650bb7a00d2236080faa05acf52ad768648e04ea /drivers/net/sky2.c | |
parent | e561a83be5c9cada5fa3733efdff67a2098a0c8e (diff) |
sky2: phy irq on shutdown
When PHY is turned off on shutdown, it causes the IRQ to get stuck on.
Make sure and disable the IRQ first, and if IRQ occurs when device
is not running, don't access PHY because that will hang.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Diffstat (limited to 'drivers/net/sky2.c')
-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 bd5ccae53879..2747e2f74dcb 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1499,6 +1499,11 @@ static int sky2_down(struct net_device *dev) | |||
1499 | /* Stop more packets from being queued */ | 1499 | /* Stop more packets from being queued */ |
1500 | netif_stop_queue(dev); | 1500 | netif_stop_queue(dev); |
1501 | 1501 | ||
1502 | /* Disable port IRQ */ | ||
1503 | imask = sky2_read32(hw, B0_IMSK); | ||
1504 | imask &= ~portirq_msk[port]; | ||
1505 | sky2_write32(hw, B0_IMSK, imask); | ||
1506 | |||
1502 | sky2_gmac_reset(hw, port); | 1507 | sky2_gmac_reset(hw, port); |
1503 | 1508 | ||
1504 | /* Stop transmitter */ | 1509 | /* Stop transmitter */ |
@@ -1549,11 +1554,6 @@ static int sky2_down(struct net_device *dev) | |||
1549 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); | 1554 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); |
1550 | sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); | 1555 | sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); |
1551 | 1556 | ||
1552 | /* Disable port IRQ */ | ||
1553 | imask = sky2_read32(hw, B0_IMSK); | ||
1554 | imask &= ~portirq_msk[port]; | ||
1555 | sky2_write32(hw, B0_IMSK, imask); | ||
1556 | |||
1557 | sky2_phy_power(hw, port, 0); | 1557 | sky2_phy_power(hw, port, 0); |
1558 | 1558 | ||
1559 | /* turn off LED's */ | 1559 | /* turn off LED's */ |
@@ -1750,13 +1750,13 @@ static void sky2_phy_intr(struct sky2_hw *hw, unsigned port) | |||
1750 | struct sky2_port *sky2 = netdev_priv(dev); | 1750 | struct sky2_port *sky2 = netdev_priv(dev); |
1751 | u16 istatus, phystat; | 1751 | u16 istatus, phystat; |
1752 | 1752 | ||
1753 | if (!netif_running(dev)) | ||
1754 | return; | ||
1755 | |||
1753 | spin_lock(&sky2->phy_lock); | 1756 | spin_lock(&sky2->phy_lock); |
1754 | istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT); | 1757 | istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT); |
1755 | phystat = gm_phy_read(hw, port, PHY_MARV_PHY_STAT); | 1758 | phystat = gm_phy_read(hw, port, PHY_MARV_PHY_STAT); |
1756 | 1759 | ||
1757 | if (!netif_running(dev)) | ||
1758 | goto out; | ||
1759 | |||
1760 | if (netif_msg_intr(sky2)) | 1760 | if (netif_msg_intr(sky2)) |
1761 | printk(KERN_INFO PFX "%s: phy interrupt status 0x%x 0x%x\n", | 1761 | printk(KERN_INFO PFX "%s: phy interrupt status 0x%x 0x%x\n", |
1762 | sky2->netdev->name, istatus, phystat); | 1762 | sky2->netdev->name, istatus, phystat); |