Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751818Ab3GGKxD (ORCPT ); Sun, 7 Jul 2013 06:53:03 -0400 Received: from mail-ea0-f182.google.com ([209.85.215.182]:52599 "EHLO mail-ea0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295Ab3GGKxA (ORCPT ); Sun, 7 Jul 2013 06:53:00 -0400 Message-ID: <51D94884.4000204@gmail.com> Date: Sun, 07 Jul 2013 12:52:52 +0200 From: Sebastian Hesselbarth User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: Jonas Gorski CC: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Florian Fainelli , Andrew Lunn , Jason Cooper Subject: Re: Second ethernet on kirkwood does not work when probed through DT References: <20130706215426.6e666d6af0dc6c9ea5fe32cd@openwrt.org> <51D88A8E.1060104@gmail.com> <20130706233912.00004044@unknown> In-Reply-To: <20130706233912.00004044@unknown> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 11173 Lines: 191 On 07/06/2013 11:39 PM, Jonas Gorski wrote: > On Sat, 06 Jul 2013 23:22:22 +0200 > Sebastian Hesselbarth wrote: >> On 07/06/2013 09:54 PM, Jonas Gorski wrote: >>> Hello Sebastian, >>> >>> using your DT patches[1] (on top of 3.10) I can't get the second >>> ethernet to work on my kirkwood board. >> >> Hi Jonas, >> >> next time please name your board, because there are plenty of it. >> Kirkwood is just the SoC used on them. > > Oops, sorry. It's D-Link DIR-665, with a 6281. Currently not upstream, > but mostly supported (the switch isn't supported by DSA but works fine > without it). Jonas, sorry, I didn't realize you already sent your request on MLs. It was too late yesterday :P I also added Florian, Jason, and Andrew to the Cc list. Ok, so the DIR665 has this switch configuration on both KW ethernet controllers. Just to make sure, the first one is working but the second isn't? >>> (Both macs are connected to a switch, so use a fixed link, and no >>> phy). >>> >>> Eth1 gets probed fine, but never gets a link when brought up, and >>> trying to bring it down again hangs the board hard. >>> >>> Using Florian's older patches, it is brought up fine and works (after >>> adapting the node names of course). >>> >>> Also I noticed that you named eth1's ethernet1-port node wrongly in >>> (at least) your kirkwood conversion patch[2]; you used >>> >>> ð1 { status = "okay"; ethernet1-port@0 { must be @1--^ phy-handle >>> =<ðphy1>; }; }; >> >> Can you please try to leave ethernet1-port@0 and match >> the one in kirkwood.dtsi? >> >> Both "ports" need reg =<0> as there is two controllers >> with one port at 0 on Kirkwood. > > kirkwood.dtsi itself says ethernet1-port@1 with reg =<1>. > > Changing reg to 0 for eth1 brings: The error below is a naming issue for the port. As there is only one port per controller, both reg properties of the port nodes of kirkwood.dtsi have to be <0> as they determine the register offset within the controller registers. As mentioned before, KW has a dual-controller, single port configuration. So the wrong reg property in kirkwood.dtsi is a bug and I will update the patch. Second, mv643xx_eth as in net-next does a platform_device_alloc(MV643XX_ETH_NAME, ppd.port_number) which will cause two devices named mv643xx_eth_port.0 if you change both of the reg property to <0>. A quick fix would be to change the above to platform_device_alloc(pnp->name, ppd.port_number) so the port devices will be named after the device nodes name. Also, for this I will prepare a patch. But the rename of the port devices could again raise the clock gating/loosing MAC issue. (I know again, why I hate this shared/port separation of mv643xx_eth) Anyway, can you please try to have both ports reg properties set to <0>, with nodes named ethernet0-port@0 and ethernet1-port@0, and the platform_device_alloc in mv643xx_eth modified? Sebastian > [ 9.586915] ------------[ cut here ]------------ > [ 9.591590] WARNING: at fs/sysfs/dir.c:530 sysfs_add_one+0x88/0xa8() > [ 9.597973] sysfs: cannot create duplicate filename '/devices/platform/mv643xx_eth_port.0' > [ 9.606286] Modules linked in: > [ 9.609366] CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.0 #12 > [ 9.615231] Backtrace: > [ 9.617714] [] (dump_backtrace+0x0/0x114) from [] (show_stack+0x18/0x1c) > [ 9.626205] r6:00000212 r5:c02cd6e0 r4:c782fbe0 r3:00000000 > [ 9.631972] [] (show_stack+0x0/0x1c) from [] (dump_stack+0x20/0x28) > [ 9.640024] [] (dump_stack+0x0/0x28) from [] (warn_slowpath_common+0x58/0x74) > [ 9.648958] [] (warn_slowpath_common+0x0/0x74) from [] (warn_slowpath_fmt+0x38/0x40) > [ 9.658492] r8:c780d288 r7:c7823000 r6:c782fc28 r5:c73c1c88 r4:c782fc04 > r3:00000009 > [ 9.666436] [] (warn_slowpath_fmt+0x0/0x40) from [] (sysfs_add_one+0x88/0xa8) > [ 9.675357] r3:c7823000 r2:c02cd750 > [ 9.678964] r4:ffffffef > [ 9.681539] [] (sysfs_add_one+0x0/0xa8) from [] (create_dir+0x70/0xc0) > [ 9.689836] r7:c78c64d8 r6:00000000 r5:c73c1c88 r4:00002001 > [ 9.695577] [] (create_dir+0x0/0xc0) from [] (sysfs_create_dir+0xbc/0xdc) > [ 9.704165] [] (sysfs_create_dir+0x0/0xdc) from [] (kobject_add_internal+0xb8/0x1e4) > [ 9.713698] r6:c07ae3b0 r5:c78c64d8 r4:c78c64d8 > [ 9.718375] [] (kobject_add_internal+0x0/0x1e4) from [] (kobject_add+0x80/0x98) > [ 9.727487] [] (kobject_add+0x0/0x98) from [] (device_add+0xd8/0x54c) > [ 9.735708] r3:00000000 r2:00000000 > [ 9.739315] r6:00000000 r5:c78c64d0 r4:c78c64c0 > [ 9.744002] [] (device_add+0x0/0x54c) from [] (platform_device_add+0x14c/0x1e0) > [ 9.753117] [] (platform_device_add+0x0/0x1e0) from [] (mv643xx_eth_shared_of_add_port+0x240/0x2a8) > [ 9.763962] r8:00000e00 r7:c73b1b70 r6:0000003e r5:00000000 r4:c78c64c0 > r3:00000000 > [ 9.771899] [] (mv643xx_eth_shared_of_add_port+0x0/0x2a8) from [] (mv643xx_eth_shared_probe+0x22c/0x318) > [ 9.783172] r5:c08ea74c r4:c08ea89c > [ 9.786790] [] (mv643xx_eth_shared_probe+0x0/0x318) from [] (platform_drv_probe+0x1c/0x20) > [ 9.796860] [] (platform_drv_probe+0x0/0x20) from [] (driver_probe_device+0xe4/0x210) > [ 9.806493] [] (driver_probe_device+0x0/0x210) from [] (__driver_attach+0x68/0x8c) > [ 9.815853] r7:00000000 r6:c07b3f64 r5:c785bdb0 r4:c785bde4 > [ 9.821594] [] (__driver_attach+0x0/0x8c) from [] (bus_for_each_dev+0x58/0x90) > [ 9.830600] r6:c07b3f64 r5:c0161f24 r4:00000000 r3:00000002 > [ 9.836329] [] (bus_for_each_dev+0x0/0x90) from [] (driver_attach+0x20/0x28) > [ 9.845162] r6:c07ae368 r5:c07b3f64 r4:c73ad4a0 > [ 9.849836] [] (driver_attach+0x0/0x28) from [] (bus_add_driver+0xb8/0x21c) > [ 9.858596] [] (bus_add_driver+0x0/0x21c) from [] (driver_register+0xa8/0x138) > [ 9.867606] r8:0000003e r7:00000000 r6:c07b3f64 r5:c033dd5c r4:c034200c > [ 9.874409] [] (driver_register+0x0/0x138) from [] (platform_driver_register+0x4c/0x60) > [ 9.884216] [] (platform_driver_register+0x0/0x60) from [] (mv643xx_eth_init_module+0x14/0x44) > [ 9.894633] [] (mv643xx_eth_init_module+0x0/0x44) from [] (do_one_initcall+0x9c/0x15c) > [ 9.904335] r4:c034200c r3:00000000 > [ 9.907956] [] (do_one_initcall+0x0/0x15c) from [] (kernel_init_freeable+0xf8/0x1c4) > [ 9.917512] [] (kernel_init_freeable+0x0/0x1c4) from [] (kernel_init+0x10/0x104) > [ 9.926709] [] (kernel_init+0x0/0x104) from [] (ret_from_fork+0x14/0x24) > [ 9.935196] r4:00000000 r3:00000000 > [ 9.938838] ---[ end trace 026e20e7bf6738e2 ]--- > [ 9.943497] ------------[ cut here ]------------ > [ 9.948142] WARNING: at lib/kobject.c:196 kobject_add_internal+0x17c/0x1e4() > [ 9.955238] kobject_add_internal failed for mv643xx_eth_port.0 with -EEXIST, don't try to register things with the same name in the same directory. > [ 9.968521] Modules linked in: > [ 9.971611] CPU: 0 PID: 1 Comm: swapper Tainted: G W 3.10.0 #12 > [ 9.978423] Backtrace: > [ 9.980907] [] (dump_backtrace+0x0/0x114) from [] (show_stack+0x18/0x1c) > [ 9.989377] r6:000000c4 r5:c02dd9d8 r4:c782fc60 r3:00000000 > [ 9.995120] [] (show_stack+0x0/0x1c) from [] (dump_stack+0x20/0x28) > [ 10.003181] [] (dump_stack+0x0/0x28) from [] (warn_slowpath_common+0x58/0x74) > [ 10.012118] [] (warn_slowpath_common+0x0/0x74) from [] (warn_slowpath_fmt+0x38/0x40) > [ 10.021654] r8:c07ae3a8 r7:c07ae3b0 r6:c07ae3b0 r5:c78c64d8 r4:c782fc84 > r3:00000009 > [ 10.029582] [] (warn_slowpath_fmt+0x0/0x40) from [] (kobject_add_internal+0x17c/0x1e4) > [ 10.039287] r3:c02dd9c0 r2:c02ddb40 > [ 10.042911] r4:c78c64d8 > [ 10.045470] [] (kobject_add_internal+0x0/0x1e4) from [] (kobject_add+0x80/0x98) > [ 10.054578] [] (kobject_add+0x0/0x98) from [] (device_add+0xd8/0x54c) > [ 10.062804] r3:00000000 r2:00000000 > [ 10.066411] r6:00000000 r5:c78c64d0 r4:c78c64c0 > [ 10.071098] [] (device_add+0x0/0x54c) from [] (platform_device_add+0x14c/0x1e0) > [ 10.080207] [] (platform_device_add+0x0/0x1e0) from [] (mv643xx_eth_shared_of_add_port+0x240/0x2a8) > [ 10.091049] r8:00000e00 r7:c73b1b70 r6:0000003e r5:00000000 r4:c78c64c0 > r3:00000000 > [ 10.098977] [] (mv643xx_eth_shared_of_add_port+0x0/0x2a8) from [] (mv643xx_eth_shared_probe+0x22c/0x318) > [ 10.110252] r5:c08ea74c r4:c08ea89c > [ 10.113870] [] (mv643xx_eth_shared_probe+0x0/0x318) from [] (platform_drv_probe+0x1c/0x20) > [ 10.123938] [] (platform_drv_probe+0x0/0x20) from [] (driver_probe_device+0xe4/0x210) > [ 10.133571] [] (driver_probe_device+0x0/0x210) from [] (__driver_attach+0x68/0x8c) > [ 10.142932] r7:00000000 r6:c07b3f64 r5:c785bdb0 r4:c785bde4 > [ 10.148662] [] (__driver_attach+0x0/0x8c) from [] (bus_for_each_dev+0x58/0x90) > [ 10.157670] r6:c07b3f64 r5:c0161f24 r4:00000000 r3:00000002 > [ 10.163409] [] (bus_for_each_dev+0x0/0x90) from [] (driver_attach+0x20/0x28) > [ 10.172241] r6:c07ae368 r5:c07b3f64 r4:c73ad4a0 > [ 10.176914] [] (driver_attach+0x0/0x28) from [] (bus_add_driver+0xb8/0x21c) > [ 10.185674] [] (bus_add_driver+0x0/0x21c) from [] (driver_register+0xa8/0x138) > [ 10.194686] r8:0000003e r7:00000000 r6:c07b3f64 r5:c033dd5c r4:c034200c > [ 10.201497] [] (driver_register+0x0/0x138) from [] (platform_driver_register+0x4c/0x60) > [ 10.211301] [] (platform_driver_register+0x0/0x60) from [] (mv643xx_eth_init_module+0x14/0x44) > [ 10.221720] [] (mv643xx_eth_init_module+0x0/0x44) from [] (do_one_initcall+0x9c/0x15c) > [ 10.231422] r4:c034200c r3:00000000 > [ 10.235042] [] (do_one_initcall+0x0/0x15c) from [] (kernel_init_freeable+0xf8/0x1c4) > [ 10.244588] [] (kernel_init_freeable+0x0/0x1c4) from [] (kernel_init+0x10/0x104) > [ 10.253784] [] (kernel_init+0x0/0x104) from [] (ret_from_fork+0x14/0x24) > [ 10.262274] r4:00000000 r3:00000000 > [ 10.265882] ---[ end trace 026e20e7bf6738e3 ]--- > [ 10.270553] mv643xx_eth: probe of f1076000.ethernet-controller failed with error -17 > > > > Regards > Jonas -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/