Skip to contentSkip to conversation

NetConsole tstc problems

U-Boot-Users Brian Prodoehl 3 participants 5 messages Nov 1, 2005 – Nov 2, 2005

lore
Share & tools
lore
#0 lore raw

Has anyone else experienced problems with NetConsole's tstc? In particular, defining CONFIG_BOOT_RETRY_TIME makes NetConsole almost unusable for me, because then readline() in main.c blocks on tstc and the result (for me, at least) is that NetConsole accepts a character every second or so. For everything that doesn't depend on tstc, NetConsole works beautifully for me. I'm just wondering if anyone else has seen problems, or if anyone has suggestions on how to make tstc less of a show-stopper (something I haven't been able to accomplish).

Brian Prodoehl

#1 lore raw

Hi Brian,

Quoted 5 lines · Brian Prodoehl

Has anyone else experienced problems with NetConsole's tstc? In particular, defining CONFIG_BOOT_RETRY_TIME makes NetConsole almost unusable for me, because then readline() in main.c blocks on tstc and the result (for me, at least) is that NetConsole accepts a character every second or so.

Depending on your network driver, tstc() can take pretty long. I experienced a similar problem in sleep() using tstc() via ctrlc(). I solved this problem using a "better" timeout mechanism with get_timer(). This could probably help here too.

Quoted 4 lines

For everything that doesn't depend on tstc, NetConsole works beautifully for me. I'm just wondering if anyone else has seen problems, or if anyone has suggestions on how to make tstc less of a show-stopper (something I haven't been able to accomplish).

Take a look at the sleep() fix:

http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=commit;h=c4c13df284cb06156c16ee6aef49b8d23be3fadd

Best regards,
Stefan

#2 lore raw
In reply to Brian Prodoehl
Quoted 8 lines · In message <[email protected]> you wrote:

Has anyone else experienced problems with NetConsole's tstc? In particular, defining CONFIG_BOOT_RETRY_TIME makes NetConsole almost unusable for me, because then readline() in main.c blocks on tstc and the result (for me, at least) is that NetConsole accepts a character every second or so. For everything that doesn't depend on tstc, NetConsole works beautifully for me. I'm just wondering if anyone else has seen problems, or if anyone has suggestions on how to make tstc less of a show-stopper (something I haven't been able to accomplish).

Please use current code. A fix inthis area has been checked in a couple of days ago.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Of course there's no reason for it, it's just our policy.
#3 lore raw
Quoted 7 lines
Quoted 1 line · In message <[email protected]> you wrote:

Has anyone else experienced problems with NetConsole's tstc? In

particular,

Quoted 4 lines

defining CONFIG_BOOT_RETRY_TIME makes NetConsole almost unusable for me, because then readline() in main.c blocks on tstc and the result (for me, at least) is that NetConsole accepts a character every second or so. For everything that doesn't depend on tstc, NetConsole works beautifully for

Quoted 7 lines

me.

Quoted 3 lines

I'm just wondering if anyone else has seen problems, or if anyone has suggestions on how to make tstc less of a show-stopper (something I haven't been able to accomplish).

Please use current code. A fix inthis area has been checked in a couple of days ago.

I'm not sure which fix you mean. The fix to the sleep command corrected the time issue, but there are still underlying problems with nc_tstc. Try hitting Ctrl+C to abort the sleep. I have to hit it between 3 and 10 times before it registers. And that fix doesn't help at all with the CONFIG_BOOT_RETRY_TIME problem. I don't see any configs using NetConsole and bootretry, but I'd be interested to hear that someone has it working without having to change core code. My current fix is to change the following in main.c's readline():

	for (;;) {
- #ifdef CONFIG_BOOT_RETRY_TIME
+ #if defined(CONFIG_BOOT_RETRY_TIME) && !defined(CONFIG_NETCONSOLE)
		while (!tstc()) {	/* while no incoming data */
			if (retry_time >= 0 && get_ticks() > endtime)
				return (-2);	/* timed out */
		}
#endif
		WATCHDOG_RESET();	/* Trigger watchdog, if needed */

With that change, I'm at least able to use NetConsole when CONFIG_BOOT_RETRY_TIME is defined, but only by skirting around a tstc that doesn't work very well.

Brian Prodoehl

#4 lore raw

Hi Brian,

Quoted 4 lines · Brian Prodoehl

I'm not sure which fix you mean. The fix to the sleep command corrected the time issue, but there are still underlying problems with nc_tstc. Try hitting Ctrl+C to abort the sleep. I have to hit it between 3 and 10 times before it registers.

Hmmm. With my sleep fix, this works pretty well on my test platform. The main problem seems to be, that the delay from the ethernet driver (I was using ppc4xx by the way), can range from a few ms to some 100ms or even more in your case.

What is your platform? Can you check your ethernet driver, if there are big delays or timeouts.

Quoted 16 lines

And that fix doesn't help at all with the CONFIG_BOOT_RETRY_TIME problem. I don't see any configs using NetConsole and bootretry, but I'd be interested to hear that someone has it working without having to change core code. My current fix is to change the following in main.c's readline():

	for (;;) {
- #ifdef CONFIG_BOOT_RETRY_TIME
+ #if defined(CONFIG_BOOT_RETRY_TIME) && !defined(CONFIG_NETCONSOLE)
		while (!tstc()) {	/* while no incoming data */
			if (retry_time >= 0 && get_ticks() > endtime)
				return (-2);	/* timed out */
		}
#endif
		WATCHDOG_RESET();	/* Trigger watchdog, if needed */
Quoted 3 lines

With that change, I'm at least able to use NetConsole when CONFIG_BOOT_RETRY_TIME is defined, but only by skirting around a tstc that doesn't work very well.

Yes, we should try to solve the problem itself. Seems to be not easy though. :-(

Best regards,
Stefan