* [Xenomai] RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
@ 2018-08-16 13:23 Stéphane Reichert
2018-08-17 8:27 ` Philippe Gerum
0 siblings, 1 reply; 9+ messages in thread
From: Stéphane Reichert @ 2018-08-16 13:23 UTC (permalink / raw)
To: xenomai
Hello,
We are trying to use the rt_fec driver for RTNet on a iMX6Q board.
I have patched the KConfig to add this driver on buildroot and it compiles
perfectly.
But now, I am not able to use it on our board (it works when I rtping
the loopback,
but it doesnt work if I try to ping an external board).
Each time I try to use the device, the rt_ping command returns
ioctl: Resource temporarily unavailable.
The same occurs if I try with or without tdma.
To reproduce the problem, here is the initialization sequence:
# modprobe rtnet
# modprobe rtipv4
# modprobe rt_fec
# echo 2188000.ethernet > /sys/bus/platform/drivers/fec/unbind
# echo 2188000.ethernet > /sys/bus/platform/drivers/rt_fec/bind
# modprobe rtudp
# modprobe rtpacket
# rtifconfig rteth0 up 192.168.214.30 netmask 255.255.0.0 hw ether
00:07:AC:81:0
# rtifconfig
rteth0 Medium: Ethernet Hardware address: 00:07:AC:81:00:5D
IP address: 192.168.214.30 Broadcast address: 192.168.255.255
UP BROADCAST MTU: 1500
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
# rtroute add 192.168.214.250 00:50:56:a2:d2:b6 dev rteth0
# rtroute
Host Routing Table
Hash Destination HW Address Device
3A 192.168.214.250 00:50:56:A2:D2:B6 rteth0
3F 192.168.255.255 FF:FF:FF:FF:FF:FF rteth0
Network Routing Table
Hash Destination Mask Gateway
# rtping 192.168.214.250
Real-time PING 192.168.214.250 56(84) bytes of data.
ioctl: Resource temporarily unavailable
Linux : 4.1.46
Xenomai : 3.0.7
Did anyone face this problem (I found some similary issues, but they
didnt solve my problem on rt_fec) ?
Stéphane
Sepro
Stéphane REICHERT
_____
<http://www.sepro-group.com/fr> www.sepro-group.com |
<https://twitter.com/seprogroup> twitter@SeproGroup
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 26078 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180816/c9b84399/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 818 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180816/c9b84399/attachment.png>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xenomai] RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
2018-08-16 13:23 [Xenomai] RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7) Stéphane Reichert
@ 2018-08-17 8:27 ` Philippe Gerum
2018-08-17 11:39 ` [Xenomai] TR: " Stéphane Reichert
2018-08-17 11:39 ` Stéphane Reichert
0 siblings, 2 replies; 9+ messages in thread
From: Philippe Gerum @ 2018-08-17 8:27 UTC (permalink / raw)
To: Stéphane Reichert, xenomai
On 08/16/2018 03:23 PM, Stéphane Reichert wrote:
> Hello,
>
>
>
> We are trying to use the rt_fec driver for RTNet on a iMX6Q board.
>
>
>
> I have patched the KConfig to add this driver on buildroot and it compiles
> perfectly.
>
>
>
> But now, I am not able to use it on our board (it works when I rtping
> the loopback,
>
> but it doesnt work if I try to ping an external board).
The fec driver does not seem to tell the stack about the carrier enable
state. If so, you may want to try the following patch:
diff --git a/kernel/drivers/net/drivers/fec.c
b/kernel/drivers/net/drivers/fec.c
index 36870ba16..d94ec690f 100644
--- a/kernel/drivers/net/drivers/fec.c
+++ b/kernel/drivers/net/drivers/fec.c
@@ -1323,6 +1323,7 @@ fec_enet_open(struct rtnet_device *ndev)
return ret;
}
phy_start(fep->phy_dev);
+ rtnetif_carrier_on(ndev);
rtnetif_start_queue(ndev);
fep->opened = 1;
return 0;
--
Philippe.
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Xenomai] TR: RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
2018-08-17 8:27 ` Philippe Gerum
@ 2018-08-17 11:39 ` Stéphane Reichert
2018-08-17 11:39 ` Stéphane Reichert
1 sibling, 0 replies; 9+ messages in thread
From: Stéphane Reichert @ 2018-08-17 11:39 UTC (permalink / raw)
To: xenomai
Thanks Philippe,
I tried this patch and now I can see the rteth0 RUNNING (in rtifconfig).
Unfortunately, it doesn't change the rtping behavior (I still get the
“ioctl: Resource temporarily unavailable” message).
Best regards
Stéphane
-----Message d'origine-----
De : Philippe Gerum [mailto:rpm@xenomai.org] Envoyé : vendredi 17 août 2018
10:28 À : Stéphane Reichert; xenomai@xenomai.org Objet : Re: [Xenomai]
RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
On 08/16/2018 03:23 PM, Stéphane Reichert wrote:
> Hello,
>
>
>
> We are trying to use the rt_fec driver for RTNet on a iMX6Q board.
>
>
>
> I have patched the KConfig to add this driver on buildroot and it
> compiles perfectly.
>
>
>
> But now, I am not able to use it on our board (it works when I “rtping”
> the loopback,
>
> but it doesn’t work if I try to ping an external board).
The fec driver does not seem to tell the stack about the carrier enable
state. If so, you may want to try the following patch:
diff --git a/kernel/drivers/net/drivers/fec.c
b/kernel/drivers/net/drivers/fec.c
index 36870ba16..d94ec690f 100644
--- a/kernel/drivers/net/drivers/fec.c
+++ b/kernel/drivers/net/drivers/fec.c
@@ -1323,6 +1323,7 @@ fec_enet_open(struct rtnet_device *ndev)
return ret;
}
phy_start(fep->phy_dev);
+ rtnetif_carrier_on(ndev);
rtnetif_start_queue(ndev);
fep->opened = 1;
return 0;
--
Philippe.
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Xenomai] TR: RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
2018-08-17 8:27 ` Philippe Gerum
2018-08-17 11:39 ` [Xenomai] TR: " Stéphane Reichert
@ 2018-08-17 11:39 ` Stéphane Reichert
2018-08-21 21:19 ` Edouard Tisserant
1 sibling, 1 reply; 9+ messages in thread
From: Stéphane Reichert @ 2018-08-17 11:39 UTC (permalink / raw)
To: xenomai
Hello Philippe,
I have noticed in the file fec.c that the function fec_enet_ioctl did not
match the prototype of do_ioctl (it looks like "request" and "arg"
parameters are switched). Is it a mistake ?
(I tried to switch these parameters but it didn't solved my problem as
well).
Stephane
-----Message d'origine-----
De : Philippe Gerum [mailto:rpm@xenomai.org] Envoyé : vendredi 17 août 2018
10:28 À : Stéphane Reichert; xenomai@xenomai.org Objet : Re: [Xenomai]
RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
On 08/16/2018 03:23 PM, Stéphane Reichert wrote:
> Hello,
>
>
>
> We are trying to use the rt_fec driver for RTNet on a iMX6Q board.
>
>
>
> I have patched the KConfig to add this driver on buildroot and it
> compiles perfectly.
>
>
>
> But now, I am not able to use it on our board (it works when I “rtping”
> the loopback,
>
> but it doesn’t work if I try to ping an external board).
The fec driver does not seem to tell the stack about the carrier enable
state. If so, you may want to try the following patch:
diff --git a/kernel/drivers/net/drivers/fec.c
b/kernel/drivers/net/drivers/fec.c
index 36870ba16..d94ec690f 100644
--- a/kernel/drivers/net/drivers/fec.c
+++ b/kernel/drivers/net/drivers/fec.c
@@ -1323,6 +1323,7 @@ fec_enet_open(struct rtnet_device *ndev)
return ret;
}
phy_start(fep->phy_dev);
+ rtnetif_carrier_on(ndev);
rtnetif_start_queue(ndev);
fep->opened = 1;
return 0;
--
Philippe.
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Xenomai] TR: RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
2018-08-17 11:39 ` Stéphane Reichert
@ 2018-08-21 21:19 ` Edouard Tisserant
2018-08-22 8:24 ` Stéphane Reichert
0 siblings, 1 reply; 9+ messages in thread
From: Edouard Tisserant @ 2018-08-21 21:19 UTC (permalink / raw)
To: Stéphane Reichert, xenomai
Hello Stéphane.
I'm porting EtherLAB to Xenomai3 on Imx6, using RTNet instead of
EtherLAB provided drivers.
This is still work in progress, but the fec.c patch I have now may help.
Find it attached.
I built it last time on kernel 4.9.51 and xenomai 3.0.6. This is largely
untested, your feedback is welcome.
Beware content of DTS for vanilla FEC from kernel 4.x may not be
compatible anymore with the one expected by FEC from RTnet. You may have
to patch you DTS accordingly.
Best regards,
Edouard
On 17/08/2018 13:39, Stéphane Reichert wrote:
> Hello Philippe,
>
> I have noticed in the file fec.c that the function fec_enet_ioctl did not
> match the prototype of do_ioctl (it looks like "request" and "arg"
> parameters are switched). Is it a mistake ?
>
> (I tried to switch these parameters but it didn't solved my problem as
> well).
>
> Stephane
>
>
> -----Message d'origine-----
> De : Philippe Gerum [mailto:rpm@xenomai.org] Envoyé : vendredi 17 août 2018
> 10:28 À : Stéphane Reichert; xenomai@xenomai.org Objet : Re: [Xenomai]
> RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
>
> On 08/16/2018 03:23 PM, Stéphane Reichert wrote:
>> Hello,
>>
>>
>>
>> We are trying to use the rt_fec driver for RTNet on a iMX6Q board.
>>
>>
>>
>> I have patched the KConfig to add this driver on buildroot and it
>> compiles perfectly.
>>
>>
>>
>> But now, I am not able to use it on our board (it works when I “rtping”
>> the loopback,
>>
>> but it doesn’t work if I try to ping an external board).
> The fec driver does not seem to tell the stack about the carrier enable
> state. If so, you may want to try the following patch:
>
> diff --git a/kernel/drivers/net/drivers/fec.c
> b/kernel/drivers/net/drivers/fec.c
> index 36870ba16..d94ec690f 100644
> --- a/kernel/drivers/net/drivers/fec.c
> +++ b/kernel/drivers/net/drivers/fec.c
> @@ -1323,6 +1323,7 @@ fec_enet_open(struct rtnet_device *ndev)
> return ret;
> }
> phy_start(fep->phy_dev);
> + rtnetif_carrier_on(ndev);
> rtnetif_start_queue(ndev);
> fep->opened = 1;
> return 0;
>
> --
> Philippe.
>
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-xenomai-enable-FEC.patch
Type: text/x-patch
Size: 575 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180821/3c0b340c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-xenomai_fix_FEC.patch
Type: text/x-patch
Size: 3214 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180821/3c0b340c/attachment-0001.bin>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xenomai] TR: RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
2018-08-21 21:19 ` Edouard Tisserant
@ 2018-08-22 8:24 ` Stéphane Reichert
2018-08-23 21:09 ` Edouard Tisserant
0 siblings, 1 reply; 9+ messages in thread
From: Stéphane Reichert @ 2018-08-22 8:24 UTC (permalink / raw)
To: Edouard Tisserant, xenomai
Hello Edouard,
Thanks again for your patch.
I tried it on my kernel, but unfortunately I am facing the same issue
(ioctl: Resource temporarily unavailable error message on rtping).
Best regards
Stéphane
-----Message d'origine-----
De : Edouard Tisserant [mailto:edouard.tisserant@gmail.com]
Envoyé : mardi 21 août 2018 23:19
À : Stéphane Reichert; xenomai@xenomai.org
Objet : Re: [Xenomai] TR: RTNet - how to setup rt_fec on IMX6Q (Xenomai
3.0.7)
Hello Stéphane.
I'm porting EtherLAB to Xenomai3 on Imx6, using RTNet instead of EtherLAB
provided drivers.
This is still work in progress, but the fec.c patch I have now may help.
Find it attached.
I built it last time on kernel 4.9.51 and xenomai 3.0.6. This is largely
untested, your feedback is welcome.
Beware content of DTS for vanilla FEC from kernel 4.x may not be compatible
anymore with the one expected by FEC from RTnet. You may have to patch you
DTS accordingly.
Best regards,
Edouard
On 17/08/2018 13:39, Stéphane Reichert wrote:
> Hello Philippe,
>
> I have noticed in the file fec.c that the function fec_enet_ioctl did
> not match the prototype of do_ioctl (it looks like "request" and "arg"
> parameters are switched). Is it a mistake ?
>
> (I tried to switch these parameters but it didn't solved my problem as
> well).
>
> Stephane
>
>
> -----Message d'origine-----
> De : Philippe Gerum [mailto:rpm@xenomai.org] Envoyé : vendredi 17 août
> 2018
> 10:28 À : Stéphane Reichert; xenomai@xenomai.org Objet : Re: [Xenomai]
> RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
>
> On 08/16/2018 03:23 PM, Stéphane Reichert wrote:
>> Hello,
>>
>>
>>
>> We are trying to use the rt_fec driver for RTNet on a iMX6Q board.
>>
>>
>>
>> I have patched the KConfig to add this driver on buildroot and it
>> compiles perfectly.
>>
>>
>>
>> But now, I am not able to use it on our board (it works when I “rtping”
>> the loopback,
>>
>> but it doesn’t work if I try to ping an external board).
> The fec driver does not seem to tell the stack about the carrier
> enable state. If so, you may want to try the following patch:
>
> diff --git a/kernel/drivers/net/drivers/fec.c
> b/kernel/drivers/net/drivers/fec.c
> index 36870ba16..d94ec690f 100644
> --- a/kernel/drivers/net/drivers/fec.c
> +++ b/kernel/drivers/net/drivers/fec.c
> @@ -1323,6 +1323,7 @@ fec_enet_open(struct rtnet_device *ndev)
> return ret;
> }
> phy_start(fep->phy_dev);
> + rtnetif_carrier_on(ndev);
> rtnetif_start_queue(ndev);
> fep->opened = 1;
> return 0;
>
> --
> Philippe.
>
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xenomai] TR: RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
2018-08-22 8:24 ` Stéphane Reichert
@ 2018-08-23 21:09 ` Edouard Tisserant
2018-08-24 7:07 ` Stéphane Reichert
0 siblings, 1 reply; 9+ messages in thread
From: Edouard Tisserant @ 2018-08-23 21:09 UTC (permalink / raw)
To: Stéphane Reichert; +Cc: Xenomai (xenomai@xenomai.org)
Hi Stéphane.
Well, sorry for untested patch, and thanks for your help in debugging it !
Looking back in recent changes in rtnet, this problem may be related
to this commit (changes on 8139too.c are explicit):
https://gitlab.denx.de/Xenomai/xenomai/commit/3e97e64ee27ce01e8488d06c52bc4681729b30b9
Patching fec.c in a similar way may certainly help, since apparently
signatures are now incompatible.
Please let me know if it helps.
Best regards,
Edouard.
Le mer. 22 août 2018 à 10:24, Stéphane Reichert
<sreichert@sepro-group.com> a écrit :
>
> Hello Edouard,
>
> Thanks again for your patch.
>
> I tried it on my kernel, but unfortunately I am facing the same issue
> (ioctl: Resource temporarily unavailable error message on rtping).
>
> Best regards
> Stéphane
>
> -----Message d'origine-----
> De : Edouard Tisserant [mailto:edouard.tisserant@gmail.com]
> Envoyé : mardi 21 août 2018 23:19
> À : Stéphane Reichert; xenomai@xenomai.org
> Objet : Re: [Xenomai] TR: RTNet - how to setup rt_fec on IMX6Q (Xenomai
> 3.0.7)
>
> Hello Stéphane.
>
> I'm porting EtherLAB to Xenomai3 on Imx6, using RTNet instead of EtherLAB
> provided drivers.
>
> This is still work in progress, but the fec.c patch I have now may help.
> Find it attached.
>
> I built it last time on kernel 4.9.51 and xenomai 3.0.6. This is largely
> untested, your feedback is welcome.
>
> Beware content of DTS for vanilla FEC from kernel 4.x may not be compatible
> anymore with the one expected by FEC from RTnet. You may have to patch you
> DTS accordingly.
>
> Best regards,
>
> Edouard
>
>
>
> On 17/08/2018 13:39, Stéphane Reichert wrote:
> > Hello Philippe,
> >
> > I have noticed in the file fec.c that the function fec_enet_ioctl did
> > not match the prototype of do_ioctl (it looks like "request" and "arg"
> > parameters are switched). Is it a mistake ?
> >
> > (I tried to switch these parameters but it didn't solved my problem as
> > well).
> >
> > Stephane
> >
> >
> > -----Message d'origine-----
> > De : Philippe Gerum [mailto:rpm@xenomai.org] Envoyé : vendredi 17 août
> > 2018
> > 10:28 À : Stéphane Reichert; xenomai@xenomai.org Objet : Re: [Xenomai]
> > RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
> >
> > On 08/16/2018 03:23 PM, Stéphane Reichert wrote:
> >> Hello,
> >>
> >>
> >>
> >> We are trying to use the rt_fec driver for RTNet on a iMX6Q board.
> >>
> >>
> >>
> >> I have patched the KConfig to add this driver on buildroot and it
> >> compiles perfectly.
> >>
> >>
> >>
> >> But now, I am not able to use it on our board (it works when I “rtping”
> >> the loopback,
> >>
> >> but it doesn’t work if I try to ping an external board).
> > The fec driver does not seem to tell the stack about the carrier
> > enable state. If so, you may want to try the following patch:
> >
> > diff --git a/kernel/drivers/net/drivers/fec.c
> > b/kernel/drivers/net/drivers/fec.c
> > index 36870ba16..d94ec690f 100644
> > --- a/kernel/drivers/net/drivers/fec.c
> > +++ b/kernel/drivers/net/drivers/fec.c
> > @@ -1323,6 +1323,7 @@ fec_enet_open(struct rtnet_device *ndev)
> > return ret;
> > }
> > phy_start(fep->phy_dev);
> > + rtnetif_carrier_on(ndev);
> > rtnetif_start_queue(ndev);
> > fep->opened = 1;
> > return 0;
> >
> > --
> > Philippe.
> >
> > _______________________________________________
> > Xenomai mailing list
> > Xenomai@xenomai.org
> > https://xenomai.org/mailman/listinfo/xenomai
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xenomai] TR: RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
2018-08-23 21:09 ` Edouard Tisserant
@ 2018-08-24 7:07 ` Stéphane Reichert
2018-09-10 15:24 ` Edouard Tisserant
0 siblings, 1 reply; 9+ messages in thread
From: Stéphane Reichert @ 2018-08-24 7:07 UTC (permalink / raw)
To: Edouard Tisserant; +Cc: Xenomai
Hello Edouard,
Thanks for your mail.
We already applied these changes in our file fec.c, but it didn"t solve our
issue.
Il will let you know if we find an issue.
Best regards
Stéphane
-----Message d'origine-----
De : Edouard Tisserant [mailto:edouard.tisserant@gmail.com]
Envoyé : jeudi 23 août 2018 23:10
À : Stéphane Reichert
Cc : Xenomai (xenomai@xenomai.org)
Objet : Re: [Xenomai] TR: RTNet - how to setup rt_fec on IMX6Q (Xenomai
3.0.7)
Hi Stéphane.
Well, sorry for untested patch, and thanks for your help in debugging it !
Looking back in recent changes in rtnet, this problem may be related to this
commit (changes on 8139too.c are explicit):
https://gitlab.denx.de/Xenomai/xenomai/commit/3e97e64ee27ce01e8488d06c52bc4681729b30b9
Patching fec.c in a similar way may certainly help, since apparently
signatures are now incompatible.
Please let me know if it helps.
Best regards,
Edouard.
Le mer. 22 août 2018 à 10:24, Stéphane Reichert <sreichert@sepro-group.com>
a écrit :
>
> Hello Edouard,
>
> Thanks again for your patch.
>
> I tried it on my kernel, but unfortunately I am facing the same issue
> (ioctl: Resource temporarily unavailable error message on rtping).
>
> Best regards
> Stéphane
>
> -----Message d'origine-----
> De : Edouard Tisserant [mailto:edouard.tisserant@gmail.com]
> Envoyé : mardi 21 août 2018 23:19
> À : Stéphane Reichert; xenomai@xenomai.org Objet : Re: [Xenomai] TR:
> RTNet - how to setup rt_fec on IMX6Q (Xenomai
> 3.0.7)
>
> Hello Stéphane.
>
> I'm porting EtherLAB to Xenomai3 on Imx6, using RTNet instead of
> EtherLAB provided drivers.
>
> This is still work in progress, but the fec.c patch I have now may help.
> Find it attached.
>
> I built it last time on kernel 4.9.51 and xenomai 3.0.6. This is
> largely untested, your feedback is welcome.
>
> Beware content of DTS for vanilla FEC from kernel 4.x may not be
> compatible anymore with the one expected by FEC from RTnet. You may
> have to patch you DTS accordingly.
>
> Best regards,
>
> Edouard
>
>
>
> On 17/08/2018 13:39, Stéphane Reichert wrote:
> > Hello Philippe,
> >
> > I have noticed in the file fec.c that the function fec_enet_ioctl
> > did not match the prototype of do_ioctl (it looks like "request" and
> > "arg"
> > parameters are switched). Is it a mistake ?
> >
> > (I tried to switch these parameters but it didn't solved my problem
> > as well).
> >
> > Stephane
> >
> >
> > -----Message d'origine-----
> > De : Philippe Gerum [mailto:rpm@xenomai.org] Envoyé : vendredi 17
> > août
> > 2018
> > 10:28 À : Stéphane Reichert; xenomai@xenomai.org Objet : Re:
> > [Xenomai] RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
> >
> > On 08/16/2018 03:23 PM, Stéphane Reichert wrote:
> >> Hello,
> >>
> >>
> >>
> >> We are trying to use the rt_fec driver for RTNet on a iMX6Q board.
> >>
> >>
> >>
> >> I have patched the KConfig to add this driver on buildroot and it
> >> compiles perfectly.
> >>
> >>
> >>
> >> But now, I am not able to use it on our board (it works when I “rtping”
> >> the loopback,
> >>
> >> but it doesn’t work if I try to ping an external board).
> > The fec driver does not seem to tell the stack about the carrier
> > enable state. If so, you may want to try the following patch:
> >
> > diff --git a/kernel/drivers/net/drivers/fec.c
> > b/kernel/drivers/net/drivers/fec.c
> > index 36870ba16..d94ec690f 100644
> > --- a/kernel/drivers/net/drivers/fec.c
> > +++ b/kernel/drivers/net/drivers/fec.c
> > @@ -1323,6 +1323,7 @@ fec_enet_open(struct rtnet_device *ndev)
> > return ret;
> > }
> > phy_start(fep->phy_dev);
> > + rtnetif_carrier_on(ndev);
> > rtnetif_start_queue(ndev);
> > fep->opened = 1;
> > return 0;
> >
> > --
> > Philippe.
> >
> > _______________________________________________
> > Xenomai mailing list
> > Xenomai@xenomai.org
> > https://xenomai.org/mailman/listinfo/xenomai
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xenomai] TR: RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
2018-08-24 7:07 ` Stéphane Reichert
@ 2018-09-10 15:24 ` Edouard Tisserant
0 siblings, 0 replies; 9+ messages in thread
From: Edouard Tisserant @ 2018-09-10 15:24 UTC (permalink / raw)
To: Stéphane Reichert; +Cc: Xenomai
Hi Stéphane.
With Xenomai 3.0.6 / Linux 4.9.51 build, together with the rt_fec patch
I sent, and with RTNet IP layer enabled (I usually only using raw packet
level), I could reproduce your experiment, but couldn't reproduce the
bug. It just works :
# modprobe rtnet
[ 54.424453]
[ 54.424453] *** RTnet for Xenomai v3.0.6 ***
[ 54.424453]
[ 54.431748] RTnet: initialising real-time networking
# modprobe rtipv4
# modprobe rt_fec
# modprobe rtudp
# modprobe rtpacket
# echo 2188000.ethernet > /sys/bus/platform/drivers/fec/unbind
# echo 2188000.ethernet > /sys/bus/platform/drivers/rt_fec/bind
[ 440.299232] libphy: fec_enet_mii_bus: probed
[ 440.303524] RTnet: registered rteth0
# rtifconfig rteth0
rteth0 Medium: Ethernet Hardware address: 00:1E:AC:00:B0:63
BROADCAST MTU: 1500
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
# rtifconfig rteth0 up 192.168.42.10
[ 500.575716] Atheros 8035 ethernet 2188000.ethernet:01: attached PHY
driver [Atheros 8035 ethernet] (mii_bus:phy
#
# [ 505.755173] rt_fec 2188000.ethernet (unnamed net_device)
(uninitialized): Link is Up - 1Gbps/Full - flow cont
[ 507.835111] rt_fec 2188000.ethernet (unnamed net_device)
(uninitialized): Link is Down
[ 508.875169] rt_fec 2188000.ethernet (unnamed net_device)
(uninitialized): Link is Up - 1Gbps/Full - flow contro
[ 510.955108] rt_fec 2188000.ethernet (unnamed net_device)
(uninitialized): Link is Down
[ 511.995166] rt_fec 2188000.ethernet (unnamed net_device)
(uninitialized): Link is Up - 100Mbps/Full - flow cont
# rtroute add 192.168.42.3 00:0e:c6:d3:d3:e0 dev rteth0
# rtping 192.168.42.3
Real-time PING 192.168.42.3 56(84) bytes of data.
64 bytes from 192.168.42.3: icmp_seq=1 time=394.4 us
64 bytes from 192.168.42.3: icmp_seq=2 time=288.3 us
64 bytes from 192.168.42.3: icmp_seq=3 time=343.3 us
64 bytes from 192.168.42.3: icmp_seq=4 time=384.8 us
....
Note that Ethernet speed negotiation seems to be failing, since it falls
back to 100M after a few seconds, whereas at the the other end of the
cable is supposed to be another Gigabit Ethernet controller as well. I
also saw that behavior with non-real time fec driver, I should check the
cable it looks prehistorical.
Please if possible give a shot to 3.0.6, just to see if this is the cause.
FYI, my test board is an APF6 dev board from OpossSOM, fec related DTS
looks like :
&fec {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet>;
phy-mode = "rgmii";
phy-reset-duration = <10>;
phy-reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
status = "okay";
};
Best regards,
Edouard
On 24/08/2018 09:07, Stéphane Reichert wrote:
> Hello Edouard,
>
> Thanks for your mail.
>
> We already applied these changes in our file fec.c, but it didn"t solve our
> issue.
>
> Il will let you know if we find an issue.
>
> Best regards
> Stéphane
>
> -----Message d'origine-----
> De : Edouard Tisserant [mailto:edouard.tisserant@gmail.com]
> Envoyé : jeudi 23 août 2018 23:10
> À : Stéphane Reichert
> Cc : Xenomai (xenomai@xenomai.org)
> Objet : Re: [Xenomai] TR: RTNet - how to setup rt_fec on IMX6Q (Xenomai
> 3.0.7)
>
> Hi Stéphane.
>
> Well, sorry for untested patch, and thanks for your help in debugging it !
>
> Looking back in recent changes in rtnet, this problem may be related to this
> commit (changes on 8139too.c are explicit):
> https://gitlab.denx.de/Xenomai/xenomai/commit/3e97e64ee27ce01e8488d06c52bc4681729b30b9
>
> Patching fec.c in a similar way may certainly help, since apparently
> signatures are now incompatible.
>
> Please let me know if it helps.
>
> Best regards,
> Edouard.
>
>
> Le mer. 22 août 2018 à 10:24, Stéphane Reichert <sreichert@sepro-group.com>
> a écrit :
>> Hello Edouard,
>>
>> Thanks again for your patch.
>>
>> I tried it on my kernel, but unfortunately I am facing the same issue
>> (ioctl: Resource temporarily unavailable error message on rtping).
>>
>> Best regards
>> Stéphane
>>
>> -----Message d'origine-----
>> De : Edouard Tisserant [mailto:edouard.tisserant@gmail.com]
>> Envoyé : mardi 21 août 2018 23:19
>> À : Stéphane Reichert; xenomai@xenomai.org Objet : Re: [Xenomai] TR:
>> RTNet - how to setup rt_fec on IMX6Q (Xenomai
>> 3.0.7)
>>
>> Hello Stéphane.
>>
>> I'm porting EtherLAB to Xenomai3 on Imx6, using RTNet instead of
>> EtherLAB provided drivers.
>>
>> This is still work in progress, but the fec.c patch I have now may help.
>> Find it attached.
>>
>> I built it last time on kernel 4.9.51 and xenomai 3.0.6. This is
>> largely untested, your feedback is welcome.
>>
>> Beware content of DTS for vanilla FEC from kernel 4.x may not be
>> compatible anymore with the one expected by FEC from RTnet. You may
>> have to patch you DTS accordingly.
>>
>> Best regards,
>>
>> Edouard
>>
>>
>>
>> On 17/08/2018 13:39, Stéphane Reichert wrote:
>>> Hello Philippe,
>>>
>>> I have noticed in the file fec.c that the function fec_enet_ioctl
>>> did not match the prototype of do_ioctl (it looks like "request" and
>>> "arg"
>>> parameters are switched). Is it a mistake ?
>>>
>>> (I tried to switch these parameters but it didn't solved my problem
>>> as well).
>>>
>>> Stephane
>>>
>>>
>>> -----Message d'origine-----
>>> De : Philippe Gerum [mailto:rpm@xenomai.org] Envoyé : vendredi 17
>>> août
>>> 2018
>>> 10:28 À : Stéphane Reichert; xenomai@xenomai.org Objet : Re:
>>> [Xenomai] RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7)
>>>
>>> On 08/16/2018 03:23 PM, Stéphane Reichert wrote:
>>>> Hello,
>>>>
>>>>
>>>>
>>>> We are trying to use the rt_fec driver for RTNet on a iMX6Q board.
>>>>
>>>>
>>>>
>>>> I have patched the KConfig to add this driver on buildroot and it
>>>> compiles perfectly.
>>>>
>>>>
>>>>
>>>> But now, I am not able to use it on our board (it works when I “rtping”
>>>> the loopback,
>>>>
>>>> but it doesn’t work if I try to ping an external board).
>>> The fec driver does not seem to tell the stack about the carrier
>>> enable state. If so, you may want to try the following patch:
>>>
>>> diff --git a/kernel/drivers/net/drivers/fec.c
>>> b/kernel/drivers/net/drivers/fec.c
>>> index 36870ba16..d94ec690f 100644
>>> --- a/kernel/drivers/net/drivers/fec.c
>>> +++ b/kernel/drivers/net/drivers/fec.c
>>> @@ -1323,6 +1323,7 @@ fec_enet_open(struct rtnet_device *ndev)
>>> return ret;
>>> }
>>> phy_start(fep->phy_dev);
>>> + rtnetif_carrier_on(ndev);
>>> rtnetif_start_queue(ndev);
>>> fep->opened = 1;
>>> return 0;
>>>
>>> --
>>> Philippe.
>>>
>>> _______________________________________________
>>> Xenomai mailing list
>>> Xenomai@xenomai.org
>>> https://xenomai.org/mailman/listinfo/xenomai
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-09-10 15:24 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-16 13:23 [Xenomai] RTNet - how to setup rt_fec on IMX6Q (Xenomai 3.0.7) Stéphane Reichert
2018-08-17 8:27 ` Philippe Gerum
2018-08-17 11:39 ` [Xenomai] TR: " Stéphane Reichert
2018-08-17 11:39 ` Stéphane Reichert
2018-08-21 21:19 ` Edouard Tisserant
2018-08-22 8:24 ` Stéphane Reichert
2018-08-23 21:09 ` Edouard Tisserant
2018-08-24 7:07 ` Stéphane Reichert
2018-09-10 15:24 ` Edouard Tisserant
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.