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.

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

Pull serial driver fixes from Greg KH:
"Here are some small serial driver fixes for some reported issues.
Included in here are:

- serial sysfs fwnode fix that was much reported

- sh-sci driver fix

- serial device init bugfix

- 8250 bugfix

- xilinx_uartps bugfix

All of these have passed 0-day testing and individual testing"

* tag 'tty-6.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
serial: xilinx_uartps: fix rs485 delay_rts_after_send
serial: sh-sci: Check that the DMA cookie is valid
serial: core: Fix serial device initialization
serial: 8250: longson: Fix NULL vs IS_ERR() bug in probe
serial: core: Restore sysfs fwnode information

+17 -14
+2 -2
drivers/tty/serial/8250/8250_loongson.c
··· 128 128 port->private_data = priv; 129 129 130 130 port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &priv->res); 131 - if (!port->membase) 132 - return -ENOMEM; 131 + if (IS_ERR(port->membase)) 132 + return PTR_ERR(port->membase); 133 133 134 134 port->mapbase = priv->res->start; 135 135 port->mapsize = resource_size(priv->res);
+7 -4
drivers/tty/serial/serial_base_bus.c
··· 13 13 #include <linux/device.h> 14 14 #include <linux/idr.h> 15 15 #include <linux/module.h> 16 - #include <linux/of.h> 16 + #include <linux/property.h> 17 17 #include <linux/serial_core.h> 18 18 #include <linux/slab.h> 19 19 #include <linux/spinlock.h> ··· 60 60 driver_unregister(driver); 61 61 } 62 62 63 + /* On failure the caller must put device @dev with put_device() */ 63 64 static int serial_base_device_init(struct uart_port *port, 64 65 struct device *dev, 65 66 struct device *parent_dev, ··· 74 73 dev->parent = parent_dev; 75 74 dev->bus = &serial_base_bus_type; 76 75 dev->release = release; 77 - device_set_of_node_from_dev(dev, parent_dev); 76 + dev->of_node_reused = true; 77 + 78 + device_set_node(dev, fwnode_handle_get(dev_fwnode(parent_dev))); 78 79 79 80 if (!serial_base_initialized) { 80 81 dev_dbg(port->dev, "uart_add_one_port() called before arch_initcall()?\n"); ··· 97 94 { 98 95 struct serial_ctrl_device *ctrl_dev = to_serial_base_ctrl_device(dev); 99 96 100 - of_node_put(dev->of_node); 97 + fwnode_handle_put(dev_fwnode(dev)); 101 98 kfree(ctrl_dev); 102 99 } 103 100 ··· 145 142 { 146 143 struct serial_port_device *port_dev = to_serial_base_port_device(dev); 147 144 148 - of_node_put(dev->of_node); 145 + fwnode_handle_put(dev_fwnode(dev)); 149 146 kfree(port_dev); 150 147 } 151 148
+1 -1
drivers/tty/serial/sh-sci.c
··· 1914 1914 struct dma_tx_state state; 1915 1915 enum dma_status status; 1916 1916 1917 - if (!s->chan_tx) 1917 + if (!s->chan_tx || s->cookie_tx <= 0) 1918 1918 return; 1919 1919 1920 1920 status = dmaengine_tx_status(s->chan_tx, s->cookie_tx, &state);
+7 -7
drivers/tty/serial/xilinx_uartps.c
··· 428 428 struct tty_port *tport = &port->state->port; 429 429 unsigned int numbytes; 430 430 unsigned char ch; 431 + ktime_t rts_delay; 431 432 432 433 if (kfifo_is_empty(&tport->xmit_fifo) || uart_tx_stopped(port)) { 433 434 /* Disable the TX Empty interrupt */ 434 435 writel(CDNS_UART_IXR_TXEMPTY, port->membase + CDNS_UART_IDR); 436 + /* Set RTS line after delay */ 437 + if (cdns_uart->port->rs485.flags & SER_RS485_ENABLED) { 438 + cdns_uart->tx_timer.function = &cdns_rs485_rx_callback; 439 + rts_delay = ns_to_ktime(cdns_calc_after_tx_delay(cdns_uart)); 440 + hrtimer_start(&cdns_uart->tx_timer, rts_delay, HRTIMER_MODE_REL); 441 + } 435 442 return; 436 443 } 437 444 ··· 455 448 456 449 /* Enable the TX Empty interrupt */ 457 450 writel(CDNS_UART_IXR_TXEMPTY, cdns_uart->port->membase + CDNS_UART_IER); 458 - 459 - if (cdns_uart->port->rs485.flags & SER_RS485_ENABLED && 460 - (kfifo_is_empty(&tport->xmit_fifo) || uart_tx_stopped(port))) { 461 - hrtimer_update_function(&cdns_uart->tx_timer, cdns_rs485_rx_callback); 462 - hrtimer_start(&cdns_uart->tx_timer, 463 - ns_to_ktime(cdns_calc_after_tx_delay(cdns_uart)), HRTIMER_MODE_REL); 464 - } 465 451 } 466 452 467 453 /**