[U-Boot] [PATCH] net/eth.c: bug-fix

--- u-boot-2009.11.1.orig/net/eth.c 2010-01-25 16:35:12.000000000 +0800
+++ u-boot-2009.11.1/net/eth.c 2010-02-12 11:18:23.558229895 +0800
@@ -199,7 +199,7 @@
#endif
/* Try board-specific initialization first. If it fails or isn't
* present, try the cpu-specific initialization */
- if (board_eth_init(bis) < 0)
+ if (board_eth_init(bis) <= 0)
cpu_eth_init(bis);
#if defined(CONFIG_DB64360) || defined(CONFIG_CPCI750)

On 2/11/2010 8:08 PM, Teh Kok How wrote:
--- u-boot-2009.11.1.orig/net/eth.c 2010-01-25 16:35:12.000000000 +0800
+++ u-boot-2009.11.1/net/eth.c 2010-02-12 11:18:23.558229895 +0800
@@ -199,7 +199,7 @@
#endif
/* Try board-specific initialization first. If it fails or isn't * present, try the cpu-specific initialization */
if (board_eth_init(bis)< 0)
if (board_eth_init(bis)<= 0) cpu_eth_init(bis);
That's not a bug. The check is meant to indicate whether the weak board_eth_init() function has been overridden, not whether there was an error. I have a clarification patch that hasn't been submitted yet.
regards, Ben

No, it is a bug. Board_eth_init() calls pci_eth_init() (include/netdev.h) and if ethernet is soc, CONFIG_PCI is not defined, pci_eth_init() returns 0. This patch allows cpu_eth_init() to be called.
-----Original Message----- From: Ben Warren [mailto:biggerbadderben@gmail.com] Sent: Friday, February 12, 2010 1:54 PM To: Teh Kok How Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH] net/eth.c: bug-fix
On 2/11/2010 8:08 PM, Teh Kok How wrote:
--- u-boot-2009.11.1.orig/net/eth.c 2010-01-25 16:35:12.000000000
+0800
+++ u-boot-2009.11.1/net/eth.c 2010-02-12 11:18:23.558229895 +0800
@@ -199,7 +199,7 @@
#endif
/* Try board-specific initialization first. If it fails or isn't * present, try the cpu-specific initialization */
if (board_eth_init(bis)< 0)
if (board_eth_init(bis)<= 0) cpu_eth_init(bis);
That's not a bug. The check is meant to indicate whether the weak board_eth_init() function has been overridden, not whether there was an error. I have a clarification patch that hasn't been submitted yet.
regards, Ben

Hello Teh Kok How,
On Thu, Feb 11, 2010 at 10:57 PM, Teh Kok How khteh@smartbridges.comwrote:
No, it is a bug. Board_eth_init() calls pci_eth_init() (include/netdev.h) and if ethernet is soc, CONFIG_PCI is not defined, pci_eth_init() returns 0. This patch allows cpu_eth_init() to be called.
Sorry, still not a bug. The behavior you've described should be handled
internally to your specific board_eth_init() function. If no PCI devices are found either because none are present or because you didn't specify the CONFIG_PCI option, you can call cpu_eth_init().
regards, Ben

Fixes: Board_eth_init() calls pci_eth_init() (include/netdev.h) and if ethernet is soc, CONFIG_PCI is not defined, pci_eth_init() returns 0. This patch allows cpu_eth_init() to be called.
Signed-off-by: Kok How, Teh k_h_teh@yahoo.com --- u-boot-2009.11.1.orig/net/eth.c 2010-01-25 16:35:12.000000000 +0800 +++ u-boot-2009.11.1.new/net/eth.c 2010-02-12 17:20:32.864273873 +0800 @@ -199,7 +199,7 @@ #endif /* Try board-specific initialization first. If it fails or isn't * present, try the cpu-specific initialization */ - if (board_eth_init(bis) < 0) + if (board_eth_init(bis) <= 0) cpu_eth_init(bis);
#if defined(CONFIG_DB64360) || defined(CONFIG_CPCI750)

Dear Ben,
In message 3270DCAC1B1540C7B13D9BC718F543BF@smartbridges.com Teh Kok How wrote:
Fixes: Board_eth_init() calls pci_eth_init() (include/netdev.h) and if ethernet is soc, CONFIG_PCI is not defined, pci_eth_init() returns 0. This patch allows cpu_eth_init() to be called.
Signed-off-by: Kok How, Teh k_h_teh@yahoo.com --- u-boot-2009.11.1.orig/net/eth.c 2010-01-25 16:35:12.000000000 +0800 +++ u-boot-2009.11.1.new/net/eth.c 2010-02-12 17:20:32.864273873 +0800 @@ -199,7 +199,7 @@ #endif /* Try board-specific initialization first. If it fails or isn't * present, try the cpu-specific initialization */
if (board_eth_init(bis) < 0)
if (board_eth_init(bis) <= 0) cpu_eth_init(bis);
#if defined(CONFIG_DB64360) || defined(CONFIG_CPCI750)
Do you have this patch in your queue?
Best regards,
Wolfgang Denk

Wolfgang, On 3/21/2010 1:38 PM, Wolfgang Denk wrote:
Dear Ben,
In message3270DCAC1B1540C7B13D9BC718F543BF@smartbridges.com Teh Kok How wrote:
Fixes: Board_eth_init() calls pci_eth_init() (include/netdev.h) and if ethernet is soc, CONFIG_PCI is not defined, pci_eth_init() returns 0. This patch allows cpu_eth_init() to be called.
Signed-off-by: Kok How, Tehk_h_teh@yahoo.com --- u-boot-2009.11.1.orig/net/eth.c 2010-01-25 16:35:12.000000000 +0800 +++ u-boot-2009.11.1.new/net/eth.c 2010-02-12 17:20:32.864273873 +0800 @@ -199,7 +199,7 @@ #endif /* Try board-specific initialization first. If it fails or isn't * present, try the cpu-specific initialization */
if (board_eth_init(bis)< 0)
if (board_eth_init(bis)<= 0) cpu_eth_init(bis);
#if defined(CONFIG_DB64360) || defined(CONFIG_CPCI750)
Do you have this patch in your queue?
No, I don't. This patch is wrong, and I believe I already responded about it. The code does need a subtle clean-up, but I haven't quite found the time to do it. Hopefully in the next couple of days I'll get to it.
Best regards,
Wolfgang Denk
regards, Ben

Dear Ben Warren,
In message 4BA8F738.3050806@gmail.com you wrote:
Do you have this patch in your queue?
No, I don't. This patch is wrong, and I believe I already responded about it. The code does need a subtle clean-up, but I haven't quite found the time to do it. Hopefully in the next couple of days I'll get to it.
Thanks. I asked because after your reply there was a "But..." from Teh Kok How which AFAICT remained unreplied, so I wa snot sure.
Best regards,
Wolfgang Denk

Hi Wolfgang,
On 3/23/2010 12:52 PM, Wolfgang Denk wrote:
Dear Ben Warren,
In message4BA8F738.3050806@gmail.com you wrote:
Do you have this patch in your queue?
No, I don't. This patch is wrong, and I believe I already responded about it. The code does need a subtle clean-up, but I haven't quite found the time to do it. Hopefully in the next couple of days I'll get to it.
Thanks. I asked because after your reply there was a "But..." from Teh Kok How which AFAICT remained unreplied, so I wa snot sure.
I see that now. Thought I'd responded, but I guess not. Anyway, the right fix for the problem Teh Kok How is (was?) seeing is to have a smarter board_eth_init() function.
Best regards,
Wolfgang Denk
regards, Ben
participants (3)
-
Ben Warren
-
Teh Kok How
-
Wolfgang Denk