[U-Boot] [PATCH v2] ns16550: Add WATCHDOG_RESET to putc for short watchdog timeout boards

Stefan Roese sr at denx.de
Thu Oct 7 15:18:11 CEST 2010


Hi Wolfgang,

On Thursday 07 October 2010 14:23:52 Wolfgang Denk wrote:
> > Back to the problem: How about moving the watchdog_reset call to
> > serial_puts() in common/serial.c? Or do you have another (better) idea
> > in mind?
> 
> Are you really sure this is the right place, i. e. this is where the
> problem happens?
> 
> I doubt that.
> 
> lwmon5 which has this nasty 100 ms watchdog (actually 80 ms including
> allowable tolerances, IIRC) is running at 115bps.
> 
> In theory, it would take a string of more than 900 characters for
> puts() to exceeding this delay, but all strings ever printed in U-Boot
> are way shorter.
> 
> That's why I ask again: are you sure it's puts() that is causing such
> long delays? Or should the watchdog triggering better happen somewhere
> else?

As mentioned before, lwmon5 reset upon commands with very long output, like 
printenv (with big environment), "fdt print", or "flinfo". Those commands can 
easily trigger output with more than 50 lines.

I tested again and have seen that lwmon5 currently resets upon approx. 20 
lines of output. With an average of 50 chars per line thats 1000 chars. Pretty 
close to your 900 chars mentioned above. So yes, I'm sure that these reset 
result from the long serial output, where the CPU is mostly polling for the TX 
FIFO to become empty again.
  
> If you want to go with the triggering in  serial_puts(), you probably
> either want to trigger unconditionally, before or after each call to
> puts().  The counter based approach makes no sense to me.

OK.

Cheers,
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


More information about the U-Boot mailing list