mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] net: cpsw: Fix crashes on beaglebone black
@ 2014-12-27 14:39 ledphilippe
  2015-01-05 12:35 ` Teresa Gámez
  0 siblings, 1 reply; 3+ messages in thread
From: ledphilippe @ 2014-12-27 14:39 UTC (permalink / raw)
  To: barebox, ledphilippe

Hello,

The current version (2014.12.0-00116-ge91702b) crashes on the beaglebone black 
if the ethernet driver is enabled. Here is the trace:

barebox 2014.12.0-00116-ge91702b #15 Sat Dec 27 15:30:25 CET 2014


Board: TI AM335x BeagleBone black
detected 'BeagleBone Black'
cpsw 4a100000.ethernet: detected phy mask 0x1
mdio_bus: miibus0: probed
eth0: got preset MAC address: d0:39:72:41:0a:26
cpsw 4a100000.ethernet: probe failed: I/O error
unable to handle paging request at address 0x6e6f62f2
pc : [<9fe24e4a>]    lr : [<9fe0751f>]
sp : 9ffffe60  ip : ffffffff  fp : 00000000
r10: 8ff1d8b8  r9 : 8ff12534  r8 : 8ff1d974
r7 : ffffffff  r6 : 8ff1d8e0  r5 : 9fe55220  r4 : 6e6f62f2
r3 : 00000000  r2 : 00000000  r1 : 8ff1d8e0  r0 : 6e6f62f2
Flags: nZCV  IRQs off  FIQs on  Mode SVC_32
[<9fe24e4a>] (strcmp+0xc/0x1a) from [<9fe0751f>] 
(get_device_by_name_id+0x1f/0x38)
[<9fe0751f>] (get_device_by_name_id+0x1f/0x38) from [<9fe07837>] 
(register_device+0x17/0xc8)
[<9fe07837>] (register_device+0x17/0xc8) from [<9fe1dcb3>] 
(of_platform_device_create+0x17b/0x1b0)
[<9fe1dcb3>] (of_platform_device_create+0x17b/0x1b0) from [<9fe1dd13>] 
(of_platform_bus_create+0x2b/0x68)
[<9fe1dd13>] (of_platform_bus_create+0x2b/0x68) from [<9fe1dda7>] 
(of_platform_populate+0x2f/0x44)
[<9fe1dda7>] (of_platform_populate+0x2f/0x44) from [<9fe07967>] 
(platform_probe+0x9/0xa)
[<9fe07967>] (platform_probe+0x9/0xa) from [<9fe07561>] 
(device_probe+0x11/0x44)
[<9fe07561>] (device_probe+0x11/0x44) from [<9fe075bb>] 
(match.part.2+0x27/0x2e)
[<9fe075bb>] (match.part.2+0x27/0x2e) from [<9fe076d5>] 
(register_driver+0x59/0x74)
[<9fe076d5>] (register_driver+0x59/0x74) from [<9fe00827>] 
(start_barebox+0x1b/0xb8)
[<9fe00827>] (start_barebox+0x1b/0xb8) from [<9fe3291f>] (__start+0xa3/0xb8)
[<9fe3291f>] (__start+0xa3/0xb8) from [<9fe00005>] (__bare_init_start+0x1/0xc)

[<9fe32349>] (unwind_backtrace+0x1/0x58) from [<9fe258e9>] (panic+0x1d/0x34)
[<9fe258e9>] (panic+0x1d/0x34) from [<9fe327e1>] (do_exception+0xd/0x10)
[<9fe327e1>] (do_exception+0xd/0x10) from [<9fe32849>] 
(do_data_abort+0x21/0x2c)
[<9fe32849>] (do_data_abort+0x21/0x2c) from [<9fe32508>] 
(data_abort+0x48/0x60)



The following patch resolves the problem on my board. Please review it and 
check if it is fine.

Regards,


Signed-off-by: Philippe Leduc <ledphilippe@gmail.com>
---
 drivers/net/cpsw.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index b6618ad..311cd44 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -1202,10 +1202,8 @@ int cpsw_probe(struct device_d *dev)
                struct phy_device *phy;
 
                phy = mdiobus_scan(&priv->miibus, priv->slaves[i].phy_id);
-               if (IS_ERR(phy)) {
-                       ret = PTR_ERR(phy);
-                       goto out;
-               }
+               if (IS_ERR(phy))
+                       continue;
 
                phy->dev.device_node = priv->slaves[i].dev.device_node;
                ret = phy_register_device(phy);
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] net: cpsw: Fix crashes on beaglebone black
  2014-12-27 14:39 [PATCH] net: cpsw: Fix crashes on beaglebone black ledphilippe
@ 2015-01-05 12:35 ` Teresa Gámez
  2015-01-06 14:16   ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Teresa Gámez @ 2015-01-05 12:35 UTC (permalink / raw)
  To: ledphilippe; +Cc: barebox

Hello Philippe,

Am Samstag, den 27.12.2014, 15:39 +0100 schrieb ledphilippe@gmail.com:
> Hello,
> 
> The current version (2014.12.0-00116-ge91702b) crashes on the beaglebone black 
> if the ethernet driver is enabled. Here is the trace:
> 
> barebox 2014.12.0-00116-ge91702b #15 Sat Dec 27 15:30:25 CET 2014
> 
> 
> Board: TI AM335x BeagleBone black
> detected 'BeagleBone Black'
> cpsw 4a100000.ethernet: detected phy mask 0x1
> mdio_bus: miibus0: probed
> eth0: got preset MAC address: d0:39:72:41:0a:26
> cpsw 4a100000.ethernet: probe failed: I/O error
> unable to handle paging request at address 0x6e6f62f2
> pc : [<9fe24e4a>]    lr : [<9fe0751f>]
> sp : 9ffffe60  ip : ffffffff  fp : 00000000
> r10: 8ff1d8b8  r9 : 8ff12534  r8 : 8ff1d974
> r7 : ffffffff  r6 : 8ff1d8e0  r5 : 9fe55220  r4 : 6e6f62f2
> r3 : 00000000  r2 : 00000000  r1 : 8ff1d8e0  r0 : 6e6f62f2
> Flags: nZCV  IRQs off  FIQs on  Mode SVC_32
> [<9fe24e4a>] (strcmp+0xc/0x1a) from [<9fe0751f>] 
> (get_device_by_name_id+0x1f/0x38)
> [<9fe0751f>] (get_device_by_name_id+0x1f/0x38) from [<9fe07837>] 
> (register_device+0x17/0xc8)
> [<9fe07837>] (register_device+0x17/0xc8) from [<9fe1dcb3>] 
> (of_platform_device_create+0x17b/0x1b0)
> [<9fe1dcb3>] (of_platform_device_create+0x17b/0x1b0) from [<9fe1dd13>] 
> (of_platform_bus_create+0x2b/0x68)
> [<9fe1dd13>] (of_platform_bus_create+0x2b/0x68) from [<9fe1dda7>] 
> (of_platform_populate+0x2f/0x44)
> [<9fe1dda7>] (of_platform_populate+0x2f/0x44) from [<9fe07967>] 
> (platform_probe+0x9/0xa)
> [<9fe07967>] (platform_probe+0x9/0xa) from [<9fe07561>] 
> (device_probe+0x11/0x44)
> [<9fe07561>] (device_probe+0x11/0x44) from [<9fe075bb>] 
> (match.part.2+0x27/0x2e)
> [<9fe075bb>] (match.part.2+0x27/0x2e) from [<9fe076d5>] 
> (register_driver+0x59/0x74)
> [<9fe076d5>] (register_driver+0x59/0x74) from [<9fe00827>] 
> (start_barebox+0x1b/0xb8)
> [<9fe00827>] (start_barebox+0x1b/0xb8) from [<9fe3291f>] (__start+0xa3/0xb8)
> [<9fe3291f>] (__start+0xa3/0xb8) from [<9fe00005>] (__bare_init_start+0x1/0xc)
> 
> [<9fe32349>] (unwind_backtrace+0x1/0x58) from [<9fe258e9>] (panic+0x1d/0x34)
> [<9fe258e9>] (panic+0x1d/0x34) from [<9fe327e1>] (do_exception+0xd/0x10)
> [<9fe327e1>] (do_exception+0xd/0x10) from [<9fe32849>] 
> (do_data_abort+0x21/0x2c)
> [<9fe32849>] (do_data_abort+0x21/0x2c) from [<9fe32508>] 
> (data_abort+0x48/0x60)
> 
> 

I suspect the issue comes from the dummy cpsw_emac1 node which adds a
non existing phy in the beaglebone device tree. So the mdiobus_scan
fails. This patch will workaround the issue but I'm unsure about right
solution here. 

Regards,
Teresa 

> 
> The following patch resolves the problem on my board. Please review it and 
> check if it is fine.
> 
> Regards,
> 
> 
> Signed-off-by: Philippe Leduc <ledphilippe@gmail.com>
> ---
>  drivers/net/cpsw.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
> index b6618ad..311cd44 100644
> --- a/drivers/net/cpsw.c
> +++ b/drivers/net/cpsw.c
> @@ -1202,10 +1202,8 @@ int cpsw_probe(struct device_d *dev)
>                 struct phy_device *phy;
>  
>                 phy = mdiobus_scan(&priv->miibus, priv->slaves[i].phy_id);
> -               if (IS_ERR(phy)) {
> -                       ret = PTR_ERR(phy);
> -                       goto out;
> -               }
> +               if (IS_ERR(phy))
> +                       continue;
>  
>                 phy->dev.device_node = priv->slaves[i].dev.device_node;
>                 ret = phy_register_device(phy);



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] net: cpsw: Fix crashes on beaglebone black
  2015-01-05 12:35 ` Teresa Gámez
@ 2015-01-06 14:16   ` Sascha Hauer
  0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2015-01-06 14:16 UTC (permalink / raw)
  To: Teresa Gámez; +Cc: ledphilippe, barebox

On Mon, Jan 05, 2015 at 01:35:21PM +0100, Teresa Gámez wrote:
> Hello Philippe,
> 
> > 
> > [<9fe32349>] (unwind_backtrace+0x1/0x58) from [<9fe258e9>] (panic+0x1d/0x34)
> > [<9fe258e9>] (panic+0x1d/0x34) from [<9fe327e1>] (do_exception+0xd/0x10)
> > [<9fe327e1>] (do_exception+0xd/0x10) from [<9fe32849>] 
> > (do_data_abort+0x21/0x2c)
> > [<9fe32849>] (do_data_abort+0x21/0x2c) from [<9fe32508>] 
> > (data_abort+0x48/0x60)
> > 
> > 
> 
> I suspect the issue comes from the dummy cpsw_emac1 node which adds a
> non existing phy in the beaglebone device tree. So the mdiobus_scan
> fails. This patch will workaround the issue but I'm unsure about right
> solution here.

You are right, this is not the ideal solution. Nevertheless I just sent
out a similar patch. It should be good enough for now.

In the longer run the phy shouldn't be probed for in the devices probe
function. There also should be a way to disable a slave in the device
tree, right now both slaves are defined in the dtsi file and a status =
"disabled" is ignored (Does this work in the kernel?).
Also the cpsw driver should accept a proper phy binding. The official
agreed-upon binding is phy-handle = <&ethphy>, not phy_id = <&miibus>,
<0>. The driver should at least optionally support this.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2015-01-06 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-27 14:39 [PATCH] net: cpsw: Fix crashes on beaglebone black ledphilippe
2015-01-05 12:35 ` Teresa Gámez
2015-01-06 14:16   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox