Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: James Courtier-Dutton <james.dutton@gmail.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	linux-serial@vger.kernel.org, Chanho Min <chanho0207@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	Jong-Sung Kim <neidhard.kim@lge.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	stable@kernel.org,
	Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com>
Subject: Re: [PATCH] serial: PL011: clear pending interrupts
Date: Mon, 12 Mar 2012 10:03:45 +0000	[thread overview]
Message-ID: <20120312100345.GX17370@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CAAMvbhF7-5FyzjgtK7EjFZSJg4KBxdMdd1jnTRTLA-LnsVhKyw@mail.gmail.com>

On Mon, Mar 12, 2012 at 09:27:28AM +0000, James Courtier-Dutton wrote:
> On 12 March 2012 08:25, Linus Walleij <linus.walleij@stericsson.com> wrote:
> > From: Linus Walleij <linus.walleij@linaro.org>
> >
> > Chanho Min reported that when the boot loader transfers
> > control to the kernel, there may be pending interrupts
> > causing the UART to lock up in an eternal loop trying to
> > pick tokens from the FIFO (since the RX interrupt flag
> > indicates there are tokens) while in practice there are
> > no tokens - in fact there is only a pending IRQ flag.
> >
> 
> I might be off base here, because I don't know this particular UART,
> but if an IRQ routine is called because the RX interrupt flag is set,
> shouldn't the IRQ routine be written in such a way that it can never
> lock up.

The problem is that there are two flags:

1. The receiver interrupt status flags
2. The fifo status flags

It appears that there's a condition where the receiver interrupt flags can
indicate that characters are pending, but the status flags say that there
are no characters pending in the receive buffer.

This occurs because it seems there's a hardware bug when switching from
FIFO mode to non-FIFO mode - this causes previously received characters
to be hidden from the FIFO status flags.

      reply	other threads:[~2012-03-12 10:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12  8:25 [PATCH] serial: PL011: clear pending interrupts Linus Walleij
2012-03-12  8:32 ` Russell King - ARM Linux
2012-03-12 10:11   ` Russell King - ARM Linux
2012-03-12 10:48     ` Linus Walleij
2012-03-12 11:28     ` Kim, Jong-Sung
2012-03-12 11:22   ` Kim, Jong-Sung
2012-03-12 11:28     ` Russell King - ARM Linux
2012-03-12  9:27 ` James Courtier-Dutton
2012-03-12 10:03   ` Russell King - ARM Linux [this message]

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=20120312100345.GX17370@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=chanho0207@gmail.com \
    --cc=gregkh@suse.de \
    --cc=james.dutton@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=neidhard.kim@lge.com \
    --cc=shreshthakumar.sahu@stericsson.com \
    --cc=stable@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