linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] serial: 8250: move rx_running out of the bitfield
@ 2015-07-30 22:54 John Ogness
  2015-07-30 23:24 ` Peter Hurley
  0 siblings, 1 reply; 2+ messages in thread
From: John Ogness @ 2015-07-30 22:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Tony Lindgren, Peter Hurley,
	Sebastian Andrzej Siewior, linux-omap, nsekhar, tony, nm,
	linux-serial

That bitfield is modified by read + or + write operation. If someone
sets any of the other two bits it might render the lock useless.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/tty/serial/8250/8250.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
index c43f74c..78f5e3a 100644
--- a/drivers/tty/serial/8250/8250.h
+++ b/drivers/tty/serial/8250/8250.h
@@ -44,7 +44,7 @@ struct uart_8250_dma {
 
 	unsigned char		tx_running:1;
 	unsigned char		tx_err: 1;
-	unsigned char		rx_running:1;
+	unsigned char		rx_running;
 };
 
 struct old_serial_port {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/3] serial: 8250: move rx_running out of the bitfield
  2015-07-30 22:54 [PATCH 2/3] serial: 8250: move rx_running out of the bitfield John Ogness
@ 2015-07-30 23:24 ` Peter Hurley
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Hurley @ 2015-07-30 23:24 UTC (permalink / raw)
  To: John Ogness, linux-kernel
  Cc: Greg Kroah-Hartman, Tony Lindgren, Sebastian Andrzej Siewior,
	linux-omap, nsekhar, nm, linux-serial

On 07/30/2015 06:54 PM, John Ogness wrote:
> That bitfield is modified by read + or + write operation. If someone
> sets any of the other two bits it might render the lock useless.

Good catch.
Let's just make all of the fields not bitfield though.

Regards,
Peter Hurley

> Signed-off-by: John Ogness <john.ogness@linutronix.de>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  drivers/tty/serial/8250/8250.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
> index c43f74c..78f5e3a 100644
> --- a/drivers/tty/serial/8250/8250.h
> +++ b/drivers/tty/serial/8250/8250.h
> @@ -44,7 +44,7 @@ struct uart_8250_dma {
>  
>  	unsigned char		tx_running:1;
>  	unsigned char		tx_err: 1;
> -	unsigned char		rx_running:1;
> +	unsigned char		rx_running;
>  };
>  
>  struct old_serial_port {
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-30 23:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-30 22:54 [PATCH 2/3] serial: 8250: move rx_running out of the bitfield John Ogness
2015-07-30 23:24 ` Peter Hurley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).