lkml.org 
[lkml]   [2023]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 1/5] serial: core: tidy invalid baudrate handling in uart_get_baud_rate
On Thu, Sep 28, 2023 at 11:34 PM Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com> wrote:
> While looking into this, I found this old commit:
>
> commit 16ae2a877bf4179737921235e85ceffd7b79354f
> Author: Alan Cox <alan@linux.intel.com>
> Date: Mon Jan 4 16:26:21 2010 +0000
>
> serial: Fix crash if the minimum rate of the device is > 9600 baud
>
> In that situation if the old rate is invalid and the new rate is invalid
> and the chip cannot do 9600 baud we report zero, which makes all the
> drivers explode.
>
> Instead force the rate based on min/max
>
> But for some reason it does not work as advertized here? What is the exact
> cause for that?

In my case I see that tty_termios_encode_baud_rate() is called with
ibaud == obaud == 9769, but it finds the closest rate 9600, which is
within 2% of the actual minimum, but is outside the min/max range
supported by the hardware.

> Is something wrong with how min/max have that +1/-1 there or what?

--
Thanks.
-- Max

\
 
 \ /
  Last update: 2023-09-29 21:27    [W:0.117 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site