From 97f10c21d271421c8430824d60321dcf3415a0ff Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 20 Jun 2016 22:57:36 +0200 Subject: mediatek: update patches * fixes NAND * adds latest ethernet patches Signed-off-by: John Crispin --- .../0095-net-next-mediatek-add-IRQ-locking.patch | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch (limited to 'target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch') diff --git a/target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch b/target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch new file mode 100644 index 0000000000..ff21c09ac3 --- /dev/null +++ b/target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch @@ -0,0 +1,71 @@ +From dd08d1ac4cfc86fbea5ee207b9615922ede88ec6 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 17 May 2016 06:01:45 +0200 +Subject: [PATCH 095/102] 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: Sean Wang +Signed-off-by: John Crispin +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 +++++++ + drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 + + 2 files changed, 8 insertions(+) + +diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +index 13ee15f..c869064 100644 +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -331,18 +331,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) +@@ -1771,6 +1777,7 @@ static int mtk_probe(struct platform_device *pdev) + return -EADDRNOTAVAIL; + + spin_lock_init(ð->page_lock); ++ spin_lock_init(ð->irq_lock); + + eth->ethsys = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, + "mediatek,ethsys"); +diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +index a5eb7c6..3159d2a 100644 +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -373,6 +373,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]; +-- +1.7.10.4 + -- cgit v1.2.3 From 9d81678ab01a06ee718e33c2f2d3913cec684840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Mon, 20 Jun 2016 23:26:13 +0200 Subject: kernel: update kernel 4.4 to version 4.4.12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Fernández Rojas --- .../patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch') diff --git a/target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch b/target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch index ff21c09ac3..bf27aac15c 100644 --- a/target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch +++ b/target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch @@ -17,11 +17,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 + 2 files changed, 8 insertions(+) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 13ee15f..c869064 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -331,18 +331,24 @@ static void mtk_mdio_cleanup(struct mtk_eth *eth) +@@ -331,18 +331,24 @@ static void mtk_mdio_cleanup(struct mtk_ static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask) { @@ -46,7 +44,7 @@ index 13ee15f..c869064 100644 } static int mtk_set_mac_address(struct net_device *dev, void *p) -@@ -1771,6 +1777,7 @@ static int mtk_probe(struct platform_device *pdev) +@@ -1771,6 +1777,7 @@ static int mtk_probe(struct platform_dev return -EADDRNOTAVAIL; spin_lock_init(ð->page_lock); @@ -54,8 +52,6 @@ index 13ee15f..c869064 100644 eth->ethsys = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mediatek,ethsys"); -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -index a5eb7c6..3159d2a 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -373,6 +373,7 @@ struct mtk_eth { @@ -66,6 +62,3 @@ index a5eb7c6..3159d2a 100644 struct net_device dummy_dev; struct net_device *netdev[MTK_MAX_DEVS]; struct mtk_mac *mac[MTK_MAX_DEVS]; --- -1.7.10.4 - -- cgit v1.2.3