[lvc-project] [PATCH v2] serial: 8250_mtk: correct max baud rate in set_termios() method

Fedor Pchelkin pchelkin at ispras.ru
Sat Oct 18 16:10:44 MSK 2025


On Sat, 18. Oct 16:08, Sergey Shtylyov wrote:
> On 10/18/25 3:57 PM, Fedor Pchelkin wrote:
> [...]
> 
> >> Mediatek MT798x datasheets (that I was able to get my hands on) claim
> >> the maximum supported baud rate to be 3 Mbps, while commit 81bb549fdf14
> >> ("serial: 8250_mtk: support big baud rate.") claimed it to be 4 Mbps --
> >> however, it then passed undivided port->uartclk to uart_get_baud_rate()
> >> for the maximum baud rate, while the datasheets do mention up to 52 MHz
> >> as the baud clock's frequency.  This means that an integer overflow will
> >> happen (when multiplying the baud variable by 256) if a baud rate higher
> >> than 16777215 bps is passed via termios->c_ospeed. Pass the correct max
> >> baud rate of 3 Mbps or port->uartclk, whichever happens to be less...
> > 
> > Кажется, на эту проблему уже ушло больше времени, чем она того заслуживает.
> > Добавлю патч с корректировкой на 4 Mbps в описании и diff'е.
> 
>    К сожалению, староый patch description больше не подойдёт. Я надеюсь
> отправить v3 сегодня...

Немного подправил его тоже.  Но если отправите v3, то добавим её. 



More information about the lvc-project mailing list