Browse Source

serial: core: Document lock requirement for UPF_* flags updates

The flags field of struct uart_port can only be safely modified
if the port mutex is held; no other lock prevents concurrent
changes from corrupting the field.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peter Hurley 11 years ago
parent
commit
8a949b07e4
1 changed files with 1 additions and 0 deletions
  1. 1 0
      include/linux/serial_core.h

+ 1 - 0
include/linux/serial_core.h

@@ -152,6 +152,7 @@ struct uart_port {
 	unsigned long		sysrq;			/* sysrq timeout */
 	unsigned long		sysrq;			/* sysrq timeout */
 #endif
 #endif
 
 
+	/* flags must be updated while holding port mutex */
 	upf_t			flags;
 	upf_t			flags;
 
 
 #define UPF_FOURPORT		((__force upf_t) (1 << 1))
 #define UPF_FOURPORT		((__force upf_t) (1 << 1))