summaryrefslogtreecommitdiff
path: root/target/linux/mediatek/patches-4.4/0087-net-next-mediatek-add-IRQ-locking.patch
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2016-05-23 11:20:20 +0200
committerJohn Crispin <john@phrozen.org>2016-05-23 11:20:20 +0200
commitf5f173e2b794bd996fa6171bb6b18f13c4ed1e90 (patch)
tree749ba954d2b50e43e9cc83777a0b61dc42734a52 /target/linux/mediatek/patches-4.4/0087-net-next-mediatek-add-IRQ-locking.patch
parenta39ac242cc3ec0c2d39342754d86ec97e9e4fb32 (diff)
downloadmtk-20170518-f5f173e2b794bd996fa6171bb6b18f13c4ed1e90.zip
mtk-20170518-f5f173e2b794bd996fa6171bb6b18f13c4ed1e90.tar.gz
mtk-20170518-f5f173e2b794bd996fa6171bb6b18f13c4ed1e90.tar.bz2
mediatek: update patches
* fixes NAND * adds latest ethernet patches Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'target/linux/mediatek/patches-4.4/0087-net-next-mediatek-add-IRQ-locking.patch')
-rw-r--r--target/linux/mediatek/patches-4.4/0087-net-next-mediatek-add-IRQ-locking.patch67
1 files changed, 0 insertions, 67 deletions
diff --git a/target/linux/mediatek/patches-4.4/0087-net-next-mediatek-add-IRQ-locking.patch b/target/linux/mediatek/patches-4.4/0087-net-next-mediatek-add-IRQ-locking.patch
deleted file mode 100644
index 4930726..0000000
--- a/target/linux/mediatek/patches-4.4/0087-net-next-mediatek-add-IRQ-locking.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 4ff9304355036d4a00bdf0e47e869fc770ba1cc5 Mon Sep 17 00:00:00 2001
-From: John Crispin <blogic@openwrt.org>
-Date: Wed, 20 Apr 2016 16:18:07 +0200
-Subject: [PATCH 87/91] net-next: mediatek: add IRQ locking
-
-The code that enables and disables IRQs is missing proper locking. After
-adding the IRQ separation patch and routing the putting the RX and TX IRQs
-on different cores we experienced IRQ stalls. Fix this by adding proper
-locking. We use a dedicated lock to reduce the latency if the IRQ code.
-Otherwise it might wait for bottom code to finish before reenabling or
-disabling IRQs.
-
-Signed-off-by: John Crispin <blogic@openwrt.org>
----
- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 +++++++
- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 +
- 2 files changed, 8 insertions(+)
-
---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -316,22 +316,28 @@ static void mtk_mdio_cleanup(struct mtk_
-
- static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask)
- {
-+ unsigned long flags;
- u32 val;
-
-+ spin_lock_irqsave(&eth->irq_lock, flags);
- val = mtk_r32(eth, MTK_QDMA_INT_MASK);
- mtk_w32(eth, val & ~mask, MTK_QDMA_INT_MASK);
- /* flush write */
- mtk_r32(eth, MTK_QDMA_INT_MASK);
-+ spin_unlock_irqrestore(&eth->irq_lock, flags);
- }
-
- static inline void mtk_irq_enable(struct mtk_eth *eth, u32 mask)
- {
-+ unsigned long flags;
- u32 val;
-
-+ spin_lock_irqsave(&eth->irq_lock, flags);
- val = mtk_r32(eth, MTK_QDMA_INT_MASK);
- mtk_w32(eth, val | mask, MTK_QDMA_INT_MASK);
- /* flush write */
- mtk_r32(eth, MTK_QDMA_INT_MASK);
-+ spin_unlock_irqrestore(&eth->irq_lock, flags);
- }
-
- static int mtk_set_mac_address(struct net_device *dev, void *p)
-@@ -1752,6 +1758,7 @@ static int mtk_probe(struct platform_dev
- return -EADDRNOTAVAIL;
-
- spin_lock_init(&eth->page_lock);
-+ spin_lock_init(&eth->irq_lock);
-
- eth->ethsys = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
- "mediatek,ethsys");
---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -372,6 +372,7 @@ struct mtk_eth {
- void __iomem *base;
- struct reset_control *rstc;
- spinlock_t page_lock;
-+ spinlock_t irq_lock;
- struct net_device dummy_dev;
- struct net_device *netdev[MTK_MAX_DEVS];
- struct mtk_mac *mac[MTK_MAX_DEVS];