mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tobias Schramm <t.schramm@manjaro.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Richard Genoud <richard.genoud@gmail.com>,
	Jiri Slaby <jirislaby@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] serial: atmel: fix incorrect baudrate setup
Date: Mon, 9 Jan 2023 08:22:36 +0100	[thread overview]
Message-ID: <ca5e2372-073d-b501-dd5b-0e9d815ab9b2@manjaro.org> (raw)
In-Reply-To: <Y7u9SAX++YsXvnVC@kroah.com>


Am 09.01.23 um 08:07 schrieb Greg Kroah-Hartman:
> On Mon, Jan 09, 2023 at 08:02:00AM +0100, Tobias Schramm wrote:
>> Commit ba47f97a18f2 ("serial: core: remove baud_rates when serial console
>> setup") changed uart_set_options to select the correct baudrate
>> configuration based on the absolute error between requested baudrate and
>> available standard baudrate settings.
>> Prior to that commit the baudrate was selected based on which predefined
>> standard baudrate did not exceed the requested baudrate.
>> This change of selection logic was never reflected in the atmel serial
>> driver. Thus the comment left in the atmel serial driver is no longer
>> accurate.
>> Additionally the manual rounding up described in that comment and applied
>> via (quot - 1) requests an incorrect baudrate. Since uart_set_options uses
>> tty_termios_encode_baud_rate to determine the appropriate baudrate flags
>> this can cause baudrate selection to fail entirely because
>> tty_termios_encode_baud_rate will only select a baudrate if relative error
>> between requested and selected baudrate does not exceed +/-2%.
>> Fix that by requesting actual, exact baudrate used by the serial.
>>
>> Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
>> ---
> What commit id does this fix?  Please list that as a the "Fixes:" tag.

Commit ba47f97a18f2 ("serial: core: remove baud_rates when serial console
setup") is the one that breaks the assumptions made in the driver.
I'll send a v2 and include that.

>
> Also, does this need to go to older/stable kernels?
Yep,  this should go to older kernels as a fix, too.
>
> thanks,
>
> greg k-h

      reply	other threads:[~2023-01-09  7:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09  7:02 Tobias Schramm
2023-01-09  7:07 ` Greg Kroah-Hartman
2023-01-09  7:22   ` Tobias Schramm [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=ca5e2372-073d-b501-dd5b-0e9d815ab9b2@manjaro.org \
    --to=t.schramm@manjaro.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=richard.genoud@gmail.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

all inboxes | Powered by JetHome®