[U-Boot] [PATCH] Fix loading freeze when netconsole is active

Frédéric Leroy fredo at starox.org
Sun Sep 8 14:22:34 CEST 2013


Netconsole calls eth_halt() before giving control to another operating
system.
But the state machine of netconsole don't take it into account.
Thus, netconsole calls network functions of an halted network device,
making the whole system freeze.
Rather than modifying the state machine of netconsole, we just unregister
the current network device before booting. It does work because
nc_send_packet() verifies that the current network device is not null.

Signed-off-by: Frédéric Leroy <fredo at starox.org>
---
 common/cmd_bootm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Hello Tom,

I have made a cleaner version of my patch against master.
I didn't touch the netconsole code because I don't fully understand it.

Regards,

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 15f4599..beb25b6 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -577,7 +577,7 @@ static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
 			 * Stop the ethernet stack if NetConsole could have
 			 * left it up
 			 */
-			eth_halt();
+			eth_unregister(eth_get_dev());
 #endif
 			arch_preboot_os();
 			boot_fn(BOOTM_STATE_OS_GO, argc, argv, &images);
@@ -645,7 +645,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #ifdef CONFIG_NETCONSOLE
 	/* Stop the ethernet stack if NetConsole could have left it up */
-	eth_halt();
+	eth_unregister(eth_get_dev());
 #endif
 
 #if defined(CONFIG_CMD_USB)
@@ -1849,7 +1849,7 @@ static int do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #ifdef CONFIG_NETCONSOLE
 	/* Stop the ethernet stack if NetConsole could have left it up */
-	eth_halt();
+	eth_unregister(eth_get_dev());
 #endif
 
 #if defined(CONFIG_CMD_USB)
-- 
1.8.1.2



More information about the U-Boot mailing list