All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-4.4 00/16] Stable commits picked up from lede project
@ 2017-06-30  5:46 Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 01/16] ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags Amit Pundir
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable

Hi Greg,

For your consideration, stable commits taken from lede source tree
https://git.lede-project.org/?p=source.git for 4.4.y.

Cherry-picked and build tested on Linux v4.4.74 for
ARCH=arm/arm64/x86/x86_64/mips + allmodconfig.

Regards,
Amit Pundir


David S. Miller (1):
  bgmac: Fix reversed test of build_skb() return value.

Felix Fietkau (1):
  MIPS: ath79: fix regression in PCI window initialization

Florian Fainelli (4):
  net: korina: Fix NAPI versus resources freeing
  net: bgmac: Fix SOF bit checking
  net: bgmac: Start transmit queue in bgmac_open
  net: bgmac: Remove superflous netif_carrier_on()

Gregory CLEMENT (1):
  net: mvneta: Fix for_each_present_cpu usage

John Crispin (3):
  MIPS: ralink: MT7688 pinmux fixes
  MIPS: ralink: fix USB frequency scaling
  MIPS: ralink: Fix invalid assignment of SoC type

Jon Mason (1):
  ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags

Rafał Miłecki (2):
  mtd: bcm47xxpart: limit scanned flash area on BCM47XX (MIPS) only
  mtd: bcm47xxpart: don't fail because of bit-flips

wangweidong (1):
  bgmac: fix a missing check for build_skb

Álvaro Fernández Rojas (2):
  MIPS: ralink: fix MT7628 pinmux typos
  MIPS: ralink: fix MT7628 wled_an pinmux gpio

 arch/arm/boot/dts/bcm5301x.dtsi       |  4 +-
 arch/mips/ath79/common.c              | 16 +++----
 arch/mips/ralink/mt7620.c             | 84 ++++++++++++++++++++++-------------
 arch/mips/ralink/rt288x.c             |  2 +-
 drivers/mtd/bcm47xxpart.c             | 42 ++++++++++--------
 drivers/net/ethernet/broadcom/bgmac.c | 13 ++++--
 drivers/net/ethernet/korina.c         |  8 ++--
 drivers/net/ethernet/marvell/mvneta.c |  8 ++--
 8 files changed, 104 insertions(+), 73 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 01/16] ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 02/16] net: mvneta: Fix for_each_present_cpu usage Amit Pundir
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, Jon Mason, Florian Fainelli

From: Jon Mason <jon.mason@broadcom.com>

commit 0c2bf9f95983fe30aa2f6463cb761cd42c2d521a upstream.

GIC_PPI flags were misconfigured for the timers, resulting in errors
like:
[    0.000000] GIC: PPI11 is secure or misconfigured

Changing them to being edge triggered corrects the issue

Suggested-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Jon Mason <jon.mason@broadcom.com>
Fixes: d27509f1 ("ARM: BCM5301X: add dts files for BCM4708 SoC")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
[AmitP: Resolved minor cherry-pick conflict]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
To be cherry-picked on linux-3.18.y as well.

 arch/arm/boot/dts/bcm5301x.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
index 6f50f672efbd..de8ac998604d 100644
--- a/arch/arm/boot/dts/bcm5301x.dtsi
+++ b/arch/arm/boot/dts/bcm5301x.dtsi
@@ -54,14 +54,14 @@
 		timer@0200 {
 			compatible = "arm,cortex-a9-global-timer";
 			reg = <0x0200 0x100>;
-			interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&clk_periph>;
 		};
 
 		local-timer@0600 {
 			compatible = "arm,cortex-a9-twd-timer";
 			reg = <0x0600 0x100>;
-			interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_PPI 13 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&clk_periph>;
 		};
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 02/16] net: mvneta: Fix for_each_present_cpu usage
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 01/16] ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 03/16] MIPS: ath79: fix regression in PCI window initialization Amit Pundir
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, Gregory CLEMENT, David S . Miller

From: Gregory CLEMENT <gregory.clement@free-electrons.com>

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 <stefan.roese@gmail.com>
Suggested-by: Jisheng Zhang <jszhang@marvell.com>
Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 drivers/net/ethernet/marvell/mvneta.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 71ec9cb08e06..15056f06754a 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2446,7 +2446,7 @@ static void mvneta_start_dev(struct mvneta_port *pp)
 	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 mvneta_port *pp)
 
 	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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 03/16] MIPS: ath79: fix regression in PCI window initialization
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 01/16] ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 02/16] net: mvneta: Fix for_each_present_cpu usage Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 04/16] net: korina: Fix NAPI versus resources freeing Amit Pundir
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH
  Cc: Stable, Felix Fietkau, Alban Bedel, sergei.shtylyov, linux-mips,
	Ralf Baechle

From: Felix Fietkau <nbd@nbd.name>

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 <albeu@free.fr>
Fixes: 24b0e3e84fbf ("MIPS: ath79: Improve the DDR controller interface")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Cc: sergei.shtylyov@cogentembedded.com
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/13258/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 arch/mips/ath79/common.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c
index 3cedd1f95e0f..8ae4067a5eda 100644
--- 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);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 04/16] net: korina: Fix NAPI versus resources freeing
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (2 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 03/16] MIPS: ath79: fix regression in PCI window initialization Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 05/16] MIPS: ralink: MT7688 pinmux fixes Amit Pundir
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, Florian Fainelli, David S . Miller

From: Florian Fainelli <f.fainelli@gmail.com>

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 <alex@ozo.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
To be cherry-picked on linux-3.18.y and linux-4.9.y as well.

 drivers/net/ethernet/korina.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
index d74f5f4e5782..07eabf72c480 100644
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -900,10 +900,10 @@ static void korina_restart_task(struct work_struct *work)
 				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_device *dev)
 	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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 05/16] MIPS: ralink: MT7688 pinmux fixes
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (3 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 04/16] net: korina: Fix NAPI versus resources freeing Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 06/16] MIPS: ralink: fix USB frequency scaling Amit Pundir
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, John Crispin, linux-mips, Ralf Baechle

From: John Crispin <blogic@openwrt.org>

commit e906a5f67e5a3337d696ec848e9c28fc68b39aa3 upstream.

A few fixes to the pinmux data, 2 new muxes and a minor whitespace
cleanup.

Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11991/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 arch/mips/ralink/mt7620.c | 80 +++++++++++++++++++++++++++++------------------
 1 file changed, 50 insertions(+), 30 deletions(-)

diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c
index dfb04fcedb04..733768e9877c 100644
--- a/arch/mips/ralink/mt7620.c
+++ b/arch/mips/ralink/mt7620.c
@@ -107,31 +107,31 @@ static struct rt2880_pmx_group mt7620a_pinmux_data[] = {
 };
 
 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_mt7628[] = {
 
 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_grp_mt7628[] = {
 	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_mt7628[] = {
 	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_pinmux_data[] = {
 				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 }
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 06/16] MIPS: ralink: fix USB frequency scaling
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (4 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 05/16] MIPS: ralink: MT7688 pinmux fixes Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 07/16] MIPS: ralink: Fix invalid assignment of SoC type Amit Pundir
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, John Crispin, linux-mips, Ralf Baechle

From: John Crispin <blogic@openwrt.org>

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 <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11992/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 arch/mips/ralink/mt7620.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c
index 733768e9877c..4c17dc6e8ae9 100644
--- 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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 07/16] MIPS: ralink: Fix invalid assignment of SoC type
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (5 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 06/16] MIPS: ralink: fix USB frequency scaling Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 08/16] MIPS: ralink: fix MT7628 pinmux typos Amit Pundir
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, John Crispin, linux-mips, Ralf Baechle

From: John Crispin <blogic@openwrt.org>

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 <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11993/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 arch/mips/ralink/rt288x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/ralink/rt288x.c b/arch/mips/ralink/rt288x.c
index 15506a1ff22a..9dd67749c592 100644
--- a/arch/mips/ralink/rt288x.c
+++ b/arch/mips/ralink/rt288x.c
@@ -109,5 +109,5 @@ void prom_soc_init(struct ralink_soc_info *soc_info)
 	soc_info->mem_size_max = RT2880_MEM_SIZE_MAX;
 
 	rt2880_pinmux_data = rt2880_pinmux_data_act;
-	ralink_soc == RT2880_SOC;
+	ralink_soc = RT2880_SOC;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 08/16] MIPS: ralink: fix MT7628 pinmux typos
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (6 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 07/16] MIPS: ralink: Fix invalid assignment of SoC type Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 09/16] MIPS: ralink: fix MT7628 wled_an pinmux gpio Amit Pundir
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH
  Cc: Stable, Álvaro Fernández Rojas, john, linux-mips,
	linux-kernel, Ralf Baechle

From: Álvaro Fernández Rojas <noltari@gmail.com>

commit d7146829c9da24e285cb1b1f2156b5b3e2d40c07 upstream.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
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 <ralf@linux-mips.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 arch/mips/ralink/mt7620.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c
index 4c17dc6e8ae9..37cfc7d3c185 100644
--- a/arch/mips/ralink/mt7620.c
+++ b/arch/mips/ralink/mt7620.c
@@ -223,9 +223,9 @@ static struct rt2880_pmx_func wled_an_grp_mt7628[] = {
 #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),
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 09/16] MIPS: ralink: fix MT7628 wled_an pinmux gpio
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (7 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 08/16] MIPS: ralink: fix MT7628 pinmux typos Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 10/16] mtd: bcm47xxpart: limit scanned flash area on BCM47XX (MIPS) only Amit Pundir
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH
  Cc: Stable, Álvaro Fernández Rojas, john, linux-mips,
	linux-kernel, Ralf Baechle

From: Álvaro Fernández Rojas <noltari@gmail.com>

commit 07b50db6e685172a41b9978aebffb2438166d9b6 upstream.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
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 <ralf@linux-mips.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 arch/mips/ralink/mt7620.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c
index 37cfc7d3c185..48d6349fd9d7 100644
--- a/arch/mips/ralink/mt7620.c
+++ b/arch/mips/ralink/mt7620.c
@@ -196,10 +196,10 @@ static struct rt2880_pmx_func wled_kn_grp_mt7628[] = {
 };
 
 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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 10/16] mtd: bcm47xxpart: limit scanned flash area on BCM47XX (MIPS) only
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (8 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 09/16] MIPS: ralink: fix MT7628 wled_an pinmux gpio Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 11/16] mtd: bcm47xxpart: don't fail because of bit-flips Amit Pundir
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, Rafał Miłecki, Brian Norris

From: Rafał Miłecki <zajec5@gmail.com>

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 <zajec5@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
To be cherry-picked on linux-3.18.y as well.

 drivers/mtd/bcm47xxpart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c
index 5abab8800891..546170a77466 100644
--- a/drivers/mtd/bcm47xxpart.c
+++ b/drivers/mtd/bcm47xxpart.c
@@ -118,8 +118,8 @@ static int bcm47xxpart_parse(struct mtd_info *master,
 	/* 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) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 11/16] mtd: bcm47xxpart: don't fail because of bit-flips
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (9 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 10/16] mtd: bcm47xxpart: limit scanned flash area on BCM47XX (MIPS) only Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 12/16] bgmac: fix a missing check for build_skb Amit Pundir
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, Rafał Miłecki, Brian Norris

From: Rafał Miłecki <zajec5@gmail.com>

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 <zajec5@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 drivers/mtd/bcm47xxpart.c | 38 ++++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c
index 546170a77466..9190057535e6 100644
--- a/drivers/mtd/bcm47xxpart.c
+++ b/drivers/mtd/bcm47xxpart.c
@@ -66,11 +66,13 @@ static const char *bcm47xxpart_trx_data_part_name(struct mtd_info *master,
 {
 	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_info *master,
 	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_info *master,
 		}
 
 		/* 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_info *master,
 		}
 
 		/* 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_info *master,
 		}
 
 		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;
 		}
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 12/16] bgmac: fix a missing check for build_skb
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (10 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 11/16] mtd: bcm47xxpart: don't fail because of bit-flips Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 13/16] bgmac: Fix reversed test of build_skb() return value Amit Pundir
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, wangweidong, David S . Miller

From: wangweidong <wangweidong1@huawei.com>

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 <wangweidong1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 drivers/net/ethernet/broadcom/bgmac.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index b56c9c581359..b7e10e1b9131 100644
--- 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 bgmac *bgmac, struct bgmac_dma_ring *ring,
 			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 +
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 13/16] bgmac: Fix reversed test of build_skb() return value.
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (11 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 12/16] bgmac: fix a missing check for build_skb Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 14/16] net: bgmac: Fix SOF bit checking Amit Pundir
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, David S. Miller

From: "David S. Miller" <davem@davemloft.net>

commit 750afbf8ee9c6a1c74a1fe5fc9852146b1d72687 upstream.

Fixes: f1640c3ddeec ("bgmac: fix a missing check for build_skb")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 drivers/net/ethernet/broadcom/bgmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index b7e10e1b9131..20356755b708 100644
--- 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 bgmac *bgmac, struct bgmac_dma_ring *ring,
 			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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 14/16] net: bgmac: Fix SOF bit checking
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (12 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 13/16] bgmac: Fix reversed test of build_skb() return value Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 15/16] net: bgmac: Start transmit queue in bgmac_open Amit Pundir
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, Florian Fainelli, David S . Miller

From: Florian Fainelli <f.fainelli@gmail.com>

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 <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 drivers/net/ethernet/broadcom/bgmac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 20356755b708..50de83bfcc2e 100644
--- 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 bgmac *bgmac, struct bgmac_dma_ring *ring)
 	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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 15/16] net: bgmac: Start transmit queue in bgmac_open
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (13 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 14/16] net: bgmac: Fix SOF bit checking Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-06-30  5:46 ` [PATCH for-4.4 16/16] net: bgmac: Remove superflous netif_carrier_on() Amit Pundir
  2017-07-03  9:51 ` [PATCH for-4.4 00/16] Stable commits picked up from lede project Greg KH
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, Florian Fainelli, David S . Miller

From: Florian Fainelli <f.fainelli@gmail.com>

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 <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 drivers/net/ethernet/broadcom/bgmac.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 50de83bfcc2e..a01f62ec12bb 100644
--- 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 *net_dev)
 	phy_start(bgmac->phy_dev);
 
 	netif_carrier_on(net_dev);
+
+	netif_start_queue(net_dev);
+
 	return 0;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH for-4.4 16/16] net: bgmac: Remove superflous netif_carrier_on()
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (14 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 15/16] net: bgmac: Start transmit queue in bgmac_open Amit Pundir
@ 2017-06-30  5:46 ` Amit Pundir
  2017-07-03  9:51 ` [PATCH for-4.4 00/16] Stable commits picked up from lede project Greg KH
  16 siblings, 0 replies; 18+ messages in thread
From: Amit Pundir @ 2017-06-30  5:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, Florian Fainelli, David S . Miller

From: Florian Fainelli <f.fainelli@gmail.com>

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 <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 drivers/net/ethernet/broadcom/bgmac.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index a01f62ec12bb..70da30095b89 100644
--- 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 *net_dev)
 
 	phy_start(bgmac->phy_dev);
 
-	netif_carrier_on(net_dev);
-
 	netif_start_queue(net_dev);
 
 	return 0;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH for-4.4 00/16] Stable commits picked up from lede project
  2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
                   ` (15 preceding siblings ...)
  2017-06-30  5:46 ` [PATCH for-4.4 16/16] net: bgmac: Remove superflous netif_carrier_on() Amit Pundir
@ 2017-07-03  9:51 ` Greg KH
  16 siblings, 0 replies; 18+ messages in thread
From: Greg KH @ 2017-07-03  9:51 UTC (permalink / raw)
  To: Amit Pundir; +Cc: Stable

On Fri, Jun 30, 2017 at 11:16:24AM +0530, Amit Pundir wrote:
> Hi Greg,
> 
> For your consideration, stable commits taken from lede source tree
> https://git.lede-project.org/?p=source.git for 4.4.y.
> 
> Cherry-picked and build tested on Linux v4.4.74 for
> ARCH=arm/arm64/x86/x86_64/mips + allmodconfig.

All now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-07-03  9:51 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30  5:46 [PATCH for-4.4 00/16] Stable commits picked up from lede project Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 01/16] ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 02/16] net: mvneta: Fix for_each_present_cpu usage Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 03/16] MIPS: ath79: fix regression in PCI window initialization Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 04/16] net: korina: Fix NAPI versus resources freeing Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 05/16] MIPS: ralink: MT7688 pinmux fixes Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 06/16] MIPS: ralink: fix USB frequency scaling Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 07/16] MIPS: ralink: Fix invalid assignment of SoC type Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 08/16] MIPS: ralink: fix MT7628 pinmux typos Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 09/16] MIPS: ralink: fix MT7628 wled_an pinmux gpio Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 10/16] mtd: bcm47xxpart: limit scanned flash area on BCM47XX (MIPS) only Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 11/16] mtd: bcm47xxpart: don't fail because of bit-flips Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 12/16] bgmac: fix a missing check for build_skb Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 13/16] bgmac: Fix reversed test of build_skb() return value Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 14/16] net: bgmac: Fix SOF bit checking Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 15/16] net: bgmac: Start transmit queue in bgmac_open Amit Pundir
2017-06-30  5:46 ` [PATCH for-4.4 16/16] net: bgmac: Remove superflous netif_carrier_on() Amit Pundir
2017-07-03  9:51 ` [PATCH for-4.4 00/16] Stable commits picked up from lede project Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.