From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: linux-serial@vger.kernel.org,
Greg KH <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH 9/9] pcmcia: synclink_cs: Don't allow CS5-6
Date: Tue, 17 May 2022 14:07:37 +0300 [thread overview]
Message-ID: <20220517110737.37148-10-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20220517110737.37148-1-ilpo.jarvinen@linux.intel.com>
Only CS7 and CS8 seem supported but CSIZE was not sanitized in termios
c_cflag. The driver sets 7 bits whenever data_bits is not 8 so default
to CS7 when CSIZE is not CS8.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/char/pcmcia/synclink_cs.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 78baba55a8b5..d0572bbe8832 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -1418,7 +1418,11 @@ static void mgslpc_change_params(MGSLPC_INFO *info, struct tty_struct *tty)
info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
/* byte size and parity */
-
+ if ((cflag & CSIZE) != CS8) {
+ cflag &= ~CSIZE;
+ cflag |= CS7;
+ tty->termios.c_cflag = cflag;
+ }
info->params.data_bits = tty_get_char_size(cflag);
if (cflag & CSTOPB)
--
2.30.2
prev parent reply other threads:[~2022-05-17 11:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220517110737.37148-1-ilpo.jarvinen@linux.intel.com>
2022-05-17 11:07 ` [PATCH 1/9] serial: uartline: Fix BRKINT clearing Ilpo Järvinen
2022-05-17 14:33 ` Sean Anderson
2022-05-18 12:18 ` Shubhrajyoti Datta
2022-05-18 12:25 ` Ilpo Järvinen
2022-05-17 11:07 ` [PATCH 2/9] serial: digicolor-usart: Don't allow CS5-6 Ilpo Järvinen
2022-05-18 4:16 ` Baruch Siach
2022-05-17 11:07 ` [PATCH 3/9] serial: rda-uart: " Ilpo Järvinen
2022-05-17 11:07 ` [PATCH 4/9] serial: txx9: " Ilpo Järvinen
2022-05-17 11:07 ` [PATCH 5/9] serial: sh-sci: " Ilpo Järvinen
2022-05-17 11:07 ` [PATCH 6/9] serial: sifive: Sanitize CSIZE and c_iflag Ilpo Järvinen
2022-05-17 11:07 ` [PATCH 7/9] serial: st-asc: Sanitize CSIZE and correct PARENB for CS7 Ilpo Järvinen
2022-05-17 11:07 ` [PATCH 8/9] serial: stm32-usart: Correct CSIZE, bits, and parity Ilpo Järvinen
2022-05-17 11:07 ` Ilpo Järvinen [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=20220517110737.37148-10-ilpo.jarvinen@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.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