From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] NET: Proper return code handling in eth_init() function in file eth.c
Date: Tue, 08 Jan 2008 09:56:32 -0500 [thread overview]
Message-ID: <47838F20.6020905@gmail.com> (raw)
In-Reply-To: <bb58ac4d0801080650r6dbc5558y27254846691e90fa@mail.gmail.com>
Upakul Barkakaty wrote:
>
> On 1/8/08, *Stefan Roese* <sr at denx.de <mailto:sr@denx.de>> wrote:
>
> On Thursday 29 November 2007, Upakul Barkakaty wrote:
> > NET: Proper return code handling in eth_init() function in file
> eth.c
> >
> > This patch modifies the return code handling in the eth_init()
> > function, to be compatible with the handling of the return codes in
> > the other network stack files. It now returns a 0 on Success and
> -1 on
> > error.
>
> I just noticed that this patch breaks TFTP on 4xx platforms:
>
> commit 505be87a65e4f87ad7d8da1d57ea4dcd487d7e32
> Author: Upakul Barkakaty <upakul at gmail.com <mailto:upakul@gmail.com>>
> Date: Thu Nov 29 12:16:13 2007 +0530
>
> NET: Proper return code handling in eth_init() function in
> file eth.c
>
> This patch modifies the return code handling in the eth_init()
> function, to be compatible with the handling of the return
> codes in
> the other network stack files. It now returns a 0 on Success
> and -1 on
> error.
>
> Signed-off-by: Upakul Barkakaty <
> upakul.barkakaty at conexant.com <mailto:upakul.barkakaty@conexant.com>>
> Signed-off-by: Ben Warren <biggerbadderben@gmail.com
> <mailto:biggerbadderben@gmail.com>>
>
> I just see link auto-negotiation going on, and after that no real
> transaction
> is happening! :-(
>
> => tftp 100000 u-image.bin
> Waiting for PHY auto negotiation to complete.... done
> ENET Speed is 1000 Mbps - FULL duplex connection (EMAC0)
>
> Would be great if someone could look into this ASAP. Unfortunately
> I have no
> time left today.
>
> Thanks.
>
> Best regards,
> Stefan
>
> =====================================================================
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email:
> office at denx.de <mailto:office@denx.de>
> =====================================================================
>
>
> Hi Stefan,
>
> Probably i got the reason why this is happening. As a convention that
> is usually followed, the code in eth_init() function in the file eth.c
> was reworked to handle 0 in case of Success and any non zero value in
> case of an error.
>
> Most of the Ethernet driver's init routines adhere to the same
> convention of returning a 0 on Success and a non zero value in case of
> error. However, the driver you might be using, may be returning a non
> zero value on Successful initialization, that is why the problem is
> arising. The solution could be to return 0 in case of Success, from
> the Ethernet driver's init() routine.
>
> Thanks!!
>
> --
> Regards,
> Upakul Barkakaty
Yeah, looks like ppc_4xx_eth_init() (cpu/ppc4xx/4xx_enet.c) returns 1 on
success and -1 on failure. I don't have hardware to test this. Can you
check it out Stefan? Let's look through the other drivers to see if
this is an isolated case.
regards,
Ben
next prev parent reply other threads:[~2008-01-08 14:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 6:04 [U-Boot-Users] [PATCH] NET: Proper return code handling in eth_init() function in file eth.c Upakul Barkakaty
2007-11-29 6:24 ` Stefan Roese
2007-11-29 6:46 ` Upakul Barkakaty
2008-01-08 14:26 ` Stefan Roese
2008-01-08 14:35 ` Upakul Barkakaty
2008-01-08 14:50 ` Upakul Barkakaty
2008-01-08 14:56 ` Ben Warren [this message]
2008-01-08 17:26 ` Stefan Roese
2008-01-08 21:10 ` Ben Warren
-- strict thread matches above, loose matches on Subject: below --
2007-11-28 5:18 Upakul Barkakaty
2007-11-28 15:39 ` Ben Warren
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=47838F20.6020905@gmail.com \
--to=biggerbadderben@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