[PATCH] hvc_console: fix dropping of characters when output byte channel is full

Andrew Morton akpm at linux-foundation.org
Wed Sep 15 05:17:21 EST 2010


On Fri, 20 Aug 2010 13:45:21 -0500
Timur Tabi <timur at freescale.com> wrote:

> hvc_console_print() calls the HVC client driver's put_chars() callback
> to write some characters to the console.  If the callback returns 0, that
> indicates that no characters were written (perhaps the output buffer is
> full), but hvc_console_print() treats that as an error and discards the
> rest of the buffer.
> 
> So change hvc_console_print() to just loop and call put_chars() again if it
> returns a 0 return code.

Seems rather dangerous.  The upper layer will sit there chewing 100%
CPU for as long as the lower layer is congested.

> This change makes hvc_console_print() behave more like hvc_push(), which
> does check for a 0 return code and re-schedules itself.

Yes, hvc_push() reschedules.  It doesn't sit in a tight loop burning
electrons!

Can we do something safer&smarter here?


More information about the Linuxppc-dev mailing list