Commit 41226a36 authored by Linus Torvalds's avatar Linus Torvalds

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()
parents a477e3a7 b3fa3cf0
...@@ -1617,7 +1617,7 @@ static int omap8250_suspend(struct device *dev) ...@@ -1617,7 +1617,7 @@ static int omap8250_suspend(struct device *dev)
{ {
struct omap8250_priv *priv = dev_get_drvdata(dev); struct omap8250_priv *priv = dev_get_drvdata(dev);
struct uart_8250_port *up = serial8250_get_port(priv->line); struct uart_8250_port *up = serial8250_get_port(priv->line);
int err; int err = 0;
serial8250_suspend_port(priv->line); serial8250_suspend_port(priv->line);
...@@ -1627,6 +1627,7 @@ static int omap8250_suspend(struct device *dev) ...@@ -1627,6 +1627,7 @@ static int omap8250_suspend(struct device *dev)
if (!device_may_wakeup(dev)) if (!device_may_wakeup(dev))
priv->wer = 0; priv->wer = 0;
serial_out(up, UART_OMAP_WER, priv->wer); serial_out(up, UART_OMAP_WER, priv->wer);
if (uart_console(&up->port) && console_suspend_enabled)
err = pm_runtime_force_suspend(dev); err = pm_runtime_force_suspend(dev);
flush_work(&priv->qos_work); flush_work(&priv->qos_work);
...@@ -1636,11 +1637,15 @@ static int omap8250_suspend(struct device *dev) ...@@ -1636,11 +1637,15 @@ static int omap8250_suspend(struct device *dev)
static int omap8250_resume(struct device *dev) static int omap8250_resume(struct device *dev)
{ {
struct omap8250_priv *priv = dev_get_drvdata(dev); struct omap8250_priv *priv = dev_get_drvdata(dev);
struct uart_8250_port *up = serial8250_get_port(priv->line);
int err; int err;
if (uart_console(&up->port) && console_suspend_enabled) {
err = pm_runtime_force_resume(dev); err = pm_runtime_force_resume(dev);
if (err) if (err)
return err; return err;
}
serial8250_resume_port(priv->line); serial8250_resume_port(priv->line);
/* Paired with pm_runtime_resume_and_get() in omap8250_suspend() */ /* Paired with pm_runtime_resume_and_get() in omap8250_suspend() */
pm_runtime_mark_last_busy(dev); pm_runtime_mark_last_busy(dev);
...@@ -1717,16 +1722,6 @@ static int omap8250_runtime_suspend(struct device *dev) ...@@ -1717,16 +1722,6 @@ static int omap8250_runtime_suspend(struct device *dev)
if (priv->line >= 0) if (priv->line >= 0)
up = serial8250_get_port(priv->line); 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) { if (priv->habit & UART_ERRATA_CLOCK_DISABLE) {
int ret; int ret;
......
...@@ -156,7 +156,7 @@ static void __uart_start(struct uart_state *state) ...@@ -156,7 +156,7 @@ static void __uart_start(struct uart_state *state)
* enabled, serial_port_runtime_resume() calls start_tx() again * enabled, serial_port_runtime_resume() calls start_tx() again
* after enabling the device. * 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); port->ops->start_tx(port);
pm_runtime_mark_last_busy(&port_dev->dev); pm_runtime_mark_last_busy(&port_dev->dev);
pm_runtime_put_autosuspend(&port_dev->dev); pm_runtime_put_autosuspend(&port_dev->dev);
...@@ -1404,12 +1404,18 @@ static void uart_set_rs485_termination(struct uart_port *port, ...@@ -1404,12 +1404,18 @@ static void uart_set_rs485_termination(struct uart_port *port,
static int uart_rs485_config(struct uart_port *port) static int uart_rs485_config(struct uart_port *port)
{ {
struct serial_rs485 *rs485 = &port->rs485; struct serial_rs485 *rs485 = &port->rs485;
unsigned long flags;
int ret; int ret;
if (!(rs485->flags & SER_RS485_ENABLED))
return 0;
uart_sanitize_serial_rs485(port, rs485); uart_sanitize_serial_rs485(port, rs485);
uart_set_rs485_termination(port, rs485); uart_set_rs485_termination(port, rs485);
spin_lock_irqsave(&port->lock, flags);
ret = port->rs485_config(port, NULL, rs485); ret = port->rs485_config(port, NULL, rs485);
spin_unlock_irqrestore(&port->lock, flags);
if (ret) if (ret)
memset(rs485, 0, sizeof(*rs485)); memset(rs485, 0, sizeof(*rs485));
...@@ -2474,11 +2480,10 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) ...@@ -2474,11 +2480,10 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
if (ret == 0) { if (ret == 0) {
if (tty) if (tty)
uart_change_line_settings(tty, state, NULL); uart_change_line_settings(tty, state, NULL);
uart_rs485_config(uport);
spin_lock_irq(&uport->lock); spin_lock_irq(&uport->lock);
if (!(uport->rs485.flags & SER_RS485_ENABLED)) if (!(uport->rs485.flags & SER_RS485_ENABLED))
ops->set_mctrl(uport, uport->mctrl); ops->set_mctrl(uport, uport->mctrl);
else
uart_rs485_config(uport);
ops->start_tx(uport); ops->start_tx(uport);
spin_unlock_irq(&uport->lock); spin_unlock_irq(&uport->lock);
tty_port_set_initialized(port, true); tty_port_set_initialized(port, true);
...@@ -2587,10 +2592,10 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state, ...@@ -2587,10 +2592,10 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state,
port->mctrl &= TIOCM_DTR; port->mctrl &= TIOCM_DTR;
if (!(port->rs485.flags & SER_RS485_ENABLED)) if (!(port->rs485.flags & SER_RS485_ENABLED))
port->ops->set_mctrl(port, port->mctrl); port->ops->set_mctrl(port, port->mctrl);
else
uart_rs485_config(port);
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
uart_rs485_config(port);
/* /*
* If this driver supports console, and it hasn't been * If this driver supports console, and it hasn't been
* successfully registered yet, try to re-register it. * successfully registered yet, try to re-register it.
......
...@@ -336,8 +336,8 @@ static void cx81801_hangup(struct tty_struct *tty) ...@@ -336,8 +336,8 @@ static void cx81801_hangup(struct tty_struct *tty)
} }
/* Line discipline .receive_buf() */ /* Line discipline .receive_buf() */
static void cx81801_receive(struct tty_struct *tty, const u8 *cp, static void cx81801_receive(struct tty_struct *tty, const u8 *cp, const u8 *fp,
const char *fp, int count) size_t count)
{ {
struct snd_soc_component *component = tty->disc_data; struct snd_soc_component *component = tty->disc_data;
const unsigned char *c; const unsigned char *c;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment