Skip to content

Commit 2334de1

Browse files
shcgitgregkh
authored andcommitted
Revert "serial: max310x: rework RX interrupt handling"
This reverts commit fce3c5c. FIFO is triggered 4 intervals after receiving a byte, it's good when we don't care about the time of reception, but are only interested in the presence of any activity on the line. Unfortunately, this method is not suitable for all tasks, for example, the RS-485 protocol will not work properly, since the state machine must track the request-response time and after the timeout expires, a decision is made that the device on the line is not responding. Signed-off-by: Alexander Shiyan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: fce3c5c ("serial: max310x: rework RX interrupt handling") Cc: Thomas Petazzoni <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ba8a86e commit 2334de1

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

drivers/tty/serial/max310x.c

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,9 +1056,9 @@ static int max310x_startup(struct uart_port *port)
10561056
max310x_port_update(port, MAX310X_MODE1_REG,
10571057
MAX310X_MODE1_TRNSCVCTRL_BIT, 0);
10581058

1059-
/* Reset FIFOs */
1060-
max310x_port_write(port, MAX310X_MODE2_REG,
1061-
MAX310X_MODE2_FIFORST_BIT);
1059+
/* Configure MODE2 register & Reset FIFOs*/
1060+
val = MAX310X_MODE2_RXEMPTINV_BIT | MAX310X_MODE2_FIFORST_BIT;
1061+
max310x_port_write(port, MAX310X_MODE2_REG, val);
10621062
max310x_port_update(port, MAX310X_MODE2_REG,
10631063
MAX310X_MODE2_FIFORST_BIT, 0);
10641064

@@ -1086,27 +1086,8 @@ static int max310x_startup(struct uart_port *port)
10861086
/* Clear IRQ status register */
10871087
max310x_port_read(port, MAX310X_IRQSTS_REG);
10881088

1089-
/*
1090-
* Let's ask for an interrupt after a timeout equivalent to
1091-
* the receiving time of 4 characters after the last character
1092-
* has been received.
1093-
*/
1094-
max310x_port_write(port, MAX310X_RXTO_REG, 4);
1095-
1096-
/*
1097-
* Make sure we also get RX interrupts when the RX FIFO is
1098-
* filling up quickly, so get an interrupt when half of the RX
1099-
* FIFO has been filled in.
1100-
*/
1101-
max310x_port_write(port, MAX310X_FIFOTRIGLVL_REG,
1102-
MAX310X_FIFOTRIGLVL_RX(MAX310X_FIFO_SIZE / 2));
1103-
1104-
/* Enable RX timeout interrupt in LSR */
1105-
max310x_port_write(port, MAX310X_LSR_IRQEN_REG,
1106-
MAX310X_LSR_RXTO_BIT);
1107-
1108-
/* Enable LSR, RX FIFO trigger, CTS change interrupts */
1109-
val = MAX310X_IRQ_LSR_BIT | MAX310X_IRQ_RXFIFO_BIT | MAX310X_IRQ_TXEMPTY_BIT;
1089+
/* Enable RX, TX, CTS change interrupts */
1090+
val = MAX310X_IRQ_RXEMPTY_BIT | MAX310X_IRQ_TXEMPTY_BIT;
11101091
max310x_port_write(port, MAX310X_IRQEN_REG, val | MAX310X_IRQ_CTS_BIT);
11111092

11121093
return 0;

0 commit comments

Comments
 (0)