[En-Nut-Discussion] How to make "Ethernut Device registration" more save??

Ács Péter acspeter at rubin.hu
Thu Aug 12 17:58:50 CEST 2010


Hello,

> My problem is, when I disconnect the Ethernet cable and then put on the
> system, the hole system seems to hang of. I don`t get any debug prompts on
> UART. After some time my external Watchdog forces the system to reset and so
> on and so on...
>
> If the system starts with an connected Ethernet cable, everything works
> fine.

The problem is in the arch/arm/dev/at91_emac.c driver: it uses a 
constant (EMAC_LINK_LOOPS) for timeout, and in the EmacReset function 
(in stable 4.8.7 version; in the current svn version the problem is in 
the probePhy function) polls the PHY for link status in a loop. As it 
doesn't give back control to other threads, the other threads won't get 
any chance to run, neither the thread responsible for watchdog handling.
A possible solution is to insert a NutSleep(10) there (10ms should be 
OK, I think, it works for me), but the correct solution would be the 
rewrite of the initialization of the driver (and maybe adding link 
status handling too, through ioctl call?).

-- 
with best regards,

Peter




More information about the En-Nut-Discussion mailing list