aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mcs814x
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2012-08-02 18:13:17 +0000
committerFlorian Fainelli <florian@openwrt.org>2012-08-02 18:13:17 +0000
commita8facfad2aeb3c4eb9c5ee01f646fefd3f992351 (patch)
treef4741cb8816a0aaeaad61ac0a92da6001b67e787 /target/linux/mcs814x
parent34b1cc667c2001dd5f8750230b562ba6ca8f4153 (diff)
downloadmaster-187ad058-a8facfad2aeb3c4eb9c5ee01f646fefd3f992351.tar.gz
master-187ad058-a8facfad2aeb3c4eb9c5ee01f646fefd3f992351.tar.bz2
master-187ad058-a8facfad2aeb3c4eb9c5ee01f646fefd3f992351.zip
[mcs814x] nuport-mac: properly protect the phy interrupt handler
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32951 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/mcs814x')
-rw-r--r--target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
index 657fb6a646..794987f73b 100644
--- a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
+++ b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
@@ -422,19 +422,25 @@ static irqreturn_t nuport_mac_link_interrupt(int irq, void *dev_id)
struct nuport_mac_priv *priv = netdev_priv(dev);
u32 reg;
u8 phy_addr;
+ unsigned long flags;
+ irqreturn_t ret = IRQ_HANDLED;
+ spin_lock_irqsave(&priv->lock, flags);
reg = nuport_mac_readl(LINK_INT_CSR);
phy_addr = (reg >> LINK_PHY_ADDR_SHIFT) & (PHY_MAX_ADDR - 1);
if (phy_addr != priv->phydev->addr) {
netdev_err(dev, "spurious PHY irq (phy: %d)\n", phy_addr);
- return IRQ_NONE;
+ ret = IRQ_NONE;
+ goto out;
}
priv->phydev->link = (reg & LINK_UP);
nuport_mac_adjust_link(dev);
- return IRQ_HANDLED;
+out:
+ spin_unlock_irqrestore(&priv->lock, flags);
+ return ret;
}
static irqreturn_t nuport_mac_tx_interrupt(int irq, void *dev_id)