linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Alan Cox <alan@linux.intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linus Walleij <linus.walleij@stericsson.com>,
	linux-serial@vger.kernel.org,
	Guillaume Jaunet <guillaume.jaunet@stericsson.com>,
	Par-Gunnar Hjalmdahl <par-gunnar.hjalmdahl@stericsson.com>,
	Anmar Oueja <anmar.oueja@linaro.org>,
	Matthias Locher <matthias.locher@stericsson.com>,
	"Rajanikanth H.V" <rajanikanth.hv@stericsson.com>,
	Christophe Arnal <christophe.arnal@stericsson.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] serial: pl011: allow very high baudrates
Date: Fri, 21 Sep 2012 16:06:56 +0100	[thread overview]
Message-ID: <20120921150656.GG15609@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20120921160503.53736fee@pyramind.ukuu.org.uk>

On Fri, Sep 21, 2012 at 04:05:03PM +0100, Alan Cox wrote:
> > Alan - the only issue that remains is handling the invalid baud rate
> > situation - if left to individual drivers to do this, we will see them
> > doing stuff (as was the case with this very patch - and was the case
> > prior to serial_core) such as using dev_err() to print an error and
> > merely returning from their set_termios function, or clamping to some
> > speed and not feeding back to userspace what they're actually doing.
> 
> They've had years to adapt. It's time they got with the program or just
> broke horribly.

Sorry Alan, I don't think you really understand what I'm saying.

In the old days, lots of serial drivers just ignored termios settings
that they didn't support, or baud rates that they didn't know about -
so when userspace requests, eg 4Mbps on a UART port, the ioctl didn't
fail, and getting the termios back reported 4Mbps.

That is in violation of the POSIX general terminal interface standard,
and is something that I fixed with the uart baud rate functions - which
most serial_core using drivers are using.

Now you're pushing that logic back down into drivers, where driver authors
have to understand these details again, and that's precisely the reverse
of what should be happening.  We should be helping driver authors get
things right by providing helpers to do that, which is exactly what has
been done.

We need helper functions so we don't end up with 10s of buggy
implementations of the same calculation of baud rate quotient, which
each do their own range checking, and then go on to set some random
unreported-back-to-userspace baud rate.

  reply	other threads:[~2012-09-21 15:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20  9:46 [PATCH 3/3] serial: pl011: allow very high baudrates Linus Walleij
2012-09-20 19:00 ` Russell King - ARM Linux
2012-09-21 13:41   ` Linus Walleij
2012-09-21 14:37     ` Alan Cox
2012-09-21 14:58       ` Russell King - ARM Linux
2012-09-21 15:05         ` Alan Cox
2012-09-21 15:06           ` Russell King - ARM Linux [this message]
2012-09-21 15:36             ` Alan Cox
2012-09-21 15:14     ` Alan Cox
2012-09-21 15:25     ` Alan Cox
2012-09-21 17:52       ` Linus Walleij
2012-09-21 19:56         ` Alan Cox
2012-09-21 20:34           ` Russell King - ARM Linux
2012-09-21 20:55             ` Alan Cox
2012-09-25 18:48           ` Linus Walleij
2012-09-25 19:00             ` Alan Cox
2012-09-26  8:06             ` Linus Walleij
2012-09-26 10:04               ` Alan Cox

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=20120921150656.GG15609@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=alan@linux.intel.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=anmar.oueja@linaro.org \
    --cc=christophe.arnal@stericsson.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guillaume.jaunet@stericsson.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=matthias.locher@stericsson.com \
    --cc=par-gunnar.hjalmdahl@stericsson.com \
    --cc=rajanikanth.hv@stericsson.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;
as well as URLs for NNTP newsgroup(s).