Skip to contentSkip to conversation

ARM: omap: fix 4.7 gpmc networking regression

PATCH In review Johan Hovold 3 participants 9 messages Jul 24, 2016 – Aug 15, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover ARM: omap: fix 4.7 gpmc networking regression

Networking is currently broken for Overo boards due to a regression in 4.7. I bisected it down to

d2d00862dfbb ("memory: omap-gpmc: Support general purpose input for WAITPINs")

which changed how errors when probing gpmc child nodes are handled. Instead of proceeding with setting up any other children as before, a single error now aborts the whole process.

Due to an unrelated issue with a nand gpmc-node, this change broke networking for Overo Tobi and other Overo boards with gpmc ethernet:

[    0.823364] omap-gpmc 6e000000.gpmc: GPMC revision 5.0
[    0.823822] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    0.823974] gpiochip_find_base: found new base at 508
[    0.824096] gpio gpiochip6: (omap-gpmc): added GPIO chardev (254:6)
[    0.827148] gpiochip_setup_dev: registered GPIOs 508 to 511 on device: gpiochip6 (omap-gpmc)
[    0.827362] omap-gpmc 6e000000.gpmc: /ocp/gpmc at 6e000000/nand at 0,0 has malformed 'reg' property
[    0.827392] omap-gpmc 6e000000.gpmc: failed to probe DT children

This series restores the 4.6 behaviour of allowing probe of gpmc child nodes to fail, and also fixes the problems with the Overo nand node.

Note that simply fixing the Overo NAND issue would fix the Overo networking regression, but by restoring the 4.6 gpmc-probe behaviour similar regressions on other OMAP systems are also avoided.

Johan

Johan Hovold (3):
memory: omap-gpmc: allow probe of child nodes to fail
ARM: dts: overo: fix gpmc nand cs0 range
ARM: dts: overo: fix gpmc nand on boards with ethernet

 arch/arm/boot/dts/omap3-overo-base.dtsi             |  4 +++-
 .../arm/boot/dts/omap3-overo-chestnut43-common.dtsi |  2 --
 arch/arm/boot/dts/omap3-overo-tobi-common.dtsi      |  2 --
 arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi   |  3 ---
 drivers/memory/omap-gpmc.c                          | 21 +++++++--------------
 5 files changed, 10 insertions(+), 22 deletions(-)
Signature · 1 line
2.7.3
#1 lore raw

PATCH 1/3 memory: omap-gpmc: allow probe of child nodes to fail

A recent commit (inadvertently?) changed how failed probe of a gpmc child node was handled. Instead of proceeding with setting up any other children as before, a single error now aborts the whole process.

This change broke networking on some Overo boards due to probe failing for an unrelated nand node. This second issue should obviously be fixed, but let's restore the old behaviour of allowing child-node probe to fail to avoid further similar breakage on other systems.

Fixes d2d00862dfbb ("memory: omap-gpmc: Support general purpose input

for WAITPINs")

---
 drivers/memory/omap-gpmc.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)
drivers/memory/omap-gpmc.c +7 -14
index 15508df24e5d..73ec3200191e 100644
@@ -2250,7 +2250,7 @@ static int gpmc_probe_dt(struct platform_device *pdev)
 	return 0;
 }
 
-static int gpmc_probe_dt_children(struct platform_device *pdev)
+static void gpmc_probe_dt_children(struct platform_device *pdev)
 {
 	int ret;
 	struct device_node *child;
@@ -2265,11 +2265,11 @@ static int gpmc_probe_dt_children(struct platform_device *pdev)
 		else
 			ret = gpmc_probe_generic_child(pdev, child);
 
-		if (ret)
-			return ret;
+		if (ret) {
+			dev_err(&pdev->dev, "failed to probe DT child '%s': %d\n",
+				child->name, ret);
+		}
 	}
-
-	return 0;
 }
 #else
 static int gpmc_probe_dt(struct platform_device *pdev)
@@ -2277,9 +2277,8 @@ static int gpmc_probe_dt(struct platform_device *pdev)
 	return 0;
 }
 
-static int gpmc_probe_dt_children(struct platform_device *pdev)
+static void gpmc_probe_dt_children(struct platform_device *pdev)
 {
-	return 0;
 }
 #endif
 
@@ -2372,16 +2371,10 @@ static int gpmc_probe(struct platform_device *pdev)
 		goto setup_irq_failed;
 	}
 
-	rc = gpmc_probe_dt_children(pdev);
-	if (rc < 0) {
-		dev_err(gpmc->dev, "failed to probe DT children\n");
-		goto dt_children_failed;
-	}
+	gpmc_probe_dt_children(pdev);
 
 	return 0;
 
-dt_children_failed:
-	gpmc_free_irq(gpmc);
 setup_irq_failed:
 	gpmc_gpio_exit(gpmc);
 gpio_init_failed:
Signature · 1 line
2.7.3
#2 lore raw

PATCH 2/3 ARM: dts: overo: fix gpmc nand cs0 range

In reply to Johan Hovold

The gpmc ranges property for NAND at CS0 has been broken since it was first added.

This currently prevents the nand gpmc child node from being probed:

	omap-gpmc 6e000000.gpmc: /ocp/gpmc at 6e000000/nand at 0,0 has
	malformed 'reg' property

and consequently the NAND device from being registered.

Fixes 98ce6007efb4 ("ARM: dts: overo: Support PoP NAND")
Cc stable <[email protected]> # 4.3
---
 arch/arm/boot/dts/omap3-overo-base.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/omap3-overo-base.dtsi +1 -1
index de256fa8da48..b15c435439fb 100644
@@ -223,7 +223,7 @@
 };
 
 &gpmc {
-	ranges = <0 0 0x00000000 0x20000000>;
+	ranges = <0 0 0x30000000 0x1000000>;	/* CS0 */
 
 	nand at 0,0 {
 		compatible = "ti,omap2-nand";
Signature · 1 line
2.7.3
#3 lore raw

PATCH 3/3 ARM: dts: overo: fix gpmc nand on boards with ethernet

In reply to Johan Hovold

The gpmc ranges property for NAND at CS0 was being overridden by later includes that defined gpmc ethernet nodes, effectively breaking NAND on these systems:

	omap-gpmc 6e000000.gpmc: /ocp/gpmc at 6e000000/nand at 0,0 has
	malformed 'reg' property

Instead of redefining the NAND range in every such dtsi, define all currently used ranges in omap3-overo-base.dtsi.

Fixes 98ce6007efb4 ("ARM: dts: overo: Support PoP NAND")
Cc stable <[email protected]> # 4.3
---
 arch/arm/boot/dts/omap3-overo-base.dtsi              | 4 +++-
 arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi | 2 --
 arch/arm/boot/dts/omap3-overo-tobi-common.dtsi       | 2 --
 arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi    | 3 ---
 4 files changed, 3 insertions(+), 8 deletions(-)
arch/arm/boot/dts/omap3-overo-base.dtsi +3 -1
index b15c435439fb..3e946cac55f3 100644
@@ -223,7 +223,9 @@
 };
 
 &gpmc {
-	ranges = <0 0 0x30000000 0x1000000>;	/* CS0 */
+	ranges = <0 0 0x30000000 0x1000000>,	/* CS0 */
+		 <4 0 0x2b000000 0x1000000>,	/* CS4 */
+		 <5 0 0x2c000000 0x1000000>;	/* CS5 */
 
 	nand at 0,0 {
 		compatible = "ti,omap2-nand";
arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi +0 -2
index 7df27926ead2..4f4c6efbd518 100644
@@ -55,8 +55,6 @@
 #include "omap-gpmc-smsc9221.dtsi"
 
 &gpmc {
-	ranges = <5 0 0x2c000000 0x1000000>;	/* CS5 */
-
 	ethernet at gpmc {
 		reg = <5 0 0xff>;
 		interrupt-parent = <&gpio6>;
arch/arm/boot/dts/omap3-overo-tobi-common.dtsi +0 -2
index 9e24b6a1d07b..1b304e2f1bd2 100644
@@ -27,8 +27,6 @@
 #include "omap-gpmc-smsc9221.dtsi"
 
 &gpmc {
-	ranges = <5 0 0x2c000000 0x1000000>;	/* CS5 */
-
 	ethernet at gpmc {
 		reg = <5 0 0xff>;
 		interrupt-parent = <&gpio6>;
arch/arm/boot/dts/omap3-overo-tobiduo-common.dtsi +0 -3
index 334109e14613..82e98ee3023a 100644
@@ -15,9 +15,6 @@
 #include "omap-gpmc-smsc9221.dtsi"
 
 &gpmc {
-	ranges = <4 0 0x2b000000 0x1000000>,	/* CS4 */
-		 <5 0 0x2c000000 0x1000000>;	/* CS5 */
-
 	smsc1: ethernet at gpmc {
 		reg = <5 0 0xff>;
 		interrupt-parent = <&gpio6>;
Signature · 1 line
2.7.3
maintainer
#4 lore raw
In reply to Johan Hovold
Quoted 5 lines · Johan Hovold

Networking is currently broken for Overo boards due to a regression in 4.7. I bisected it down to

d2d00862dfbb ("memory: omap-gpmc: Support general purpose input for WAITPINs")

...

Quoted 3 lines

Note that simply fixing the Overo NAND issue would fix the Overo networking regression, but by restoring the 4.6 gpmc-probe behaviour similar regressions on other OMAP systems are also avoided.

Roger, got a better fix in mind?

Regards,

Tony

#5 lore raw
Quoted 6 lines · Tony Lindgren
Quoted 5 lines · Johan Hovold

Networking is currently broken for Overo boards due to a regression in 4.7. I bisected it down to

d2d00862dfbb ("memory: omap-gpmc: Support general purpose input for WAITPINs")

Quoted 8 lines

...

Quoted 3 lines

Note that simply fixing the Overo NAND issue would fix the Overo networking regression, but by restoring the 4.6 gpmc-probe behaviour similar regressions on other OMAP systems are also avoided.

Roger, got a better fix in mind?

Nope. I'll take patch 1 in my omap-gpmc queue for v4.8. Thanks for the fixes Johan.

cheers,
-roger

#6 lore raw
Quoted 13 lines · Roger Quadros
Quoted 12 lines · Tony Lindgren
Quoted 5 lines · Johan Hovold

Networking is currently broken for Overo boards due to a regression in 4.7. I bisected it down to

d2d00862dfbb ("memory: omap-gpmc: Support general purpose input for WAITPINs")

...

Quoted 3 lines

Note that simply fixing the Overo NAND issue would fix the Overo networking regression, but by restoring the 4.6 gpmc-probe behaviour similar regressions on other OMAP systems are also avoided.

Quoted 5 lines
Quoted 2 lines

Roger, got a better fix in mind?

Nope. I'll take patch 1 in my omap-gpmc queue for v4.8. Thanks for the fixes Johan.

Now that 4.7 has been released, you may want to consider adding a stable tag also for the first patch to avoid similar issues on other systems when they get updated to 4.7-stable.

Thanks,
Johan

#7 lore raw
Quoted 17 lines · Johan Hovold
Quoted 16 lines · Roger Quadros
Quoted 14 lines · Tony Lindgren
Quoted 5 lines · Johan Hovold

Networking is currently broken for Overo boards due to a regression in 4.7. I bisected it down to

d2d00862dfbb ("memory: omap-gpmc: Support general purpose input for WAITPINs")

...

Quoted 3 lines

Note that simply fixing the Overo NAND issue would fix the Overo networking regression, but by restoring the 4.6 gpmc-probe behaviour similar regressions on other OMAP systems are also avoided.

Roger, got a better fix in mind?

Quoted 7 lines
Quoted 2 lines

Nope. I'll take patch 1 in my omap-gpmc queue for v4.8. Thanks for the fixes Johan.

Now that 4.7 has been released, you may want to consider adding a stable tag also for the first patch to avoid similar issues on other systems when they get updated to 4.7-stable.

Yes, that was my plan as well.

cheers,
-roger

maintainer
#8 lore raw
Quoted 21 lines · Roger Quadros
Quoted 20 lines · Johan Hovold
Quoted 18 lines · Roger Quadros
Quoted 6 lines · Tony Lindgren
Quoted 5 lines · Johan Hovold

Networking is currently broken for Overo boards due to a regression in 4.7. I bisected it down to

d2d00862dfbb ("memory: omap-gpmc: Support general purpose input for WAITPINs")

Quoted 8 lines

...

Quoted 3 lines

Note that simply fixing the Overo NAND issue would fix the Overo networking regression, but by restoring the 4.6 gpmc-probe behaviour similar regressions on other OMAP systems are also avoided.

Roger, got a better fix in mind?

Nope. I'll take patch 1 in my omap-gpmc queue for v4.8. Thanks for the fixes Johan.

Quoted 6 lines
Quoted 4 lines

Now that 4.7 has been released, you may want to consider adding a stable tag also for the first patch to avoid similar issues on other systems when they get updated to 4.7-stable.

Yes, that was my plan as well.

OK and I'm now finally applying the dts fixes into omap-for-v4.8/fixes. Sorry for the delay.

Tony