* [PATCH for 3.14] ARM: at91: fix network interface ordering for sama5d36
@ 2014-03-10 14:37 Nicolas Ferre
2014-03-11 19:49 ` Olof Johansson
2014-03-11 20:56 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Ferre @ 2014-03-10 14:37 UTC (permalink / raw)
To: linux-arm-kernel, Olof Johansson, Arnd Bergmann, ARM Maintainers
Cc: linux-kernel, Boris BREZILLON, Boris BREZILLON, Nicolas Ferre
From: Boris BREZILLON <b.brezillon.dev@gmail.com>
On the newly introduced sama5d36, Gigabit and 10/100 Ethernet network
interfaces are probed in a different order than for the sama5d35.
Moreover, users are accustomed to this order in bootloaders and backports
for older kernel revisions.
So this patch switches DT node order as it is done for the other dual-Ethernet
sama5d3 SoC.
Better interface numbering which does not depend on DT node order is being
developed for stronger interface identification.
Signed-off-by: Boris BREZILLON <b.brezillon.dev@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
Olof, Arnd and Kevin,
I would like to include this fix in 3.14-final.
I do not have anymore patch for an at91-3.14-fixes branch so I only send this
single patch to you. Can you still take it?
Thanks, best regards,
arch/arm/boot/dts/sama5d36.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/sama5d36.dtsi b/arch/arm/boot/dts/sama5d36.dtsi
index 6c31c26e6cc0..db58cad6acd3 100644
--- a/arch/arm/boot/dts/sama5d36.dtsi
+++ b/arch/arm/boot/dts/sama5d36.dtsi
@@ -8,8 +8,8 @@
*/
#include "sama5d3.dtsi"
#include "sama5d3_can.dtsi"
-#include "sama5d3_emac.dtsi"
#include "sama5d3_gmac.dtsi"
+#include "sama5d3_emac.dtsi"
#include "sama5d3_lcd.dtsi"
#include "sama5d3_mci2.dtsi"
#include "sama5d3_tcb1.dtsi"
--
1.8.2.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH for 3.14] ARM: at91: fix network interface ordering for sama5d36
2014-03-10 14:37 [PATCH for 3.14] ARM: at91: fix network interface ordering for sama5d36 Nicolas Ferre
@ 2014-03-11 19:49 ` Olof Johansson
2014-03-11 20:56 ` Jean-Christophe PLAGNIOL-VILLARD
1 sibling, 0 replies; 8+ messages in thread
From: Olof Johansson @ 2014-03-11 19:49 UTC (permalink / raw)
To: Nicolas Ferre
Cc: linux-arm-kernel, Arnd Bergmann, ARM Maintainers, linux-kernel,
Boris BREZILLON, Boris BREZILLON
On Mon, Mar 10, 2014 at 03:37:18PM +0100, Nicolas Ferre wrote:
> From: Boris BREZILLON <b.brezillon.dev@gmail.com>
>
> On the newly introduced sama5d36, Gigabit and 10/100 Ethernet network
> interfaces are probed in a different order than for the sama5d35.
> Moreover, users are accustomed to this order in bootloaders and backports
> for older kernel revisions.
> So this patch switches DT node order as it is done for the other dual-Ethernet
> sama5d3 SoC.
> Better interface numbering which does not depend on DT node order is being
> developed for stronger interface identification.
>
> Signed-off-by: Boris BREZILLON <b.brezillon.dev@gmail.com>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> Olof, Arnd and Kevin,
>
> I would like to include this fix in 3.14-final.
> I do not have anymore patch for an at91-3.14-fixes branch so I only send this
> single patch to you. Can you still take it?
Sure, applied now.
-Olof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH for 3.14] ARM: at91: fix network interface ordering for sama5d36
2014-03-10 14:37 [PATCH for 3.14] ARM: at91: fix network interface ordering for sama5d36 Nicolas Ferre
2014-03-11 19:49 ` Olof Johansson
@ 2014-03-11 20:56 ` Jean-Christophe PLAGNIOL-VILLARD
2014-03-12 7:59 ` Nicolas Ferre
1 sibling, 1 reply; 8+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-03-11 20:56 UTC (permalink / raw)
To: Nicolas FERRE
Cc: Jean-Christophe PLAGNIOL-VILLARD,
<linux-arm-kernel@lists.infradead.org> mailing list,
Olof Johansson, Arnd Bergmann, ARM Maintainers, Boris BREZILLON,
Linux Kernel list, Boris BREZILLON
On Mar 10, 2014, at 10:37 PM, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
> From: Boris BREZILLON <b.brezillon.dev@gmail.com>
>
> On the newly introduced sama5d36, Gigabit and 10/100 Ethernet network
> interfaces are probed in a different order than for the sama5d35.
> Moreover, users are accustomed to this order in bootloaders and backports
> for older kernel revisions.
> So this patch switches DT node order as it is done for the other dual-Ethernet
> sama5d3 SoC.
> Better interface numbering which does not depend on DT node order is being
> developed for stronger interface identification.
twick ethernet enumerating by playing on the DT order is week
It’s better to introduce a new property
linux,ethernet-id or something like or simply rely on other information on the userspace to identify the
proper interface
Nicolas for AT91 keep me in Cc
Best Regards,
J.
>
> Signed-off-by: Boris BREZILLON <b.brezillon.dev@gmail.com>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> Olof, Arnd and Kevin,
>
> I would like to include this fix in 3.14-final.
> I do not have anymore patch for an at91-3.14-fixes branch so I only send this
> single patch to you. Can you still take it?
>
> Thanks, best regards,
>
> arch/arm/boot/dts/sama5d36.dtsi | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/boot/dts/sama5d36.dtsi b/arch/arm/boot/dts/sama5d36.dtsi
> index 6c31c26e6cc0..db58cad6acd3 100644
> --- a/arch/arm/boot/dts/sama5d36.dtsi
> +++ b/arch/arm/boot/dts/sama5d36.dtsi
> @@ -8,8 +8,8 @@
> */
> #include "sama5d3.dtsi"
> #include "sama5d3_can.dtsi"
> -#include "sama5d3_emac.dtsi"
> #include "sama5d3_gmac.dtsi"
> +#include "sama5d3_emac.dtsi"
> #include "sama5d3_lcd.dtsi"
> #include "sama5d3_mci2.dtsi"
> #include "sama5d3_tcb1.dtsi"
> --
> 1.8.2.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH for 3.14] ARM: at91: fix network interface ordering for sama5d36
2014-03-11 20:56 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2014-03-12 7:59 ` Nicolas Ferre
2014-03-12 10:30 ` [PATCH] net: macb: set interface name based on DT aliases Boris BREZILLON
0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Ferre @ 2014-03-12 7:59 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: <linux-arm-kernel@lists.infradead.org> mailing list,
Olof Johansson, Arnd Bergmann, ARM Maintainers, Boris BREZILLON,
Linux Kernel list, Boris BREZILLON
On 11/03/2014 21:56, Jean-Christophe PLAGNIOL-VILLARD :
>
> On Mar 10, 2014, at 10:37 PM, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
>
>> From: Boris BREZILLON <b.brezillon.dev@gmail.com>
>>
>> On the newly introduced sama5d36, Gigabit and 10/100 Ethernet network
>> interfaces are probed in a different order than for the sama5d35.
>> Moreover, users are accustomed to this order in bootloaders and backports
>> for older kernel revisions.
>> So this patch switches DT node order as it is done for the other dual-Ethernet
>> sama5d3 SoC.
>> Better interface numbering which does not depend on DT node order is being
>> developed for stronger interface identification.
>
> twick ethernet enumerating by playing on the DT order is week
Absolutely, that is what I said in the commit message.
> It’s better to introduce a new property
>
> linux,ethernet-id or something like or simply rely on other information on the userspace to identify the
> proper interface
We will rely on the alias number ; It's its purpose, after all. I think
that Boris already have a preliminary patch for the macb driver.
Bye,
> Nicolas for AT91 keep me in Cc
>
> Best Regards,
> J.
>>
>> Signed-off-by: Boris BREZILLON <b.brezillon.dev@gmail.com>
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>> ---
>> Olof, Arnd and Kevin,
>>
>> I would like to include this fix in 3.14-final.
>> I do not have anymore patch for an at91-3.14-fixes branch so I only send this
>> single patch to you. Can you still take it?
>>
>> Thanks, best regards,
>>
>> arch/arm/boot/dts/sama5d36.dtsi | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/boot/dts/sama5d36.dtsi b/arch/arm/boot/dts/sama5d36.dtsi
>> index 6c31c26e6cc0..db58cad6acd3 100644
>> --- a/arch/arm/boot/dts/sama5d36.dtsi
>> +++ b/arch/arm/boot/dts/sama5d36.dtsi
>> @@ -8,8 +8,8 @@
>> */
>> #include "sama5d3.dtsi"
>> #include "sama5d3_can.dtsi"
>> -#include "sama5d3_emac.dtsi"
>> #include "sama5d3_gmac.dtsi"
>> +#include "sama5d3_emac.dtsi"
>> #include "sama5d3_lcd.dtsi"
>> #include "sama5d3_mci2.dtsi"
>> #include "sama5d3_tcb1.dtsi"
>> --
>> 1.8.2.2
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] net: macb: set interface name based on DT aliases
2014-03-12 7:59 ` Nicolas Ferre
@ 2014-03-12 10:30 ` Boris BREZILLON
0 siblings, 0 replies; 8+ messages in thread
From: Boris BREZILLON @ 2014-03-12 10:30 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD, Nicolas Ferre
Cc: Olof Johansson, Arnd Bergmann, linux-arm-kernel, arm,
linux-kernel, Boris BREZILLON
Use aliases to set the interface name (ethX) instead of automatic
assignement.
Signed-off-by: Boris BREZILLON <b.brezillon.dev@gmail.com>
---
Hello Nicolas, Jean-Christophe,
This is an example on how we could set the ethernet interface id based on DT
aliases.
As you can see this patch is not properly separated.
I'm still not happy with this approach for several reasons:
1) If another ethernet iface has already been registered with the same id the
net dev registration will fail.
2) We bypass the ethernet macros/functions and directly use the net device
functions which IMHO is not future proof.
Best Regards,
Boris
arch/arm/boot/dts/sama5d36.dtsi | 2 +-
arch/arm/boot/dts/sama5d3_emac.dtsi | 4 ++++
arch/arm/boot/dts/sama5d3_gmac.dtsi | 4 ++++
drivers/net/ethernet/cadence/macb.c | 15 +++++++++++++--
4 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/sama5d36.dtsi b/arch/arm/boot/dts/sama5d36.dtsi
index 6c31c26..db58cad 100644
--- a/arch/arm/boot/dts/sama5d36.dtsi
+++ b/arch/arm/boot/dts/sama5d36.dtsi
@@ -8,8 +8,8 @@
*/
#include "sama5d3.dtsi"
#include "sama5d3_can.dtsi"
-#include "sama5d3_emac.dtsi"
#include "sama5d3_gmac.dtsi"
+#include "sama5d3_emac.dtsi"
#include "sama5d3_lcd.dtsi"
#include "sama5d3_mci2.dtsi"
#include "sama5d3_tcb1.dtsi"
diff --git a/arch/arm/boot/dts/sama5d3_emac.dtsi b/arch/arm/boot/dts/sama5d3_emac.dtsi
index fe2af92..f2c5da0 100644
--- a/arch/arm/boot/dts/sama5d3_emac.dtsi
+++ b/arch/arm/boot/dts/sama5d3_emac.dtsi
@@ -11,6 +11,10 @@
#include <dt-bindings/interrupt-controller/irq.h>
/ {
+ aliases {
+ eth1 = &macb1;
+ };
+
ahb {
apb {
pinctrl@fffff200 {
diff --git a/arch/arm/boot/dts/sama5d3_gmac.dtsi b/arch/arm/boot/dts/sama5d3_gmac.dtsi
index a6cb050..05164de 100644
--- a/arch/arm/boot/dts/sama5d3_gmac.dtsi
+++ b/arch/arm/boot/dts/sama5d3_gmac.dtsi
@@ -11,6 +11,10 @@
#include <dt-bindings/interrupt-controller/irq.h>
/ {
+ aliases {
+ eth0 = &macb0;
+ };
+
ahb {
apb {
pinctrl@fffff200 {
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 3190d38..b6f1f7c 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1795,7 +1795,7 @@ static int __init macb_probe(struct platform_device *pdev)
{
struct macb_platform_data *pdata;
struct resource *regs;
- struct net_device *dev;
+ struct net_device *dev = NULL;
struct macb *bp;
struct phy_device *phydev;
u32 config;
@@ -1819,7 +1819,18 @@ static int __init macb_probe(struct platform_device *pdev)
}
err = -ENOMEM;
- dev = alloc_etherdev(sizeof(*bp));
+ if (pdev->dev.of_node) {
+ int id = of_alias_get_id(pdev->dev.of_node, "eth");
+ if (id >= 0) {
+ char name[IFNAMSIZ];
+ snprintf(name, sizeof(name), "eth%d", id);
+ dev = alloc_netdev(sizeof(*bp), name, ether_setup);
+ }
+ }
+
+ if (!dev)
+ dev = alloc_etherdev(sizeof(*bp));
+
if (!dev)
goto err_out;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] net: macb: set interface name based on DT aliases
@ 2014-03-12 10:29 Boris BREZILLON
2014-05-05 20:40 ` Olof Johansson
0 siblings, 1 reply; 8+ messages in thread
From: Boris BREZILLON @ 2014-03-12 10:29 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD, Nicolas Ferre
Cc: Olof Johansson, Arnd Bergmann, linux-arm-kernel, arm,
linux-kernel, Boris BREZILLON
Use aliases to set the interface name (ethX) instead of automatic
assignement.
Signed-off-by: Boris BREZILLON <b.brezillon.dev@gmail.com>
---
Hello Nicolas, Jean-Christophe,
This is an example on how we could set the ethernet interface id based on DT
aliases.
As you can see this patch is not properly separated.
I'm still not happy with this approach for several reasons:
1) If another ethernet iface has already been registered with the same id the
net dev registration will fail.
2) We bypass the ethernet macros/functions and directly use the net device
functions which IMHO is not future proof.
Best Regards,
Boris
arch/arm/boot/dts/sama5d36.dtsi | 2 +-
arch/arm/boot/dts/sama5d3_emac.dtsi | 4 ++++
arch/arm/boot/dts/sama5d3_gmac.dtsi | 4 ++++
drivers/net/ethernet/cadence/macb.c | 15 +++++++++++++--
4 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/sama5d36.dtsi b/arch/arm/boot/dts/sama5d36.dtsi
index 6c31c26..db58cad 100644
--- a/arch/arm/boot/dts/sama5d36.dtsi
+++ b/arch/arm/boot/dts/sama5d36.dtsi
@@ -8,8 +8,8 @@
*/
#include "sama5d3.dtsi"
#include "sama5d3_can.dtsi"
-#include "sama5d3_emac.dtsi"
#include "sama5d3_gmac.dtsi"
+#include "sama5d3_emac.dtsi"
#include "sama5d3_lcd.dtsi"
#include "sama5d3_mci2.dtsi"
#include "sama5d3_tcb1.dtsi"
diff --git a/arch/arm/boot/dts/sama5d3_emac.dtsi b/arch/arm/boot/dts/sama5d3_emac.dtsi
index fe2af92..f2c5da0 100644
--- a/arch/arm/boot/dts/sama5d3_emac.dtsi
+++ b/arch/arm/boot/dts/sama5d3_emac.dtsi
@@ -11,6 +11,10 @@
#include <dt-bindings/interrupt-controller/irq.h>
/ {
+ aliases {
+ eth1 = &macb1;
+ };
+
ahb {
apb {
pinctrl@fffff200 {
diff --git a/arch/arm/boot/dts/sama5d3_gmac.dtsi b/arch/arm/boot/dts/sama5d3_gmac.dtsi
index a6cb050..05164de 100644
--- a/arch/arm/boot/dts/sama5d3_gmac.dtsi
+++ b/arch/arm/boot/dts/sama5d3_gmac.dtsi
@@ -11,6 +11,10 @@
#include <dt-bindings/interrupt-controller/irq.h>
/ {
+ aliases {
+ eth0 = &macb0;
+ };
+
ahb {
apb {
pinctrl@fffff200 {
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 3190d38..b6f1f7c 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1795,7 +1795,7 @@ static int __init macb_probe(struct platform_device *pdev)
{
struct macb_platform_data *pdata;
struct resource *regs;
- struct net_device *dev;
+ struct net_device *dev = NULL;
struct macb *bp;
struct phy_device *phydev;
u32 config;
@@ -1819,7 +1819,18 @@ static int __init macb_probe(struct platform_device *pdev)
}
err = -ENOMEM;
- dev = alloc_etherdev(sizeof(*bp));
+ if (pdev->dev.of_node) {
+ int id = of_alias_get_id(pdev->dev.of_node, "eth");
+ if (id >= 0) {
+ char name[IFNAMSIZ];
+ snprintf(name, sizeof(name), "eth%d", id);
+ dev = alloc_netdev(sizeof(*bp), name, ether_setup);
+ }
+ }
+
+ if (!dev)
+ dev = alloc_etherdev(sizeof(*bp));
+
if (!dev)
goto err_out;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] net: macb: set interface name based on DT aliases
2014-03-12 10:29 Boris BREZILLON
@ 2014-05-05 20:40 ` Olof Johansson
2014-05-06 15:17 ` Boris BREZILLON
0 siblings, 1 reply; 8+ messages in thread
From: Olof Johansson @ 2014-05-05 20:40 UTC (permalink / raw)
To: Boris BREZILLON
Cc: Jean-Christophe PLAGNIOL-VILLARD, Nicolas Ferre, Arnd Bergmann,
linux-arm-kernel, arm, linux-kernel, Boris BREZILLON
On Wed, Mar 12, 2014 at 11:29:56AM +0100, Boris BREZILLON wrote:
> Use aliases to set the interface name (ethX) instead of automatic
> assignement.
>
> Signed-off-by: Boris BREZILLON <b.brezillon.dev@gmail.com>
> ---
>
> Hello Nicolas, Jean-Christophe,
>
> This is an example on how we could set the ethernet interface id based on DT
> aliases.
> As you can see this patch is not properly separated.
>
> I'm still not happy with this approach for several reasons:
> 1) If another ethernet iface has already been registered with the same id the
> net dev registration will fail.
> 2) We bypass the ethernet macros/functions and directly use the net device
> functions which IMHO is not future proof.
[Sorry for the late reply, going through old backlog of unread email]
Looks like this should live in networking core instead of in the driver, it's
how we handle it in other subsystems.
I don't know what DaveM's opinions on that is though.
-Olof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] net: macb: set interface name based on DT aliases
2014-05-05 20:40 ` Olof Johansson
@ 2014-05-06 15:17 ` Boris BREZILLON
0 siblings, 0 replies; 8+ messages in thread
From: Boris BREZILLON @ 2014-05-06 15:17 UTC (permalink / raw)
To: Olof Johansson, Boris BREZILLON
Cc: Jean-Christophe PLAGNIOL-VILLARD, Nicolas Ferre, Arnd Bergmann,
linux-arm-kernel, arm, linux-kernel
Hi Olof,
On 05/05/2014 22:40, Olof Johansson wrote:
> On Wed, Mar 12, 2014 at 11:29:56AM +0100, Boris BREZILLON wrote:
>> Use aliases to set the interface name (ethX) instead of automatic
>> assignement.
>>
>> Signed-off-by: Boris BREZILLON <b.brezillon.dev@gmail.com>
>> ---
>>
>> Hello Nicolas, Jean-Christophe,
>>
>> This is an example on how we could set the ethernet interface id based on DT
>> aliases.
>> As you can see this patch is not properly separated.
>>
>> I'm still not happy with this approach for several reasons:
>> 1) If another ethernet iface has already been registered with the same id the
>> net dev registration will fail.
>> 2) We bypass the ethernet macros/functions and directly use the net device
>> functions which IMHO is not future proof.
> [Sorry for the late reply, going through old backlog of unread email]
>
> Looks like this should live in networking core instead of in the driver, it's
> how we handle it in other subsystems.
Sure.
This version was just a quick an dirty hack, but I'll send a new version
integrating this functionality in netdev core.
> I don't know what DaveM's opinions on that is though.
I'll put him in Cc of the next version.
Best Regards,
Boris
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-05-06 15:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-10 14:37 [PATCH for 3.14] ARM: at91: fix network interface ordering for sama5d36 Nicolas Ferre
2014-03-11 19:49 ` Olof Johansson
2014-03-11 20:56 ` Jean-Christophe PLAGNIOL-VILLARD
2014-03-12 7:59 ` Nicolas Ferre
2014-03-12 10:30 ` [PATCH] net: macb: set interface name based on DT aliases Boris BREZILLON
2014-03-12 10:29 Boris BREZILLON
2014-05-05 20:40 ` Olof Johansson
2014-05-06 15:17 ` Boris BREZILLON
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).