public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] uninitialized list_head in miiphy routines
Date: Fri, 18 Nov 2005 09:54:18 +0100	[thread overview]
Message-ID: <437D96BA.7070305@esd-electronics.com> (raw)

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 

                 reply	other threads:[~2005-11-18  8:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=437D96BA.7070305@esd-electronics.com \
    --to=matthias.fuchs@esd-electronics.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox