提交 a91031d2 编写于 作者: I Ilpo Järvinen 提交者: Zheng Zengkai

serial: digicolor-usart: Don't allow CS5-6

stable inclusion
from stable-v5.10.122
commit ff4ce2979b5d9e405af72260553531c86cfe8ffb
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5W6OE

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ff4ce2979b5d9e405af72260553531c86cfe8ffb

--------------------------------

[ Upstream commit fd63031b ]

Only CS7 and CS8 seem supported but CSIZE is not sanitized to CS8 in
the default: block.

Set CSIZE correctly so that userspace knows the effective value.
Incorrect CSIZE also results in miscalculation of the frame bits in
tty_get_char_size() or in its predecessor where the roughly the same
code is directly within uart_update_timeout().

Fixes: 5930cb35 (serial: driver for Conexant Digicolor USART)
Acked-by: NBaruch Siach <baruch@tkos.co.il>
Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220519081808.3776-3-ilpo.jarvinen@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 3c2b72f4
...@@ -309,6 +309,8 @@ static void digicolor_uart_set_termios(struct uart_port *port, ...@@ -309,6 +309,8 @@ static void digicolor_uart_set_termios(struct uart_port *port,
case CS8: case CS8:
default: default:
config |= UA_CONFIG_CHAR_LEN; config |= UA_CONFIG_CHAR_LEN;
termios->c_cflag &= ~CSIZE;
termios->c_cflag |= CS8;
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册