[U-Boot-Users] uninitialized list_head in miiphy routines

Matthias Fuchs matthias.fuchs at esd-electronics.com
Fri Nov 18 09:54:18 CET 2005


Hi,

I experienced some trouble with the new PHY code on our 4xx boards. The 
code seems to be added on october, 28th.

This is what happens: When our boards wake up for the very first time no 
ethaddr is configured. Therefore no network interface will be available 
(you get the message: 'Net: no ethernet found.'). This will prevent 
miiphy_register() to be called. This function initializes a list with 
all PHYs (mii_devs). When this function is never called before any of 
the miiphy functions is called, these functions will crash during the 
search (list_for_each(...)) for the correct PHY driver.

This happens in our implementation of reset_phy() 
(board/esd/cms700/cms700.c).

I expect the miiphy functions to return with an error when a PHY 
interface is not availble. This will ony work when the mii_devs 
list_head is initilized in any case.

I appended a little patch that introduces miiphy_init() that must be 
called before any miiphy function. The patch is tested on 4xx systems.

Are there any better ways to do it?

Wolfgang, do you accept this patch?

Regards
Matthias
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: miiphy_init-051117.patch
Url: http://lists.denx.de/pipermail/u-boot/attachments/20051118/77dc8659/attachment.txt 


More information about the U-Boot mailing list