From 91e9e7effca2fd5bd6e428ca9bc47f45cc6caf36 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 3 Jul 2017 11:52:38 +0200 Subject: [PATCH] 4.4-stable patches added patches: bgmac-fix-a-missing-check-for-build_skb.patch bgmac-fix-reversed-test-of-build_skb-return-value.patch mips-ath79-fix-regression-in-pci-window-initialization.patch mips-ralink-fix-invalid-assignment-of-soc-type.patch mips-ralink-fix-mt7628-pinmux-typos.patch mips-ralink-fix-mt7628-wled_an-pinmux-gpio.patch mips-ralink-fix-usb-frequency-scaling.patch mips-ralink-mt7688-pinmux-fixes.patch mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch mtd-bcm47xxpart-limit-scanned-flash-area-on-bcm47xx-mips-only.patch net-bgmac-fix-sof-bit-checking.patch net-bgmac-remove-superflous-netif_carrier_on.patch net-bgmac-start-transmit-queue-in-bgmac_open.patch net-korina-fix-napi-versus-resources-freeing.patch net-mvneta-fix-for_each_present_cpu-usage.patch --- ...ac-fix-a-missing-check-for-build_skb.patch | 35 ++++ ...ersed-test-of-build_skb-return-value.patch | 29 +++ ...ression-in-pci-window-initialization.patch | 51 ++++++ ...k-fix-invalid-assignment-of-soc-type.patch | 32 ++++ .../mips-ralink-fix-mt7628-pinmux-typos.patch | 39 ++++ ...alink-fix-mt7628-wled_an-pinmux-gpio.patch | 42 +++++ ...ips-ralink-fix-usb-frequency-scaling.patch | 35 ++++ .../mips-ralink-mt7688-pinmux-fixes.patch | 173 ++++++++++++++++++ ...part-don-t-fail-because-of-bit-flips.patch | 100 ++++++++++ ...nned-flash-area-on-bcm47xx-mips-only.patch | 41 +++++ .../net-bgmac-fix-sof-bit-checking.patch | 44 +++++ ...c-remove-superflous-netif_carrier_on.patch | 35 ++++ ...c-start-transmit-queue-in-bgmac_open.patch | 35 ++++ ...na-fix-napi-versus-resources-freeing.patch | 59 ++++++ ...vneta-fix-for_each_present_cpu-usage.patch | 65 +++++++ queue-4.4/series | 15 ++ 16 files changed, 830 insertions(+) create mode 100644 queue-4.4/bgmac-fix-a-missing-check-for-build_skb.patch create mode 100644 queue-4.4/bgmac-fix-reversed-test-of-build_skb-return-value.patch create mode 100644 queue-4.4/mips-ath79-fix-regression-in-pci-window-initialization.patch create mode 100644 queue-4.4/mips-ralink-fix-invalid-assignment-of-soc-type.patch create mode 100644 queue-4.4/mips-ralink-fix-mt7628-pinmux-typos.patch create mode 100644 queue-4.4/mips-ralink-fix-mt7628-wled_an-pinmux-gpio.patch create mode 100644 queue-4.4/mips-ralink-fix-usb-frequency-scaling.patch create mode 100644 queue-4.4/mips-ralink-mt7688-pinmux-fixes.patch create mode 100644 queue-4.4/mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch create mode 100644 queue-4.4/mtd-bcm47xxpart-limit-scanned-flash-area-on-bcm47xx-mips-only.patch create mode 100644 queue-4.4/net-bgmac-fix-sof-bit-checking.patch create mode 100644 queue-4.4/net-bgmac-remove-superflous-netif_carrier_on.patch create mode 100644 queue-4.4/net-bgmac-start-transmit-queue-in-bgmac_open.patch create mode 100644 queue-4.4/net-korina-fix-napi-versus-resources-freeing.patch create mode 100644 queue-4.4/net-mvneta-fix-for_each_present_cpu-usage.patch diff --git a/queue-4.4/bgmac-fix-a-missing-check-for-build_skb.patch b/queue-4.4/bgmac-fix-a-missing-check-for-build_skb.patch new file mode 100644 index 00000000000..94c0914f014 --- /dev/null +++ b/queue-4.4/bgmac-fix-a-missing-check-for-build_skb.patch @@ -0,0 +1,35 @@ +From f1640c3ddeec12804bc9a21feee85fc15aca95f6 Mon Sep 17 00:00:00 2001 +From: wangweidong +Date: Wed, 13 Jan 2016 11:06:41 +0800 +Subject: bgmac: fix a missing check for build_skb + +From: wangweidong + +commit f1640c3ddeec12804bc9a21feee85fc15aca95f6 upstream. + +when build_skb failed, it may occure a NULL pointer. +So add a 'NULL check' for it. + +Signed-off-by: Weidong Wang +Signed-off-by: David S. Miller +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/broadcom/bgmac.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/net/ethernet/broadcom/bgmac.c ++++ b/drivers/net/ethernet/broadcom/bgmac.c +@@ -469,6 +469,11 @@ static int bgmac_dma_rx_read(struct bgma + len -= ETH_FCS_LEN; + + skb = build_skb(buf, BGMAC_RX_ALLOC_SIZE); ++ if (unlikely(skb)) { ++ bgmac_err(bgmac, "build_skb failed\n"); ++ put_page(virt_to_head_page(buf)); ++ break; ++ } + skb_put(skb, BGMAC_RX_FRAME_OFFSET + + BGMAC_RX_BUF_OFFSET + len); + skb_pull(skb, BGMAC_RX_FRAME_OFFSET + diff --git a/queue-4.4/bgmac-fix-reversed-test-of-build_skb-return-value.patch b/queue-4.4/bgmac-fix-reversed-test-of-build_skb-return-value.patch new file mode 100644 index 00000000000..b0adfc27e8d --- /dev/null +++ b/queue-4.4/bgmac-fix-reversed-test-of-build_skb-return-value.patch @@ -0,0 +1,29 @@ +From 750afbf8ee9c6a1c74a1fe5fc9852146b1d72687 Mon Sep 17 00:00:00 2001 +From: "David S. Miller" +Date: Fri, 15 Jan 2016 16:07:13 -0500 +Subject: bgmac: Fix reversed test of build_skb() return value. + +From: David S. Miller + +commit 750afbf8ee9c6a1c74a1fe5fc9852146b1d72687 upstream. + +Fixes: f1640c3ddeec ("bgmac: fix a missing check for build_skb") +Signed-off-by: David S. Miller +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/broadcom/bgmac.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bgmac.c ++++ b/drivers/net/ethernet/broadcom/bgmac.c +@@ -469,7 +469,7 @@ static int bgmac_dma_rx_read(struct bgma + len -= ETH_FCS_LEN; + + skb = build_skb(buf, BGMAC_RX_ALLOC_SIZE); +- if (unlikely(skb)) { ++ if (unlikely(!skb)) { + bgmac_err(bgmac, "build_skb failed\n"); + put_page(virt_to_head_page(buf)); + break; diff --git a/queue-4.4/mips-ath79-fix-regression-in-pci-window-initialization.patch b/queue-4.4/mips-ath79-fix-regression-in-pci-window-initialization.patch new file mode 100644 index 00000000000..4e76801d6ad --- /dev/null +++ b/queue-4.4/mips-ath79-fix-regression-in-pci-window-initialization.patch @@ -0,0 +1,51 @@ +From 9184dc8ffa56844352b3b9860e562ec4ee41176f Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Mon, 16 May 2016 19:51:55 +0200 +Subject: MIPS: ath79: fix regression in PCI window initialization + +From: Felix Fietkau + +commit 9184dc8ffa56844352b3b9860e562ec4ee41176f upstream. + +ath79_ddr_pci_win_base has the type void __iomem *, so register offsets +need to be a multiple of 4. + +Cc: Alban Bedel +Fixes: 24b0e3e84fbf ("MIPS: ath79: Improve the DDR controller interface") +Signed-off-by: Felix Fietkau +Cc: sergei.shtylyov@cogentembedded.com +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/13258/ +Signed-off-by: Ralf Baechle +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/ath79/common.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/arch/mips/ath79/common.c ++++ b/arch/mips/ath79/common.c +@@ -76,14 +76,14 @@ void ath79_ddr_set_pci_windows(void) + { + BUG_ON(!ath79_ddr_pci_win_base); + +- __raw_writel(AR71XX_PCI_WIN0_OFFS, ath79_ddr_pci_win_base + 0); +- __raw_writel(AR71XX_PCI_WIN1_OFFS, ath79_ddr_pci_win_base + 1); +- __raw_writel(AR71XX_PCI_WIN2_OFFS, ath79_ddr_pci_win_base + 2); +- __raw_writel(AR71XX_PCI_WIN3_OFFS, ath79_ddr_pci_win_base + 3); +- __raw_writel(AR71XX_PCI_WIN4_OFFS, ath79_ddr_pci_win_base + 4); +- __raw_writel(AR71XX_PCI_WIN5_OFFS, ath79_ddr_pci_win_base + 5); +- __raw_writel(AR71XX_PCI_WIN6_OFFS, ath79_ddr_pci_win_base + 6); +- __raw_writel(AR71XX_PCI_WIN7_OFFS, ath79_ddr_pci_win_base + 7); ++ __raw_writel(AR71XX_PCI_WIN0_OFFS, ath79_ddr_pci_win_base + 0x0); ++ __raw_writel(AR71XX_PCI_WIN1_OFFS, ath79_ddr_pci_win_base + 0x4); ++ __raw_writel(AR71XX_PCI_WIN2_OFFS, ath79_ddr_pci_win_base + 0x8); ++ __raw_writel(AR71XX_PCI_WIN3_OFFS, ath79_ddr_pci_win_base + 0xc); ++ __raw_writel(AR71XX_PCI_WIN4_OFFS, ath79_ddr_pci_win_base + 0x10); ++ __raw_writel(AR71XX_PCI_WIN5_OFFS, ath79_ddr_pci_win_base + 0x14); ++ __raw_writel(AR71XX_PCI_WIN6_OFFS, ath79_ddr_pci_win_base + 0x18); ++ __raw_writel(AR71XX_PCI_WIN7_OFFS, ath79_ddr_pci_win_base + 0x1c); + } + EXPORT_SYMBOL_GPL(ath79_ddr_set_pci_windows); + diff --git a/queue-4.4/mips-ralink-fix-invalid-assignment-of-soc-type.patch b/queue-4.4/mips-ralink-fix-invalid-assignment-of-soc-type.patch new file mode 100644 index 00000000000..d923f5792a4 --- /dev/null +++ b/queue-4.4/mips-ralink-fix-invalid-assignment-of-soc-type.patch @@ -0,0 +1,32 @@ +From 0af3a40f09a2a85089037a0b5b51471fa48b229e Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Mon, 4 Jan 2016 20:23:58 +0100 +Subject: MIPS: ralink: Fix invalid assignment of SoC type + +From: John Crispin + +commit 0af3a40f09a2a85089037a0b5b51471fa48b229e upstream. + +Commit 418d29c87061 ("MIPS: ralink: Unify SoC id handling") introduced +broken code. We obviously need to assign the value. + +Signed-off-by: John Crispin +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/11993/ +Signed-off-by: Ralf Baechle +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/ralink/rt288x.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/ralink/rt288x.c ++++ b/arch/mips/ralink/rt288x.c +@@ -109,5 +109,5 @@ void prom_soc_init(struct ralink_soc_inf + soc_info->mem_size_max = RT2880_MEM_SIZE_MAX; + + rt2880_pinmux_data = rt2880_pinmux_data_act; +- ralink_soc == RT2880_SOC; ++ ralink_soc = RT2880_SOC; + } diff --git a/queue-4.4/mips-ralink-fix-mt7628-pinmux-typos.patch b/queue-4.4/mips-ralink-fix-mt7628-pinmux-typos.patch new file mode 100644 index 00000000000..dd97e6bbcc0 --- /dev/null +++ b/queue-4.4/mips-ralink-fix-mt7628-pinmux-typos.patch @@ -0,0 +1,39 @@ +From d7146829c9da24e285cb1b1f2156b5b3e2d40c07 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Thu, 19 May 2016 22:07:34 +0200 +Subject: MIPS: ralink: fix MT7628 pinmux typos +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Álvaro Fernández Rojas + +commit d7146829c9da24e285cb1b1f2156b5b3e2d40c07 upstream. + +Signed-off-by: Álvaro Fernández Rojas +Cc: john@phrozen.org +Cc: linux-mips@linux-mips.org +Cc: linux-kernel@vger.kernel.org +Patchwork: https://patchwork.linux-mips.org/patch/13306/ +Signed-off-by: Ralf Baechle +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/ralink/mt7620.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/mips/ralink/mt7620.c ++++ b/arch/mips/ralink/mt7620.c +@@ -223,9 +223,9 @@ static struct rt2880_pmx_func wled_an_gr + #define MT7628_GPIO_MODE_GPIO 0 + + static struct rt2880_pmx_group mt7628an_pinmux_data[] = { +- GRP_G("pmw1", pwm1_grp_mt7628, MT7628_GPIO_MODE_MASK, ++ GRP_G("pwm1", pwm1_grp_mt7628, MT7628_GPIO_MODE_MASK, + 1, MT7628_GPIO_MODE_PWM1), +- GRP_G("pmw0", pwm0_grp_mt7628, MT7628_GPIO_MODE_MASK, ++ GRP_G("pwm0", pwm0_grp_mt7628, MT7628_GPIO_MODE_MASK, + 1, MT7628_GPIO_MODE_PWM0), + GRP_G("uart2", uart2_grp_mt7628, MT7628_GPIO_MODE_MASK, + 1, MT7628_GPIO_MODE_UART2), diff --git a/queue-4.4/mips-ralink-fix-mt7628-wled_an-pinmux-gpio.patch b/queue-4.4/mips-ralink-fix-mt7628-wled_an-pinmux-gpio.patch new file mode 100644 index 00000000000..b19d301d69e --- /dev/null +++ b/queue-4.4/mips-ralink-fix-mt7628-wled_an-pinmux-gpio.patch @@ -0,0 +1,42 @@ +From 07b50db6e685172a41b9978aebffb2438166d9b6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Thu, 19 May 2016 22:07:35 +0200 +Subject: MIPS: ralink: fix MT7628 wled_an pinmux gpio +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Álvaro Fernández Rojas + +commit 07b50db6e685172a41b9978aebffb2438166d9b6 upstream. + +Signed-off-by: Álvaro Fernández Rojas +Cc: john@phrozen.org +Cc: linux-mips@linux-mips.org +Cc: linux-kernel@vger.kernel.org +Patchwork: https://patchwork.linux-mips.org/patch/13307/ +Signed-off-by: Ralf Baechle +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/ralink/mt7620.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/mips/ralink/mt7620.c ++++ b/arch/mips/ralink/mt7620.c +@@ -196,10 +196,10 @@ static struct rt2880_pmx_func wled_kn_gr + }; + + static struct rt2880_pmx_func wled_an_grp_mt7628[] = { +- FUNC("rsvd", 3, 35, 1), +- FUNC("rsvd", 2, 35, 1), +- FUNC("gpio", 1, 35, 1), +- FUNC("wled_an", 0, 35, 1), ++ FUNC("rsvd", 3, 44, 1), ++ FUNC("rsvd", 2, 44, 1), ++ FUNC("gpio", 1, 44, 1), ++ FUNC("wled_an", 0, 44, 1), + }; + + #define MT7628_GPIO_MODE_MASK 0x3 diff --git a/queue-4.4/mips-ralink-fix-usb-frequency-scaling.patch b/queue-4.4/mips-ralink-fix-usb-frequency-scaling.patch new file mode 100644 index 00000000000..81c41e52eb8 --- /dev/null +++ b/queue-4.4/mips-ralink-fix-usb-frequency-scaling.patch @@ -0,0 +1,35 @@ +From fad2522272ed5ed451d2d7b1dc547ddf3781cc7e Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Mon, 4 Jan 2016 20:23:57 +0100 +Subject: MIPS: ralink: fix USB frequency scaling + +From: John Crispin + +commit fad2522272ed5ed451d2d7b1dc547ddf3781cc7e upstream. + +Commit 418d29c87061 ("MIPS: ralink: Unify SoC id handling") was not fully +correct. The logic for the SoC check got inverted. We need to check if it +is not a MT76x8. + +Signed-off-by: John Crispin +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/11992/ +Signed-off-by: Ralf Baechle +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/ralink/mt7620.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/ralink/mt7620.c ++++ b/arch/mips/ralink/mt7620.c +@@ -459,7 +459,7 @@ void __init ralink_clk_init(void) + ralink_clk_add("10000c00.uartlite", periph_rate); + ralink_clk_add("10180000.wmac", xtal_rate); + +- if (IS_ENABLED(CONFIG_USB) && is_mt76x8()) { ++ if (IS_ENABLED(CONFIG_USB) && !is_mt76x8()) { + /* + * When the CPU goes into sleep mode, the BUS clock will be + * too low for USB to function properly. Adjust the busses diff --git a/queue-4.4/mips-ralink-mt7688-pinmux-fixes.patch b/queue-4.4/mips-ralink-mt7688-pinmux-fixes.patch new file mode 100644 index 00000000000..7f9909ab57e --- /dev/null +++ b/queue-4.4/mips-ralink-mt7688-pinmux-fixes.patch @@ -0,0 +1,173 @@ +From e906a5f67e5a3337d696ec848e9c28fc68b39aa3 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Mon, 4 Jan 2016 20:23:56 +0100 +Subject: MIPS: ralink: MT7688 pinmux fixes + +From: John Crispin + +commit e906a5f67e5a3337d696ec848e9c28fc68b39aa3 upstream. + +A few fixes to the pinmux data, 2 new muxes and a minor whitespace +cleanup. + +Signed-off-by: John Crispin +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/11991/ +Signed-off-by: Ralf Baechle +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/ralink/mt7620.c | 80 ++++++++++++++++++++++++++++------------------ + 1 file changed, 50 insertions(+), 30 deletions(-) + +--- a/arch/mips/ralink/mt7620.c ++++ b/arch/mips/ralink/mt7620.c +@@ -107,31 +107,31 @@ static struct rt2880_pmx_group mt7620a_p + }; + + static struct rt2880_pmx_func pwm1_grp_mt7628[] = { +- FUNC("sdcx", 3, 19, 1), ++ FUNC("sdxc d6", 3, 19, 1), + FUNC("utif", 2, 19, 1), + FUNC("gpio", 1, 19, 1), +- FUNC("pwm", 0, 19, 1), ++ FUNC("pwm1", 0, 19, 1), + }; + + static struct rt2880_pmx_func pwm0_grp_mt7628[] = { +- FUNC("sdcx", 3, 18, 1), ++ FUNC("sdxc d7", 3, 18, 1), + FUNC("utif", 2, 18, 1), + FUNC("gpio", 1, 18, 1), +- FUNC("pwm", 0, 18, 1), ++ FUNC("pwm0", 0, 18, 1), + }; + + static struct rt2880_pmx_func uart2_grp_mt7628[] = { +- FUNC("sdcx", 3, 20, 2), ++ FUNC("sdxc d5 d4", 3, 20, 2), + FUNC("pwm", 2, 20, 2), + FUNC("gpio", 1, 20, 2), +- FUNC("uart", 0, 20, 2), ++ FUNC("uart2", 0, 20, 2), + }; + + static struct rt2880_pmx_func uart1_grp_mt7628[] = { +- FUNC("sdcx", 3, 45, 2), ++ FUNC("sw_r", 3, 45, 2), + FUNC("pwm", 2, 45, 2), + FUNC("gpio", 1, 45, 2), +- FUNC("uart", 0, 45, 2), ++ FUNC("uart1", 0, 45, 2), + }; + + static struct rt2880_pmx_func i2c_grp_mt7628[] = { +@@ -143,21 +143,21 @@ static struct rt2880_pmx_func i2c_grp_mt + + static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("reclk", 0, 36, 1) }; + static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 37, 1) }; +-static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 15, 38) }; ++static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 38, 1) }; + static struct rt2880_pmx_func spi_grp_mt7628[] = { FUNC("spi", 0, 7, 4) }; + + static struct rt2880_pmx_func sd_mode_grp_mt7628[] = { + FUNC("jtag", 3, 22, 8), + FUNC("utif", 2, 22, 8), + FUNC("gpio", 1, 22, 8), +- FUNC("sdcx", 0, 22, 8), ++ FUNC("sdxc", 0, 22, 8), + }; + + static struct rt2880_pmx_func uart0_grp_mt7628[] = { + FUNC("-", 3, 12, 2), + FUNC("-", 2, 12, 2), + FUNC("gpio", 1, 12, 2), +- FUNC("uart", 0, 12, 2), ++ FUNC("uart0", 0, 12, 2), + }; + + static struct rt2880_pmx_func i2s_grp_mt7628[] = { +@@ -171,7 +171,7 @@ static struct rt2880_pmx_func spi_cs1_gr + FUNC("-", 3, 6, 1), + FUNC("refclk", 2, 6, 1), + FUNC("gpio", 1, 6, 1), +- FUNC("spi", 0, 6, 1), ++ FUNC("spi cs1", 0, 6, 1), + }; + + static struct rt2880_pmx_func spis_grp_mt7628[] = { +@@ -188,28 +188,44 @@ static struct rt2880_pmx_func gpio_grp_m + FUNC("gpio", 0, 11, 1), + }; + +-#define MT7628_GPIO_MODE_MASK 0x3 +- +-#define MT7628_GPIO_MODE_PWM1 30 +-#define MT7628_GPIO_MODE_PWM0 28 +-#define MT7628_GPIO_MODE_UART2 26 +-#define MT7628_GPIO_MODE_UART1 24 +-#define MT7628_GPIO_MODE_I2C 20 +-#define MT7628_GPIO_MODE_REFCLK 18 +-#define MT7628_GPIO_MODE_PERST 16 +-#define MT7628_GPIO_MODE_WDT 14 +-#define MT7628_GPIO_MODE_SPI 12 +-#define MT7628_GPIO_MODE_SDMODE 10 +-#define MT7628_GPIO_MODE_UART0 8 +-#define MT7628_GPIO_MODE_I2S 6 +-#define MT7628_GPIO_MODE_CS1 4 +-#define MT7628_GPIO_MODE_SPIS 2 +-#define MT7628_GPIO_MODE_GPIO 0 ++static struct rt2880_pmx_func wled_kn_grp_mt7628[] = { ++ FUNC("rsvd", 3, 35, 1), ++ FUNC("rsvd", 2, 35, 1), ++ FUNC("gpio", 1, 35, 1), ++ FUNC("wled_kn", 0, 35, 1), ++}; ++ ++static struct rt2880_pmx_func wled_an_grp_mt7628[] = { ++ FUNC("rsvd", 3, 35, 1), ++ FUNC("rsvd", 2, 35, 1), ++ FUNC("gpio", 1, 35, 1), ++ FUNC("wled_an", 0, 35, 1), ++}; ++ ++#define MT7628_GPIO_MODE_MASK 0x3 ++ ++#define MT7628_GPIO_MODE_WLED_KN 48 ++#define MT7628_GPIO_MODE_WLED_AN 32 ++#define MT7628_GPIO_MODE_PWM1 30 ++#define MT7628_GPIO_MODE_PWM0 28 ++#define MT7628_GPIO_MODE_UART2 26 ++#define MT7628_GPIO_MODE_UART1 24 ++#define MT7628_GPIO_MODE_I2C 20 ++#define MT7628_GPIO_MODE_REFCLK 18 ++#define MT7628_GPIO_MODE_PERST 16 ++#define MT7628_GPIO_MODE_WDT 14 ++#define MT7628_GPIO_MODE_SPI 12 ++#define MT7628_GPIO_MODE_SDMODE 10 ++#define MT7628_GPIO_MODE_UART0 8 ++#define MT7628_GPIO_MODE_I2S 6 ++#define MT7628_GPIO_MODE_CS1 4 ++#define MT7628_GPIO_MODE_SPIS 2 ++#define MT7628_GPIO_MODE_GPIO 0 + + static struct rt2880_pmx_group mt7628an_pinmux_data[] = { + GRP_G("pmw1", pwm1_grp_mt7628, MT7628_GPIO_MODE_MASK, + 1, MT7628_GPIO_MODE_PWM1), +- GRP_G("pmw1", pwm0_grp_mt7628, MT7628_GPIO_MODE_MASK, ++ GRP_G("pmw0", pwm0_grp_mt7628, MT7628_GPIO_MODE_MASK, + 1, MT7628_GPIO_MODE_PWM0), + GRP_G("uart2", uart2_grp_mt7628, MT7628_GPIO_MODE_MASK, + 1, MT7628_GPIO_MODE_UART2), +@@ -233,6 +249,10 @@ static struct rt2880_pmx_group mt7628an_ + 1, MT7628_GPIO_MODE_SPIS), + GRP_G("gpio", gpio_grp_mt7628, MT7628_GPIO_MODE_MASK, + 1, MT7628_GPIO_MODE_GPIO), ++ GRP_G("wled_an", wled_an_grp_mt7628, MT7628_GPIO_MODE_MASK, ++ 1, MT7628_GPIO_MODE_WLED_AN), ++ GRP_G("wled_kn", wled_kn_grp_mt7628, MT7628_GPIO_MODE_MASK, ++ 1, MT7628_GPIO_MODE_WLED_KN), + { 0 } + }; + diff --git a/queue-4.4/mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch b/queue-4.4/mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch new file mode 100644 index 00000000000..1caefa6357f --- /dev/null +++ b/queue-4.4/mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch @@ -0,0 +1,100 @@ +From 36bcc0c9c2bc8f56569cd735ba531a51358d7c2b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sun, 6 Dec 2015 11:31:38 +0100 +Subject: mtd: bcm47xxpart: don't fail because of bit-flips +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +commit 36bcc0c9c2bc8f56569cd735ba531a51358d7c2b upstream. + +Bit-flip errors may occur on NAND flashes and are harmless. Handle them +gracefully as read content is still reliable and can be parsed. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Brian Norris +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/bcm47xxpart.c | 38 ++++++++++++++++++++++---------------- + 1 file changed, 22 insertions(+), 16 deletions(-) + +--- a/drivers/mtd/bcm47xxpart.c ++++ b/drivers/mtd/bcm47xxpart.c +@@ -66,11 +66,13 @@ static const char *bcm47xxpart_trx_data_ + { + uint32_t buf; + size_t bytes_read; ++ int err; + +- if (mtd_read(master, offset, sizeof(buf), &bytes_read, +- (uint8_t *)&buf) < 0) { +- pr_err("mtd_read error while parsing (offset: 0x%X)!\n", +- offset); ++ err = mtd_read(master, offset, sizeof(buf), &bytes_read, ++ (uint8_t *)&buf); ++ if (err && !mtd_is_bitflip(err)) { ++ pr_err("mtd_read error while parsing (offset: 0x%X): %d\n", ++ offset, err); + goto out_default; + } + +@@ -95,6 +97,7 @@ static int bcm47xxpart_parse(struct mtd_ + int trx_part = -1; + int last_trx_part = -1; + int possible_nvram_sizes[] = { 0x8000, 0xF000, 0x10000, }; ++ int err; + + /* + * Some really old flashes (like AT45DB*) had smaller erasesize-s, but +@@ -128,10 +131,11 @@ static int bcm47xxpart_parse(struct mtd_ + } + + /* Read beginning of the block */ +- if (mtd_read(master, offset, BCM47XXPART_BYTES_TO_READ, +- &bytes_read, (uint8_t *)buf) < 0) { +- pr_err("mtd_read error while parsing (offset: 0x%X)!\n", +- offset); ++ err = mtd_read(master, offset, BCM47XXPART_BYTES_TO_READ, ++ &bytes_read, (uint8_t *)buf); ++ if (err && !mtd_is_bitflip(err)) { ++ pr_err("mtd_read error while parsing (offset: 0x%X): %d\n", ++ offset, err); + continue; + } + +@@ -252,10 +256,11 @@ static int bcm47xxpart_parse(struct mtd_ + } + + /* Read middle of the block */ +- if (mtd_read(master, offset + 0x8000, 0x4, +- &bytes_read, (uint8_t *)buf) < 0) { +- pr_err("mtd_read error while parsing (offset: 0x%X)!\n", +- offset); ++ err = mtd_read(master, offset + 0x8000, 0x4, &bytes_read, ++ (uint8_t *)buf); ++ if (err && !mtd_is_bitflip(err)) { ++ pr_err("mtd_read error while parsing (offset: 0x%X): %d\n", ++ offset, err); + continue; + } + +@@ -275,10 +280,11 @@ static int bcm47xxpart_parse(struct mtd_ + } + + offset = master->size - possible_nvram_sizes[i]; +- if (mtd_read(master, offset, 0x4, &bytes_read, +- (uint8_t *)buf) < 0) { +- pr_err("mtd_read error while reading at offset 0x%X!\n", +- offset); ++ err = mtd_read(master, offset, 0x4, &bytes_read, ++ (uint8_t *)buf); ++ if (err && !mtd_is_bitflip(err)) { ++ pr_err("mtd_read error while reading (offset 0x%X): %d\n", ++ offset, err); + continue; + } + diff --git a/queue-4.4/mtd-bcm47xxpart-limit-scanned-flash-area-on-bcm47xx-mips-only.patch b/queue-4.4/mtd-bcm47xxpart-limit-scanned-flash-area-on-bcm47xx-mips-only.patch new file mode 100644 index 00000000000..500350cbb8d --- /dev/null +++ b/queue-4.4/mtd-bcm47xxpart-limit-scanned-flash-area-on-bcm47xx-mips-only.patch @@ -0,0 +1,41 @@ +From 2a36a5c30eab9cd1c9d2d08bd27cd763325d70c5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sat, 5 Dec 2015 02:09:43 +0100 +Subject: mtd: bcm47xxpart: limit scanned flash area on BCM47XX (MIPS) only +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +commit 2a36a5c30eab9cd1c9d2d08bd27cd763325d70c5 upstream. + +We allowed using bcm47xxpart on BCM5301X arch with commit: +9e3afa5f5c7 ("mtd: bcm47xxpart: allow enabling on ARCH_BCM_5301X") + +BCM5301X devices may contain some partitions in higher memory, e.g. +Netgear R8000 has board_data at 0x2600000. To detect them we should +use size limit on MIPS only. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Brian Norris +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/bcm47xxpart.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/mtd/bcm47xxpart.c ++++ b/drivers/mtd/bcm47xxpart.c +@@ -118,8 +118,8 @@ static int bcm47xxpart_parse(struct mtd_ + /* Parse block by block looking for magics */ + for (offset = 0; offset <= master->size - blocksize; + offset += blocksize) { +- /* Nothing more in higher memory */ +- if (offset >= 0x2000000) ++ /* Nothing more in higher memory on BCM47XX (MIPS) */ ++ if (config_enabled(CONFIG_BCM47XX) && offset >= 0x2000000) + break; + + if (curr_part >= BCM47XXPART_MAX_PARTS) { diff --git a/queue-4.4/net-bgmac-fix-sof-bit-checking.patch b/queue-4.4/net-bgmac-fix-sof-bit-checking.patch new file mode 100644 index 00000000000..7fa7e0aaa71 --- /dev/null +++ b/queue-4.4/net-bgmac-fix-sof-bit-checking.patch @@ -0,0 +1,44 @@ +From d2b13233879ca1268a1c027d4573109e5a777811 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 23 Jun 2016 14:23:12 -0700 +Subject: net: bgmac: Fix SOF bit checking + +From: Florian Fainelli + +commit d2b13233879ca1268a1c027d4573109e5a777811 upstream. + +We are checking for the Start of Frame bit in the ctl1 word, while this +bit is set in the ctl0 word instead. Read the ctl0 word and update the +check to verify that. + +Fixes: 9cde94506eac ("bgmac: implement scatter/gather support") +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/broadcom/bgmac.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bgmac.c ++++ b/drivers/net/ethernet/broadcom/bgmac.c +@@ -255,15 +255,16 @@ static void bgmac_dma_tx_free(struct bgm + while (ring->start != ring->end) { + int slot_idx = ring->start % BGMAC_TX_RING_SLOTS; + struct bgmac_slot_info *slot = &ring->slots[slot_idx]; +- u32 ctl1; ++ u32 ctl0, ctl1; + int len; + + if (slot_idx == empty_slot) + break; + ++ ctl0 = le32_to_cpu(ring->cpu_base[slot_idx].ctl0); + ctl1 = le32_to_cpu(ring->cpu_base[slot_idx].ctl1); + len = ctl1 & BGMAC_DESC_CTL1_LEN; +- if (ctl1 & BGMAC_DESC_CTL0_SOF) ++ if (ctl0 & BGMAC_DESC_CTL0_SOF) + /* Unmap no longer used buffer */ + dma_unmap_single(dma_dev, slot->dma_addr, len, + DMA_TO_DEVICE); diff --git a/queue-4.4/net-bgmac-remove-superflous-netif_carrier_on.patch b/queue-4.4/net-bgmac-remove-superflous-netif_carrier_on.patch new file mode 100644 index 00000000000..90bd0af820a --- /dev/null +++ b/queue-4.4/net-bgmac-remove-superflous-netif_carrier_on.patch @@ -0,0 +1,35 @@ +From 3894396e64994f31c3ef5c7e6f63dded0593e567 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 23 Jun 2016 14:25:33 -0700 +Subject: net: bgmac: Remove superflous netif_carrier_on() + +From: Florian Fainelli + +commit 3894396e64994f31c3ef5c7e6f63dded0593e567 upstream. + +bgmac_open() calls phy_start() to initialize the PHY state machine, +which will set the interface's carrier state accordingly, no need to +force that as this could be conflicting with the PHY state determined by +PHYLIB. + +Fixes: dd4544f05469 ("bgmac: driver for GBit MAC core on BCMA bus") +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/broadcom/bgmac.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bgmac.c ++++ b/drivers/net/ethernet/broadcom/bgmac.c +@@ -1308,8 +1308,6 @@ static int bgmac_open(struct net_device + + phy_start(bgmac->phy_dev); + +- netif_carrier_on(net_dev); +- + netif_start_queue(net_dev); + + return 0; diff --git a/queue-4.4/net-bgmac-start-transmit-queue-in-bgmac_open.patch b/queue-4.4/net-bgmac-start-transmit-queue-in-bgmac_open.patch new file mode 100644 index 00000000000..d0adebb3fd8 --- /dev/null +++ b/queue-4.4/net-bgmac-start-transmit-queue-in-bgmac_open.patch @@ -0,0 +1,35 @@ +From c3897f2a69e54dd113fc9abd2daf872e5b495798 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 23 Jun 2016 14:25:32 -0700 +Subject: net: bgmac: Start transmit queue in bgmac_open + +From: Florian Fainelli + +commit c3897f2a69e54dd113fc9abd2daf872e5b495798 upstream. + +The driver does not start the transmit queue in bgmac_open(). If the +queue was stopped prior to closing then re-opening the interface, we +would never be able to wake-up again. + +Fixes: dd4544f05469 ("bgmac: driver for GBit MAC core on BCMA bus") +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/broadcom/bgmac.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/ethernet/broadcom/bgmac.c ++++ b/drivers/net/ethernet/broadcom/bgmac.c +@@ -1309,6 +1309,9 @@ static int bgmac_open(struct net_device + phy_start(bgmac->phy_dev); + + netif_carrier_on(net_dev); ++ ++ netif_start_queue(net_dev); ++ + return 0; + } + diff --git a/queue-4.4/net-korina-fix-napi-versus-resources-freeing.patch b/queue-4.4/net-korina-fix-napi-versus-resources-freeing.patch new file mode 100644 index 00000000000..21e4d7e6df6 --- /dev/null +++ b/queue-4.4/net-korina-fix-napi-versus-resources-freeing.patch @@ -0,0 +1,59 @@ +From e6afb1ad88feddf2347ea779cfaf4d03d3cd40b6 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Fri, 23 Dec 2016 19:56:56 -0800 +Subject: net: korina: Fix NAPI versus resources freeing + +From: Florian Fainelli + +commit e6afb1ad88feddf2347ea779cfaf4d03d3cd40b6 upstream. + +Commit beb0babfb77e ("korina: disable napi on close and restart") +introduced calls to napi_disable() that were missing before, +unfortunately this leaves a small window during which NAPI has a chance +to run, yet we just freed resources since korina_free_ring() has been +called: + +Fix this by disabling NAPI first then freeing resource, and make sure +that we also cancel the restart task before doing the resource freeing. + +Fixes: beb0babfb77e ("korina: disable napi on close and restart") +Reported-by: Alexandros C. Couloumbis +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/korina.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -900,10 +900,10 @@ static void korina_restart_task(struct w + DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR, + &lp->rx_dma_regs->dmasm); + +- korina_free_ring(dev); +- + napi_disable(&lp->napi); + ++ korina_free_ring(dev); ++ + if (korina_init(dev) < 0) { + printk(KERN_ERR "%s: cannot restart device\n", dev->name); + return; +@@ -1064,12 +1064,12 @@ static int korina_close(struct net_devic + tmp = tmp | DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR; + writel(tmp, &lp->rx_dma_regs->dmasm); + +- korina_free_ring(dev); +- + napi_disable(&lp->napi); + + cancel_work_sync(&lp->restart_task); + ++ korina_free_ring(dev); ++ + free_irq(lp->rx_irq, dev); + free_irq(lp->tx_irq, dev); + free_irq(lp->ovr_irq, dev); diff --git a/queue-4.4/net-mvneta-fix-for_each_present_cpu-usage.patch b/queue-4.4/net-mvneta-fix-for_each_present_cpu-usage.patch new file mode 100644 index 00000000000..e8ecd7eaf31 --- /dev/null +++ b/queue-4.4/net-mvneta-fix-for_each_present_cpu-usage.patch @@ -0,0 +1,65 @@ +From 129219e4950a3fcf9323b3bbd8b224c7aa873985 Mon Sep 17 00:00:00 2001 +From: Gregory CLEMENT +Date: Thu, 4 Feb 2016 22:09:23 +0100 +Subject: net: mvneta: Fix for_each_present_cpu usage + +From: Gregory CLEMENT + +commit 129219e4950a3fcf9323b3bbd8b224c7aa873985 upstream. + +This patch convert the for_each_present in on_each_cpu, instead of +applying on the present cpus it will be applied only on the online cpus. +This fix a bug reported on +http://thread.gmane.org/gmane.linux.ports.arm.kernel/468173. + +Using the macro on_each_cpu (instead of a for_each_* loop) also ensures +that all the calls will be done all at once. + +Fixes: f86428854480 ("net: mvneta: Statically assign queues to CPUs") +Reported-by: Stefan Roese +Suggested-by: Jisheng Zhang +Suggested-by: Russell King +Signed-off-by: Gregory CLEMENT +Signed-off-by: David S. Miller +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/marvell/mvneta.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -2446,7 +2446,7 @@ static void mvneta_start_dev(struct mvne + mvneta_port_enable(pp); + + /* Enable polling on the port */ +- for_each_present_cpu(cpu) { ++ for_each_online_cpu(cpu) { + struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu); + + napi_enable(&port->napi); +@@ -2472,7 +2472,7 @@ static void mvneta_stop_dev(struct mvnet + + phy_stop(pp->phy_dev); + +- for_each_present_cpu(cpu) { ++ for_each_online_cpu(cpu) { + struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu); + + napi_disable(&port->napi); +@@ -2902,13 +2902,11 @@ err_cleanup_rxqs: + static int mvneta_stop(struct net_device *dev) + { + struct mvneta_port *pp = netdev_priv(dev); +- int cpu; + + mvneta_stop_dev(pp); + mvneta_mdio_remove(pp); + unregister_cpu_notifier(&pp->cpu_notifier); +- for_each_present_cpu(cpu) +- smp_call_function_single(cpu, mvneta_percpu_disable, pp, true); ++ on_each_cpu(mvneta_percpu_disable, pp, true); + free_percpu_irq(dev->irq, pp->ports); + mvneta_cleanup_rxqs(pp); + mvneta_cleanup_txqs(pp); diff --git a/queue-4.4/series b/queue-4.4/series index 14dd1ae6288..e1e512406b6 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -34,3 +34,18 @@ scsi-sd-fix-wrong-dpofua-disable-in-sd_read_cache_type.patch scsi-lpfc-set-elsiocb-contexts-to-null-after-freeing-it.patch qla2xxx-fix-erroneous-invalid-handle-message.patch arm-dts-bcm5301x-correct-gic_ppi-interrupt-flags.patch +net-mvneta-fix-for_each_present_cpu-usage.patch +mips-ath79-fix-regression-in-pci-window-initialization.patch +net-korina-fix-napi-versus-resources-freeing.patch +mips-ralink-mt7688-pinmux-fixes.patch +mips-ralink-fix-usb-frequency-scaling.patch +mips-ralink-fix-invalid-assignment-of-soc-type.patch +mips-ralink-fix-mt7628-pinmux-typos.patch +mips-ralink-fix-mt7628-wled_an-pinmux-gpio.patch +mtd-bcm47xxpart-limit-scanned-flash-area-on-bcm47xx-mips-only.patch +bgmac-fix-a-missing-check-for-build_skb.patch +mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch +bgmac-fix-reversed-test-of-build_skb-return-value.patch +net-bgmac-fix-sof-bit-checking.patch +net-bgmac-start-transmit-queue-in-bgmac_open.patch +net-bgmac-remove-superflous-netif_carrier_on.patch -- 2.47.3