* Ethernet reinit on phyCORE hangs the device
@ 2022-06-14 7:12 Andrej Picej
2022-06-14 8:27 ` Sascha Hauer
0 siblings, 1 reply; 3+ messages in thread
From: Andrej Picej @ 2022-06-14 7:12 UTC (permalink / raw)
To: Barebox List
Hi all,
when testing barebox ethernet on i.MX6 (phyCORE) we encountered a bug:
the ethernet re-init on barebox doesn't work! If we do:
$ ifup eth0
$ ifdown eth0
and then:
$ ifup eth0
$ ping HOST_IP
the device hangs and can only be saved by resetting the board manually.
We narrowed the problem down to the "fec_tx_task_enable". It seems that
enabling tx task with writing to TDAR reg hangs the device shortly after.
Did you guys maybe encounter something similar on i.MX6 boards or on any
other boards?
I guess this is a really specific problem as people don't normally do
ifup/ifdown with ethernet in bootloader :D.
Do you have any idea what could be the reason or how could this be solved?
Any useful information would be greatly appreciated.
Using barebox v2022.02.
Best Regards,
Andrej
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Ethernet reinit on phyCORE hangs the device
2022-06-14 7:12 Ethernet reinit on phyCORE hangs the device Andrej Picej
@ 2022-06-14 8:27 ` Sascha Hauer
2022-06-14 10:33 ` Andrej Picej
0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2022-06-14 8:27 UTC (permalink / raw)
To: Andrej Picej; +Cc: Barebox List
On Tue, Jun 14, 2022 at 09:12:23AM +0200, Andrej Picej wrote:
> Hi all,
>
> when testing barebox ethernet on i.MX6 (phyCORE) we encountered a bug:
> the ethernet re-init on barebox doesn't work! If we do:
> $ ifup eth0
> $ ifdown eth0
> and then:
> $ ifup eth0
> $ ping HOST_IP
> the device hangs and can only be saved by resetting the board manually.
I can confirm the behaviour is the same here.
>
> We narrowed the problem down to the "fec_tx_task_enable". It seems that
> enabling tx task with writing to TDAR reg hangs the device shortly after.
>
> Did you guys maybe encounter something similar on i.MX6 boards or on any
> other boards?
>
> I guess this is a really specific problem as people don't normally do
> ifup/ifdown with ethernet in bootloader :D.
Nope :)
>
> Do you have any idea what could be the reason or how could this be solved?
> Any useful information would be greatly appreciated.
Part of the problem is that fec_halt() tears down the device completely.
The counterpart of that is fec_init(), but that is called from during
probe only. I think fec_init() should be called from fec_open() as well.
A quick test revealed this is really only part of the problem. The next
one is that fec_update_linkspeed() is not called on second open, so the
fec speed registers will not get their correct value.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
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
* Re: Ethernet reinit on phyCORE hangs the device
2022-06-14 8:27 ` Sascha Hauer
@ 2022-06-14 10:33 ` Andrej Picej
0 siblings, 0 replies; 3+ messages in thread
From: Andrej Picej @ 2022-06-14 10:33 UTC (permalink / raw)
To: Sascha Hauer; +Cc: Barebox List
Hi Sascha,
On 14. 06. 22 10:27, Sascha Hauer wrote:
> On Tue, Jun 14, 2022 at 09:12:23AM +0200, Andrej Picej wrote:
>> Hi all,
>>
>> when testing barebox ethernet on i.MX6 (phyCORE) we encountered a bug:
>> the ethernet re-init on barebox doesn't work! If we do:
>> $ ifup eth0
>> $ ifdown eth0
>> and then:
>> $ ifup eth0
>> $ ping HOST_IP
>> the device hangs and can only be saved by resetting the board manually.
>
> I can confirm the behaviour is the same here.
Great.
>
>>
>> We narrowed the problem down to the "fec_tx_task_enable". It seems that
>> enabling tx task with writing to TDAR reg hangs the device shortly after.
>>
>> Did you guys maybe encounter something similar on i.MX6 boards or on any
>> other boards?
>>
>> I guess this is a really specific problem as people don't normally do
>> ifup/ifdown with ethernet in bootloader :D.
>
> Nope :)
>
>>
>> Do you have any idea what could be the reason or how could this be solved?
>> Any useful information would be greatly appreciated.
>
> Part of the problem is that fec_halt() tears down the device completely.
> The counterpart of that is fec_init(), but that is called from during
> probe only. I think fec_init() should be called from fec_open() as well.
Hmm I thought I already tried that, guess not...
>
> A quick test revealed this is really only part of the problem. The next
> one is that fec_update_linkspeed() is not called on second open, so the
> fec speed registers will not get their correct value.
Ok, I'll check that out.
Thanks for your help so far.
Andrej
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-14 10:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14 7:12 Ethernet reinit on phyCORE hangs the device Andrej Picej
2022-06-14 8:27 ` Sascha Hauer
2022-06-14 10:33 ` Andrej Picej
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox