2022-05-18 03:27:44

by Ilpo Järvinen

[permalink] [raw]
Subject: [PATCH 1/9] serial: uartline: Fix BRKINT clearing

BRKINT is within c_iflag rather than c_cflag.

Cc: Sean Anderson <[email protected]>
Fixes: ea017f5853e9 (tty: serial: uartlite: Prevent changing fixed parameters)
Signed-off-by: Ilpo Järvinen <[email protected]>
---
drivers/tty/serial/uartlite.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index 007db67292a2..880e2afbb97b 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -321,7 +321,8 @@ static void ulite_set_termios(struct uart_port *port, struct ktermios *termios,
struct uartlite_data *pdata = port->private_data;

/* Set termios to what the hardware supports */
- termios->c_cflag &= ~(BRKINT | CSTOPB | PARENB | PARODD | CSIZE);
+ termios->c_iflag &= ~BRKINT;
+ termios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CSIZE);
termios->c_cflag |= pdata->cflags & (PARENB | PARODD | CSIZE);
tty_termios_encode_baud_rate(termios, pdata->baud, pdata->baud);

--
2.30.2



2022-05-18 04:05:09

by Sean Anderson

[permalink] [raw]
Subject: Re: [PATCH 1/9] serial: uartline: Fix BRKINT clearing



On 5/17/22 7:07 AM, Ilpo Järvinen wrote:
> BRKINT is within c_iflag rather than c_cflag.
>
> Cc: Sean Anderson <[email protected]>
> Fixes: ea017f5853e9 (tty: serial: uartlite: Prevent changing fixed parameters)
> Signed-off-by: Ilpo Järvinen <[email protected]>
> ---
> drivers/tty/serial/uartlite.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
> index 007db67292a2..880e2afbb97b 100644
> --- a/drivers/tty/serial/uartlite.c
> +++ b/drivers/tty/serial/uartlite.c
> @@ -321,7 +321,8 @@ static void ulite_set_termios(struct uart_port *port, struct ktermios *termios,
> struct uartlite_data *pdata = port->private_data;
>
> /* Set termios to what the hardware supports */
> - termios->c_cflag &= ~(BRKINT | CSTOPB | PARENB | PARODD | CSIZE);
> + termios->c_iflag &= ~BRKINT;
> + termios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CSIZE);
> termios->c_cflag |= pdata->cflags & (PARENB | PARODD | CSIZE);
> tty_termios_encode_baud_rate(termios, pdata->baud, pdata->baud);
>
>

Reviewed-by: Sean Anderson <[email protected]>

2022-05-18 12:24:42

by Shubhrajyoti Datta

[permalink] [raw]
Subject: Re: [PATCH 1/9] serial: uartline: Fix BRKINT clearing

On Tue, May 17, 2022 at 5:58 PM Ilpo Järvinen
<[email protected]> wrote:
>
> BRKINT is within c_iflag rather than c_cflag.
Nit typo in the subject line.


>
> Cc: Sean Anderson <[email protected]>
> Fixes: ea017f5853e9 (tty: serial: uartlite: Prevent changing fixed parameters)
> Signed-off-by: Ilpo Järvinen <[email protected]>
> ---
> drivers/tty/serial/uartlite.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
> index 007db67292a2..880e2afbb97b 100644
> --- a/drivers/tty/serial/uartlite.c
> +++ b/drivers/tty/serial/uartlite.c
> @@ -321,7 +321,8 @@ static void ulite_set_termios(struct uart_port *port, struct ktermios *termios,
> struct uartlite_data *pdata = port->private_data;
>
> /* Set termios to what the hardware supports */
> - termios->c_cflag &= ~(BRKINT | CSTOPB | PARENB | PARODD | CSIZE);
> + termios->c_iflag &= ~BRKINT;
> + termios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CSIZE);
> termios->c_cflag |= pdata->cflags & (PARENB | PARODD | CSIZE);
> tty_termios_encode_baud_rate(termios, pdata->baud, pdata->baud);
>
> --
> 2.30.2
>

2022-05-18 12:25:59

by Ilpo Järvinen

[permalink] [raw]
Subject: Re: [PATCH 1/9] serial: uartline: Fix BRKINT clearing

On Wed, 18 May 2022, Shubhrajyoti Datta wrote:

> On Tue, May 17, 2022 at 5:58 PM Ilpo Järvinen
> <[email protected]> wrote:
> >
> > BRKINT is within c_iflag rather than c_cflag.
> Nit typo in the subject line.

Indeed, good catch. Even after you pointed it out, it was still hard to
spot what was wrong with it.

Thanks.

--
i.

> > Cc: Sean Anderson <[email protected]>
> > Fixes: ea017f5853e9 (tty: serial: uartlite: Prevent changing fixed parameters)
> > Signed-off-by: Ilpo Järvinen <[email protected]>
> > ---
> > drivers/tty/serial/uartlite.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
> > index 007db67292a2..880e2afbb97b 100644
> > --- a/drivers/tty/serial/uartlite.c
> > +++ b/drivers/tty/serial/uartlite.c
> > @@ -321,7 +321,8 @@ static void ulite_set_termios(struct uart_port *port, struct ktermios *termios,
> > struct uartlite_data *pdata = port->private_data;
> >
> > /* Set termios to what the hardware supports */
> > - termios->c_cflag &= ~(BRKINT | CSTOPB | PARENB | PARODD | CSIZE);
> > + termios->c_iflag &= ~BRKINT;
> > + termios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CSIZE);
> > termios->c_cflag |= pdata->cflags & (PARENB | PARODD | CSIZE);
> > tty_termios_encode_baud_rate(termios, pdata->baud, pdata->baud);
> >
> > --
> > 2.30.2
> >
>