All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Russell King <rmk+lkml@arm.linux.org.uk>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	linux-serial@vger.kernel.org
Subject: Re: Serial 8250: clear the lsr_break_flag at open
Date: Thu, 03 May 2007 22:43:19 -0500	[thread overview]
Message-ID: <463AABD7.7090903@acm.org> (raw)
In-Reply-To: <20070503120815.GA21024@flint.arm.linux.org.uk>

Russell King wrote:
>
> The backup code is something I never properly reviewed, so no comments
> there.  The tx_empty code I assumed would be a relatively rare event,
> except when closing the port (at which point you don't particularly care
> about errors anyway, not even the break flag since chances are you'll
> miss the following character.)
>   
That "if" statement in the backup code does look a little dodgy, more
than is perhaps required.  I think it's correct, but I need to add
a lock there in my patch to protect the LSR check.
> Given that people might want to poll it for various reasons, I guess
> saving the status away should be done.  However, there's a slight issue
> with working out which character the error is associated with.  Careful
> locking may be the answer to that though.
>   
I think as long as you hold the port lock while you grab the LSR and
set the saved flags it will work.
> As for start_tx, yes, though slightly harder to check.  Maybe the code
> should be modified to reduce the number of potential LSR reads by reading
> the IIR first, and only if that shows no interrupt pending should the LSR
> be read (and the error flags remembered.)
>   
The version of start_tx in 2.6.21 does check IIR first, and it only
checks the LSR if UART_BUG_TXEN is set, so I assume that's not
a big deal.

I'll sleep on it tonight, look it over tomorrow morning, and resend the
patch.

Thanks,

-corey

      reply	other threads:[~2007-05-04  3:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30 22:08 Serial 8250: clear the lsr_break_flag at open Corey Minyard
2007-05-01  9:29 ` Russell King
2007-05-01 13:23   ` Corey Minyard
2007-05-03 12:08     ` Russell King
2007-05-04  3:43       ` Corey Minyard [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=463AABD7.7090903@acm.org \
    --to=minyard@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.