From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] serial: pl011: safeguard against impossible baudrates
Date: Thu, 20 Sep 2012 19:57:48 +0100 [thread overview]
Message-ID: <20120920185748.GA15609@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1348134346-25593-1-git-send-email-linus.walleij@stericsson.com>
On Thu, Sep 20, 2012 at 11:45:46AM +0200, Linus Walleij wrote:
> + if ((termios->c_ispeed > max_baud) ||
> + (termios->c_ospeed > max_baud)) {
> + dev_err(port->dev,
> + "requested a baud rate > clock/mindivisor\n");
> + return;
> + }
Why do we need this check? In any case, this is incorrect behaviour
just to 'return' from this function without doing anything. You just
produce an error message, and userspace believes that it's request
has been satisfied.
uart_get_baud_rate() is there precisely to do the right thing for invalid
baud rates, which is to fallback to the old termios setting (and update
the new termios with that) if the old termios setting satisifies the
limits, if not it falls back to something within the limited range.
next prev parent reply other threads:[~2012-09-20 18:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-20 9:45 [PATCH 1/3] serial: pl011: safeguard against impossible baudrates Linus Walleij
2012-09-20 18:57 ` Russell King - ARM Linux [this message]
2012-09-21 8:26 ` Linus Walleij
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=20120920185748.GA15609@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).