TTY/Serial driver fixes for 6.6-rc6
Here are some small tty/serial driver fixes for 6.6-rc6 that resolve some reported issues. Included in here are: - serial core pm runtime fix for issue reported by many - 8250_omap driver fix - rs485 spinlock fix for reported problem - ams-delta bugfix for previous tty api changes in -rc1 that missed this driver that never seems to get built in any test systems All of these have been in linux-next for over a week with no reported problems. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZSwD9w8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ylEJgCeKeWhXY68gkV3Y2WjOuk9rA4kfO4An3YhzuyX YQS5m+bhibXE5u6KiXV5 =LD0t -----END PGP SIGNATURE----- Merge tag 'tty-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver fixes from Greg KH: "Here are some small tty/serial driver fixes for 6.6-rc6 that resolve some reported issues. Included in here are: - serial core pm runtime fix for issue reported by many - 8250_omap driver fix - rs485 spinlock fix for reported problem - ams-delta bugfix for previous tty api changes in -rc1 that missed this driver that never seems to get built in any test systems All of these have been in linux-next for over a week with no reported problems" * tag 'tty-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: ASoC: ti: ams-delta: Fix cx81801_receive() argument types serial: core: Fix checks for tx runtime PM state serial: 8250_omap: Fix errors with no_console_suspend serial: Reduce spinlocked portion of uart_rs485_config()
This commit is contained in:
commit
41226a360d
|
@ -1617,7 +1617,7 @@ static int omap8250_suspend(struct device *dev)
|
|||
{
|
||||
struct omap8250_priv *priv = dev_get_drvdata(dev);
|
||||
struct uart_8250_port *up = serial8250_get_port(priv->line);
|
||||
int err;
|
||||
int err = 0;
|
||||
|
||||
serial8250_suspend_port(priv->line);
|
||||
|
||||
|
@ -1627,7 +1627,8 @@ static int omap8250_suspend(struct device *dev)
|
|||
if (!device_may_wakeup(dev))
|
||||
priv->wer = 0;
|
||||
serial_out(up, UART_OMAP_WER, priv->wer);
|
||||
err = pm_runtime_force_suspend(dev);
|
||||
if (uart_console(&up->port) && console_suspend_enabled)
|
||||
err = pm_runtime_force_suspend(dev);
|
||||
flush_work(&priv->qos_work);
|
||||
|
||||
return err;
|
||||
|
@ -1636,11 +1637,15 @@ static int omap8250_suspend(struct device *dev)
|
|||
static int omap8250_resume(struct device *dev)
|
||||
{
|
||||
struct omap8250_priv *priv = dev_get_drvdata(dev);
|
||||
struct uart_8250_port *up = serial8250_get_port(priv->line);
|
||||
int err;
|
||||
|
||||
err = pm_runtime_force_resume(dev);
|
||||
if (err)
|
||||
return err;
|
||||
if (uart_console(&up->port) && console_suspend_enabled) {
|
||||
err = pm_runtime_force_resume(dev);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
serial8250_resume_port(priv->line);
|
||||
/* Paired with pm_runtime_resume_and_get() in omap8250_suspend() */
|
||||
pm_runtime_mark_last_busy(dev);
|
||||
|
@ -1717,16 +1722,6 @@ static int omap8250_runtime_suspend(struct device *dev)
|
|||
|
||||
if (priv->line >= 0)
|
||||
up = serial8250_get_port(priv->line);
|
||||
/*
|
||||
* When using 'no_console_suspend', the console UART must not be
|
||||
* suspended. Since driver suspend is managed by runtime suspend,
|
||||
* preventing runtime suspend (by returning error) will keep device
|
||||
* active during suspend.
|
||||
*/
|
||||
if (priv->is_suspending && !console_suspend_enabled) {
|
||||
if (up && uart_console(&up->port))
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (priv->habit & UART_ERRATA_CLOCK_DISABLE) {
|
||||
int ret;
|
||||
|
|
|
@ -156,7 +156,7 @@ static void __uart_start(struct uart_state *state)
|
|||
* enabled, serial_port_runtime_resume() calls start_tx() again
|
||||
* after enabling the device.
|
||||
*/
|
||||
if (pm_runtime_active(&port_dev->dev))
|
||||
if (!pm_runtime_enabled(port->dev) || pm_runtime_active(port->dev))
|
||||
port->ops->start_tx(port);
|
||||
pm_runtime_mark_last_busy(&port_dev->dev);
|
||||
pm_runtime_put_autosuspend(&port_dev->dev);
|
||||
|
@ -1404,12 +1404,18 @@ static void uart_set_rs485_termination(struct uart_port *port,
|
|||
static int uart_rs485_config(struct uart_port *port)
|
||||
{
|
||||
struct serial_rs485 *rs485 = &port->rs485;
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
if (!(rs485->flags & SER_RS485_ENABLED))
|
||||
return 0;
|
||||
|
||||
uart_sanitize_serial_rs485(port, rs485);
|
||||
uart_set_rs485_termination(port, rs485);
|
||||
|
||||
spin_lock_irqsave(&port->lock, flags);
|
||||
ret = port->rs485_config(port, NULL, rs485);
|
||||
spin_unlock_irqrestore(&port->lock, flags);
|
||||
if (ret)
|
||||
memset(rs485, 0, sizeof(*rs485));
|
||||
|
||||
|
@ -2474,11 +2480,10 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
|
|||
if (ret == 0) {
|
||||
if (tty)
|
||||
uart_change_line_settings(tty, state, NULL);
|
||||
uart_rs485_config(uport);
|
||||
spin_lock_irq(&uport->lock);
|
||||
if (!(uport->rs485.flags & SER_RS485_ENABLED))
|
||||
ops->set_mctrl(uport, uport->mctrl);
|
||||
else
|
||||
uart_rs485_config(uport);
|
||||
ops->start_tx(uport);
|
||||
spin_unlock_irq(&uport->lock);
|
||||
tty_port_set_initialized(port, true);
|
||||
|
@ -2587,10 +2592,10 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state,
|
|||
port->mctrl &= TIOCM_DTR;
|
||||
if (!(port->rs485.flags & SER_RS485_ENABLED))
|
||||
port->ops->set_mctrl(port, port->mctrl);
|
||||
else
|
||||
uart_rs485_config(port);
|
||||
spin_unlock_irqrestore(&port->lock, flags);
|
||||
|
||||
uart_rs485_config(port);
|
||||
|
||||
/*
|
||||
* If this driver supports console, and it hasn't been
|
||||
* successfully registered yet, try to re-register it.
|
||||
|
|
|
@ -336,8 +336,8 @@ static void cx81801_hangup(struct tty_struct *tty)
|
|||
}
|
||||
|
||||
/* Line discipline .receive_buf() */
|
||||
static void cx81801_receive(struct tty_struct *tty, const u8 *cp,
|
||||
const char *fp, int count)
|
||||
static void cx81801_receive(struct tty_struct *tty, const u8 *cp, const u8 *fp,
|
||||
size_t count)
|
||||
{
|
||||
struct snd_soc_component *component = tty->disc_data;
|
||||
const unsigned char *c;
|
||||
|
|
Loading…
Reference in New Issue