public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Timur Tabi <timur@freescale.com>,
	linuxppc-dev@ozlabs.org, brueckner@linux.vnet.ibm.com,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] hvc_console: returning 0 from put_chars is not an error
Date: Thu, 15 Oct 2009 11:09:06 -0500	[thread overview]
Message-ID: <20091015160906.GA3730@loki.buserror.net> (raw)
In-Reply-To: <200910151305.47100.borntraeger@de.ibm.com>

On Thu, Oct 15, 2009 at 01:05:47PM +0200, Christian Borntraeger wrote:
> The fact that struct console->write returns void indicates that the console 
> layer is not interested in errors. We have two policies we can implement:
> 
> 1. drop console messages if case of congestion but keep the system going
> 2. dont drop messages and wait, even if the system might come to a complete stop 
> 
> Looking at drivers/char/vt.c 
>         /* console busy or not yet initialized */
>         if (!printable)
>                 return;
>         if (!spin_trylock(&printing_lock))
>                 return;
> could mean that  Linux consoles should not block.

That's a bit different -- the code above is testing for potential deadlocks
within Linux (or a not-yet-initialized console), not a device that has yet
to process the last batch of characters we threw at it.  Plus, given the
"console must be locked when we get here" comment, I'm not sure that you'll
ever see contention on printing_lock?

Serial consoles currently block when waiting for the buffer to drain:

static void serial8250_console_putchar(struct uart_port *port, int ch)
{
	struct uart_8250_port *up = (struct uart_8250_port *)port;

	wait_for_xmitr(up, UART_LSR_THRE);
	serial_out(up, UART_TX, ch);
}


-Scott

  reply	other threads:[~2009-10-15 16:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1255557226-4403-1-git-send-email-timur@freescale.com>
2009-10-15 11:05 ` [PATCH] hvc_console: returning 0 from put_chars is not an error Christian Borntraeger
2009-10-15 16:09   ` Scott Wood [this message]
2009-10-15 18:41     ` Christian Borntraeger
2009-10-15 18:55       ` Timur Tabi
2009-10-15 18:57       ` Scott Wood
2009-10-15 19:26         ` Christian Borntraeger
2009-10-15 19:32           ` Scott Wood
2009-10-16  8:49             ` Hendrik Brueckner
2009-10-17 23:17               ` Timur Tabi
2009-10-16  4:46         ` Benjamin Herrenschmidt
2009-10-16 15:33           ` Scott Wood
2009-10-16 18:03             ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091015160906.GA3730@loki.buserror.net \
    --to=scottwood@freescale.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=borntraeger@de.ibm.com \
    --cc=brueckner@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=timur@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox