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

Frédéric Leroy fredo at starox.org
Tue Sep 10 12:02:31 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>
---

Sorry, I was dumb. I don't know why I removed call to eth_halt().
eth_unregister() don't halt the device.

Changes in v2: 
	don't remove the call to eth_halt()
	
 common/cmd_bootm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 15f4599..549a914 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -578,6 +578,7 @@ static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
 			 * left it up
 			 */
 			eth_halt();
+			eth_unregister(eth_get_dev());
 #endif
 			arch_preboot_os();
 			boot_fn(BOOTM_STATE_OS_GO, argc, argv, &images);
@@ -646,6 +647,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)
@@ -1850,6 +1852,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