Skip to contentSkip to conversation

uninitialized list_head in miiphy r [...]

DNX#2006033142000687 DENX Support System 1 participant 1 message Mar 31, 2006

lore
Share & tools
lore
#0 lore raw

Hello list,

inside the automatic U-Boot patch tracking system a new ticket [DNX#2006033142000687] was created:

<snip>

Quoted 24 lines

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.

Quoted 6 lines

Are there any better ways to do it?

Wolfgang, do you accept this patch?

Regards
Matthias

</snip>

Your U-Boot support team