Changeset 32951


Ignore:
Timestamp:
2012-08-02T20:13:17+02:00 (6 years ago)
Author:
florian
Message:

[mcs814x] nuport-mac: properly protect the phy interrupt handler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c

    r32940 r32951  
    423423        u32 reg; 
    424424        u8 phy_addr; 
    425  
     425        unsigned long flags; 
     426        irqreturn_t ret = IRQ_HANDLED; 
     427 
     428        spin_lock_irqsave(&priv->lock, flags); 
    426429        reg = nuport_mac_readl(LINK_INT_CSR); 
    427430        phy_addr = (reg >> LINK_PHY_ADDR_SHIFT) & (PHY_MAX_ADDR - 1); 
     
    429432        if (phy_addr != priv->phydev->addr) { 
    430433                netdev_err(dev, "spurious PHY irq (phy: %d)\n", phy_addr); 
    431                 return IRQ_NONE; 
     434                ret = IRQ_NONE; 
     435                goto out; 
    432436        } 
    433437 
     
    435439        nuport_mac_adjust_link(dev); 
    436440 
    437         return IRQ_HANDLED; 
     441out: 
     442        spin_unlock_irqrestore(&priv->lock, flags); 
     443        return ret; 
    438444} 
    439445 
Note: See TracChangeset for help on using the changeset viewer.