[PATCH 10/26] serial: core: Document lock requirement for UPF_* flags updates

From: Peter Hurley
Date: Tue Sep 02 2014 - 18:13:41 EST


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@xxxxxxxxxxxxxxxxxx>
---
include/linux/serial_core.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 5bbb809..4a43292 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -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))
--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/