serial: core: Document lock requirement for UPF_* flags updates
authorPeter Hurley <peter@hurleysoftware.com>
Tue, 2 Sep 2014 21:39:19 +0000 (17:39 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Sep 2014 23:23:36 +0000 (16:23 -0700)
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>
include/linux/serial_core.h

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