public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Gerd Hoffmann <kraxel@suse.de>, Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [patch] serial: fix UART_BUG_TXEN test
Date: Wed, 12 Apr 2006 10:26:31 +0100	[thread overview]
Message-ID: <20060412092631.GA25799@flint.arm.linux.org.uk> (raw)
In-Reply-To: <44339A8F.7030305@suse.de>

On Wed, Apr 05, 2006 at 12:23:11PM +0200, Gerd Hoffmann wrote:
> There is a bug in the UART_BUG_TXEN test: It gives false positives in
> case the UART_IER_THRI bit is set.  Fixed by explicitly clearing the
> UART_IER register first.
> 
> It may trigger with an active serial console as serial console writes
> set the UART_IER_THRI bit.

Actually, I think Alan's (f91a3715db2bb44fcf08cec642e68f919b70f7f4)
idea of setting UART_IER_THRI after serial console writes is buggy.
If the serial port being used as a console is sharing its interrupt
line with other devices, then there's the very real possibility for
causing spurious interrupts.

I think that's what needs to be fixed rather than working around this
potentially buggy behaviour.

Maybe we have no option but to take the spinlock in the serial console
code, and suck it if we oops with that spinlock held.

> Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
> --- linux-2.6.16/drivers/serial/8250.c.serial	2006-04-05 12:04:31.000000000 +0200
> +++ linux-2.6.16/drivers/serial/8250.c	2006-04-05 12:04:49.000000000 +0200
> @@ -1712,6 +1712,7 @@
>  	 * Do a quick test to see if we receive an
>  	 * interrupt when we enable the TX irq.
>  	 */
> +	serial_outp(up, UART_IER, 0);
>  	serial_outp(up, UART_IER, UART_IER_THRI);
>  	lsr = serial_in(up, UART_LSR);
>  	iir = serial_in(up, UART_IIR);


-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

  reply	other threads:[~2006-04-12  9:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-05 10:23 [patch] serial: fix UART_BUG_TXEN test Gerd Hoffmann
2006-04-12  9:26 ` Russell King [this message]
2006-05-07  8:24   ` Russell King

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=20060412092631.GA25799@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=kraxel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /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