Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial: imx: Add more comments on port lock status

Comments regarding status of port.lock on internal functions is useful when
reviewing correct handling of registers that must be protected by this
lock.

Signed-off-by: Esben Haabendal <esben@geanix.com>
Link: https://lore.kernel.org/r/20240913-serial-imx-lockfix-v1-2-4d102746c89d@geanix.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Esben Haabendal and committed by
Greg Kroah-Hartman
55796b4e 3c199ed5

+10
+10
drivers/tty/serial/imx.c
··· 370 370 sport->idle_counter = 0; 371 371 } 372 372 373 + /* called with port.lock taken and irqs off */ 373 374 static void imx_uart_disable_loopback_rs485(struct imx_port *sport) 374 375 { 375 376 unsigned int uts; ··· 471 470 } 472 471 } 473 472 473 + /* called with port.lock taken and irqs off */ 474 474 static void imx_uart_stop_rx_with_loopback_ctrl(struct uart_port *port, bool loopback) 475 475 { 476 476 struct imx_port *sport = to_imx_port(port); ··· 805 803 * issuing soft reset to the UART (just stop/start of RX does not help). Note 806 804 * that what we do here is sending isolated start bit about 2.4 times shorter 807 805 * than it is to be on UART configured baud rate. 806 + * 807 + * Called with port.lock taken and irqs off. 808 808 */ 809 809 static void imx_uart_check_flood(struct imx_port *sport, u32 usr2) 810 810 { ··· 842 838 } 843 839 } 844 840 841 + /* called with port.lock taken and irqs off */ 845 842 static irqreturn_t __imx_uart_rxint(int irq, void *dev_id) 846 843 { 847 844 struct imx_port *sport = dev_id; ··· 921 916 /* 922 917 * We have a modem side uart, so the meanings of RTS and CTS are inverted. 923 918 */ 919 + /* called with port.lock taken and irqs off */ 924 920 static unsigned int imx_uart_get_hwmctrl(struct imx_port *sport) 925 921 { 926 922 unsigned int tmp = TIOCM_DSR; ··· 944 938 945 939 /* 946 940 * Handle any change of modem status signal since we were last called. 941 + * 942 + * Called with port.lock taken and irqs off. 947 943 */ 948 944 static void imx_uart_mctrl_check(struct imx_port *sport) 949 945 { ··· 1285 1277 return 0; 1286 1278 } 1287 1279 1280 + /* called with port.lock taken and irqs off */ 1288 1281 static void imx_uart_clear_rx_errors(struct imx_port *sport) 1289 1282 { 1290 1283 struct tty_port *port = &sport->port.state->port; ··· 1416 1407 return ret; 1417 1408 } 1418 1409 1410 + /* called with port.lock taken and irqs off */ 1419 1411 static void imx_uart_enable_dma(struct imx_port *sport) 1420 1412 { 1421 1413 u32 ucr1;