Skip to content

Commit 0ab84da

Browse files
Aaron Sierragregkh
authored andcommitted
serial: 8250: Preserve DLD[7:4] for PORT_XR17V35X
The upper four bits of the XR17V35x fractional divisor register (DLD) control general chip function (RS-485 direction pin polarity, multidrop mode, XON/XOFF parity check, and fast IR mode). Don't allow these bits to be clobbered when setting the baudrate. Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8ffb820 commit 0ab84da

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎drivers/tty/serial/8250/8250_port.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2586,8 +2586,11 @@ static void serial8250_set_divisor(struct uart_port *port, unsigned int baud,
25862586
serial_dl_write(up, quot);
25872587

25882588
/* XR17V35x UARTs have an extra fractional divisor register (DLD) */
2589-
if (up->port.type == PORT_XR17V35X)
2589+
if (up->port.type == PORT_XR17V35X) {
2590+
/* Preserve bits not related to baudrate; DLD[7:4]. */
2591+
quot_frac |= serial_port_in(port, 0x2) & 0xf0;
25902592
serial_port_out(port, 0x2, quot_frac);
2593+
}
25912594
}
25922595

25932596
static unsigned int serial8250_get_baud_rate(struct uart_port *port,

0 commit comments

Comments
 (0)