Merge tag 'tty-6.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial driver fixes from Greg KH:
"Here are three small serial/tty driver fixes for 6.8-rc6 that resolve
the following reported errors:

- riscv hvc console driver fix that was reported by many

- amba-pl011 serial driver fix for RS485 mode

- stm32 serial driver fix for RS485 mode

All of these have been in linux-next all week with no reported
problems"

* tag 'tty-6.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
serial: amba-pl011: Fix DMA transmission in RS485 mode
serial: stm32: do not always set SER_RS485_RX_DURING_TX if RS485 is enabled
tty: hvc: Don't enable the RISC-V SBI console by default

Changed files
+38 -34
drivers
+5 -3
drivers/tty/hvc/Kconfig
··· 108 108 109 109 config HVC_RISCV_SBI 110 110 bool "RISC-V SBI console support" 111 - depends on RISCV_SBI 111 + depends on RISCV_SBI && NONPORTABLE 112 112 select HVC_DRIVER 113 113 help 114 114 This enables support for console output via RISC-V SBI calls, which 115 - is normally used only during boot to output printk. 115 + is normally used only during boot to output printk. This driver 116 + conflicts with real console drivers and should not be enabled on 117 + systems that directly access the console. 116 118 117 - If you don't know what do to here, say Y. 119 + If you don't know what do to here, say N. 118 120 119 121 config HVCS 120 122 tristate "IBM Hypervisor Virtual Console Server support"
+30 -30
drivers/tty/serial/amba-pl011.c
··· 1339 1339 } 1340 1340 } 1341 1341 1342 + static void pl011_rs485_tx_start(struct uart_amba_port *uap) 1343 + { 1344 + struct uart_port *port = &uap->port; 1345 + u32 cr; 1346 + 1347 + /* Enable transmitter */ 1348 + cr = pl011_read(uap, REG_CR); 1349 + cr |= UART011_CR_TXE; 1350 + 1351 + /* Disable receiver if half-duplex */ 1352 + if (!(port->rs485.flags & SER_RS485_RX_DURING_TX)) 1353 + cr &= ~UART011_CR_RXE; 1354 + 1355 + if (port->rs485.flags & SER_RS485_RTS_ON_SEND) 1356 + cr &= ~UART011_CR_RTS; 1357 + else 1358 + cr |= UART011_CR_RTS; 1359 + 1360 + pl011_write(cr, uap, REG_CR); 1361 + 1362 + if (port->rs485.delay_rts_before_send) 1363 + mdelay(port->rs485.delay_rts_before_send); 1364 + 1365 + uap->rs485_tx_started = true; 1366 + } 1367 + 1342 1368 static void pl011_start_tx(struct uart_port *port) 1343 1369 { 1344 1370 struct uart_amba_port *uap = 1345 1371 container_of(port, struct uart_amba_port, port); 1372 + 1373 + if ((uap->port.rs485.flags & SER_RS485_ENABLED) && 1374 + !uap->rs485_tx_started) 1375 + pl011_rs485_tx_start(uap); 1346 1376 1347 1377 if (!pl011_dma_tx_start(uap)) 1348 1378 pl011_start_tx_pio(uap); ··· 1454 1424 return true; 1455 1425 } 1456 1426 1457 - static void pl011_rs485_tx_start(struct uart_amba_port *uap) 1458 - { 1459 - struct uart_port *port = &uap->port; 1460 - u32 cr; 1461 - 1462 - /* Enable transmitter */ 1463 - cr = pl011_read(uap, REG_CR); 1464 - cr |= UART011_CR_TXE; 1465 - 1466 - /* Disable receiver if half-duplex */ 1467 - if (!(port->rs485.flags & SER_RS485_RX_DURING_TX)) 1468 - cr &= ~UART011_CR_RXE; 1469 - 1470 - if (port->rs485.flags & SER_RS485_RTS_ON_SEND) 1471 - cr &= ~UART011_CR_RTS; 1472 - else 1473 - cr |= UART011_CR_RTS; 1474 - 1475 - pl011_write(cr, uap, REG_CR); 1476 - 1477 - if (port->rs485.delay_rts_before_send) 1478 - mdelay(port->rs485.delay_rts_before_send); 1479 - 1480 - uap->rs485_tx_started = true; 1481 - } 1482 - 1483 1427 /* Returns true if tx interrupts have to be (kept) enabled */ 1484 1428 static bool pl011_tx_chars(struct uart_amba_port *uap, bool from_irq) 1485 1429 { 1486 1430 struct circ_buf *xmit = &uap->port.state->xmit; 1487 1431 int count = uap->fifosize >> 1; 1488 - 1489 - if ((uap->port.rs485.flags & SER_RS485_ENABLED) && 1490 - !uap->rs485_tx_started) 1491 - pl011_rs485_tx_start(uap); 1492 1432 1493 1433 if (uap->port.x_char) { 1494 1434 if (!pl011_tx_char(uap, uap->port.x_char, from_irq))
+3 -1
drivers/tty/serial/stm32-usart.c
··· 251 251 writel_relaxed(cr3, port->membase + ofs->cr3); 252 252 writel_relaxed(cr1, port->membase + ofs->cr1); 253 253 254 - rs485conf->flags |= SER_RS485_RX_DURING_TX; 254 + if (!port->rs485_rx_during_tx_gpio) 255 + rs485conf->flags |= SER_RS485_RX_DURING_TX; 256 + 255 257 } else { 256 258 stm32_usart_clr_bits(port, ofs->cr3, 257 259 USART_CR3_DEM | USART_CR3_DEP);