mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-11 09:00:12 +00:00
Serial driver fixes for 6.19-rc3
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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCaVEl7A8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+yn1AgCfYUqy05A3BNhwOfhzoJ2ToKn/aZkAn0iYT/06 vLBTQBtVhoMff9CneVvu =eNi3 -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
15225b910c
@ -128,8 +128,8 @@ static int loongson_uart_probe(struct platform_device *pdev)
|
||||
port->private_data = priv;
|
||||
|
||||
port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &priv->res);
|
||||
if (!port->membase)
|
||||
return -ENOMEM;
|
||||
if (IS_ERR(port->membase))
|
||||
return PTR_ERR(port->membase);
|
||||
|
||||
port->mapbase = priv->res->start;
|
||||
port->mapsize = resource_size(priv->res);
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
#include <linux/device.h>
|
||||
#include <linux/idr.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/serial_core.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/spinlock.h>
|
||||
@ -60,6 +60,7 @@ void serial_base_driver_unregister(struct device_driver *driver)
|
||||
driver_unregister(driver);
|
||||
}
|
||||
|
||||
/* On failure the caller must put device @dev with put_device() */
|
||||
static int serial_base_device_init(struct uart_port *port,
|
||||
struct device *dev,
|
||||
struct device *parent_dev,
|
||||
@ -73,7 +74,9 @@ static int serial_base_device_init(struct uart_port *port,
|
||||
dev->parent = parent_dev;
|
||||
dev->bus = &serial_base_bus_type;
|
||||
dev->release = release;
|
||||
device_set_of_node_from_dev(dev, parent_dev);
|
||||
dev->of_node_reused = true;
|
||||
|
||||
device_set_node(dev, fwnode_handle_get(dev_fwnode(parent_dev)));
|
||||
|
||||
if (!serial_base_initialized) {
|
||||
dev_dbg(port->dev, "uart_add_one_port() called before arch_initcall()?\n");
|
||||
@ -94,7 +97,7 @@ static void serial_base_ctrl_release(struct device *dev)
|
||||
{
|
||||
struct serial_ctrl_device *ctrl_dev = to_serial_base_ctrl_device(dev);
|
||||
|
||||
of_node_put(dev->of_node);
|
||||
fwnode_handle_put(dev_fwnode(dev));
|
||||
kfree(ctrl_dev);
|
||||
}
|
||||
|
||||
@ -142,7 +145,7 @@ static void serial_base_port_release(struct device *dev)
|
||||
{
|
||||
struct serial_port_device *port_dev = to_serial_base_port_device(dev);
|
||||
|
||||
of_node_put(dev->of_node);
|
||||
fwnode_handle_put(dev_fwnode(dev));
|
||||
kfree(port_dev);
|
||||
}
|
||||
|
||||
|
||||
@ -1914,7 +1914,7 @@ static void sci_dma_check_tx_occurred(struct sci_port *s)
|
||||
struct dma_tx_state state;
|
||||
enum dma_status status;
|
||||
|
||||
if (!s->chan_tx)
|
||||
if (!s->chan_tx || s->cookie_tx <= 0)
|
||||
return;
|
||||
|
||||
status = dmaengine_tx_status(s->chan_tx, s->cookie_tx, &state);
|
||||
|
||||
@ -428,10 +428,17 @@ static void cdns_uart_handle_tx(void *dev_id)
|
||||
struct tty_port *tport = &port->state->port;
|
||||
unsigned int numbytes;
|
||||
unsigned char ch;
|
||||
ktime_t rts_delay;
|
||||
|
||||
if (kfifo_is_empty(&tport->xmit_fifo) || uart_tx_stopped(port)) {
|
||||
/* Disable the TX Empty interrupt */
|
||||
writel(CDNS_UART_IXR_TXEMPTY, port->membase + CDNS_UART_IDR);
|
||||
/* Set RTS line after delay */
|
||||
if (cdns_uart->port->rs485.flags & SER_RS485_ENABLED) {
|
||||
cdns_uart->tx_timer.function = &cdns_rs485_rx_callback;
|
||||
rts_delay = ns_to_ktime(cdns_calc_after_tx_delay(cdns_uart));
|
||||
hrtimer_start(&cdns_uart->tx_timer, rts_delay, HRTIMER_MODE_REL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -448,13 +455,6 @@ static void cdns_uart_handle_tx(void *dev_id)
|
||||
|
||||
/* Enable the TX Empty interrupt */
|
||||
writel(CDNS_UART_IXR_TXEMPTY, cdns_uart->port->membase + CDNS_UART_IER);
|
||||
|
||||
if (cdns_uart->port->rs485.flags & SER_RS485_ENABLED &&
|
||||
(kfifo_is_empty(&tport->xmit_fifo) || uart_tx_stopped(port))) {
|
||||
hrtimer_update_function(&cdns_uart->tx_timer, cdns_rs485_rx_callback);
|
||||
hrtimer_start(&cdns_uart->tx_timer,
|
||||
ns_to_ktime(cdns_calc_after_tx_delay(cdns_uart)), HRTIMER_MODE_REL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user