public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Commit ecee9... (Program net device MAC addresses after initializing) breakage
Date: Sun, 07 Nov 2010 09:13:08 +1100	[thread overview]
Message-ID: <4CD5D2F4.5020102@gmail.com> (raw)

Hi All,

I finally got a few spare hours to do some U-Boot hacking and to my dismay
found the build for my board (eNET) had broken. It builds OK, but crashed
during Ethernet initialisation. I tried winding back to a last known good
commit without much luck.

I realised I had upgraded to Ubuntu 10.10 lately, and thought maybe a
tool-chain change was the culprit (was running gcc-4.4.1 and binutils 2.19
from source, now running Ubuntu gcc 4.4.5 and Binutils 2.20)

But, I think that commit ecee9324d73555e744593f3e0d387bec4c566f55 may be
'not quite right'. My board uses the rtl8139 driver, and the following
patch gets my board booting again:

diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c
index db8a727..3646148 100644
--- a/drivers/net/rtl8139.c
+++ b/drivers/net/rtl8139.c
@@ -229,6 +229,7 @@ int rtl8139_initialize(bd_t *bis)
                dev->halt = rtl_disable;
                dev->send = rtl_transmit;
                dev->recv = rtl_poll;
+               dev->write_hwaddr = NULL;
 #ifdef CONFIG_MCAST_TFTP
                dev->mcast = rtl_bcast_addr;
 #endif

Just before this code we see that dev is malloc'd:

dev = (struct eth_device *)malloc(sizeof *dev);

So there is no guarantee that dev is NULL'd.

Has anyone else run into similar problems?

I saw discussion a little while ago regarding implementing a version of
malloc that returns cleared memory - did this gain any traction?

Regards,

Graeme

             reply	other threads:[~2010-11-06 22:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-06 22:13 Graeme Russ [this message]
2010-11-08 14:38 ` [U-Boot] Commit ecee9... (Program net device MAC addresses after initializing) breakage Kumar Gala
2010-11-10  3:36 ` Mike Frysinger
2010-11-12 10:55   ` Graeme Russ
2010-11-13  1:11     ` Mike Frysinger
2010-11-13  1:51       ` Graeme Russ
2010-11-13  2:20         ` Mike Frysinger

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=4CD5D2F4.5020102@gmail.com \
    --to=graeme.russ@gmail.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