Skip to content

Commit 55796b4

Browse files
esbengregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3c199ed commit 55796b4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/tty/serial/imx.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ static void imx_uart_soft_reset(struct imx_port *sport)
370370
sport->idle_counter = 0;
371371
}
372372

373+
/* called with port.lock taken and irqs off */
373374
static void imx_uart_disable_loopback_rs485(struct imx_port *sport)
374375
{
375376
unsigned int uts;
@@ -470,6 +471,7 @@ static void imx_uart_stop_tx(struct uart_port *port)
470471
}
471472
}
472473

474+
/* called with port.lock taken and irqs off */
473475
static void imx_uart_stop_rx_with_loopback_ctrl(struct uart_port *port, bool loopback)
474476
{
475477
struct imx_port *sport = to_imx_port(port);
@@ -803,6 +805,8 @@ static irqreturn_t imx_uart_txint(int irq, void *dev_id)
803805
* issuing soft reset to the UART (just stop/start of RX does not help). Note
804806
* that what we do here is sending isolated start bit about 2.4 times shorter
805807
* than it is to be on UART configured baud rate.
808+
*
809+
* Called with port.lock taken and irqs off.
806810
*/
807811
static void imx_uart_check_flood(struct imx_port *sport, u32 usr2)
808812
{
@@ -838,6 +842,7 @@ static void imx_uart_check_flood(struct imx_port *sport, u32 usr2)
838842
}
839843
}
840844

845+
/* called with port.lock taken and irqs off */
841846
static irqreturn_t __imx_uart_rxint(int irq, void *dev_id)
842847
{
843848
struct imx_port *sport = dev_id;
@@ -916,6 +921,7 @@ static void imx_uart_clear_rx_errors(struct imx_port *sport);
916921
/*
917922
* We have a modem side uart, so the meanings of RTS and CTS are inverted.
918923
*/
924+
/* called with port.lock taken and irqs off */
919925
static unsigned int imx_uart_get_hwmctrl(struct imx_port *sport)
920926
{
921927
unsigned int tmp = TIOCM_DSR;
@@ -938,6 +944,8 @@ static unsigned int imx_uart_get_hwmctrl(struct imx_port *sport)
938944

939945
/*
940946
* Handle any change of modem status signal since we were last called.
947+
*
948+
* Called with port.lock taken and irqs off.
941949
*/
942950
static void imx_uart_mctrl_check(struct imx_port *sport)
943951
{
@@ -1277,6 +1285,7 @@ static int imx_uart_start_rx_dma(struct imx_port *sport)
12771285
return 0;
12781286
}
12791287

1288+
/* called with port.lock taken and irqs off */
12801289
static void imx_uart_clear_rx_errors(struct imx_port *sport)
12811290
{
12821291
struct tty_port *port = &sport->port.state->port;
@@ -1407,6 +1416,7 @@ static int imx_uart_dma_init(struct imx_port *sport)
14071416
return ret;
14081417
}
14091418

1419+
/* called with port.lock taken and irqs off */
14101420
static void imx_uart_enable_dma(struct imx_port *sport)
14111421
{
14121422
u32 ucr1;

0 commit comments

Comments
 (0)