|
@@ -328,18 +328,24 @@ static void mtk_mdio_cleanup(struct mtk_eth *eth)
|
|
|
|
|
|
static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask)
|
|
|
{
|
|
|
+ unsigned long flags;
|
|
|
u32 val;
|
|
|
|
|
|
+ spin_lock_irqsave(ð->irq_lock, flags);
|
|
|
val = mtk_r32(eth, MTK_QDMA_INT_MASK);
|
|
|
mtk_w32(eth, val & ~mask, MTK_QDMA_INT_MASK);
|
|
|
+ spin_unlock_irqrestore(ð->irq_lock, flags);
|
|
|
}
|
|
|
|
|
|
static inline void mtk_irq_enable(struct mtk_eth *eth, u32 mask)
|
|
|
{
|
|
|
+ unsigned long flags;
|
|
|
u32 val;
|
|
|
|
|
|
+ spin_lock_irqsave(ð->irq_lock, flags);
|
|
|
val = mtk_r32(eth, MTK_QDMA_INT_MASK);
|
|
|
mtk_w32(eth, val | mask, MTK_QDMA_INT_MASK);
|
|
|
+ spin_unlock_irqrestore(ð->irq_lock, flags);
|
|
|
}
|
|
|
|
|
|
static int mtk_set_mac_address(struct net_device *dev, void *p)
|
|
@@ -1760,6 +1766,7 @@ static int mtk_probe(struct platform_device *pdev)
|
|
|
return PTR_ERR(eth->base);
|
|
|
|
|
|
spin_lock_init(ð->page_lock);
|
|
|
+ spin_lock_init(ð->irq_lock);
|
|
|
|
|
|
eth->ethsys = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
|
|
|
"mediatek,ethsys");
|