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.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()

+22 -22
+10 -15
drivers/tty/serial/8250/8250_omap.c
··· 1617 1617 { 1618 1618 struct omap8250_priv *priv = dev_get_drvdata(dev); 1619 1619 struct uart_8250_port *up = serial8250_get_port(priv->line); 1620 - int err; 1620 + int err = 0; 1621 1621 1622 1622 serial8250_suspend_port(priv->line); 1623 1623 ··· 1627 1627 if (!device_may_wakeup(dev)) 1628 1628 priv->wer = 0; 1629 1629 serial_out(up, UART_OMAP_WER, priv->wer); 1630 - err = pm_runtime_force_suspend(dev); 1630 + if (uart_console(&up->port) && console_suspend_enabled) 1631 + err = pm_runtime_force_suspend(dev); 1631 1632 flush_work(&priv->qos_work); 1632 1633 1633 1634 return err; ··· 1637 1636 static int omap8250_resume(struct device *dev) 1638 1637 { 1639 1638 struct omap8250_priv *priv = dev_get_drvdata(dev); 1639 + struct uart_8250_port *up = serial8250_get_port(priv->line); 1640 1640 int err; 1641 1641 1642 - err = pm_runtime_force_resume(dev); 1643 - if (err) 1644 - return err; 1642 + if (uart_console(&up->port) && console_suspend_enabled) { 1643 + err = pm_runtime_force_resume(dev); 1644 + if (err) 1645 + return err; 1646 + } 1647 + 1645 1648 serial8250_resume_port(priv->line); 1646 1649 /* Paired with pm_runtime_resume_and_get() in omap8250_suspend() */ 1647 1650 pm_runtime_mark_last_busy(dev); ··· 1722 1717 1723 1718 if (priv->line >= 0) 1724 1719 up = serial8250_get_port(priv->line); 1725 - /* 1726 - * When using 'no_console_suspend', the console UART must not be 1727 - * suspended. Since driver suspend is managed by runtime suspend, 1728 - * preventing runtime suspend (by returning error) will keep device 1729 - * active during suspend. 1730 - */ 1731 - if (priv->is_suspending && !console_suspend_enabled) { 1732 - if (up && uart_console(&up->port)) 1733 - return -EBUSY; 1734 - } 1735 1720 1736 1721 if (priv->habit & UART_ERRATA_CLOCK_DISABLE) { 1737 1722 int ret;
+10 -5
drivers/tty/serial/serial_core.c
··· 156 156 * enabled, serial_port_runtime_resume() calls start_tx() again 157 157 * after enabling the device. 158 158 */ 159 - if (pm_runtime_active(&port_dev->dev)) 159 + if (!pm_runtime_enabled(port->dev) || pm_runtime_active(port->dev)) 160 160 port->ops->start_tx(port); 161 161 pm_runtime_mark_last_busy(&port_dev->dev); 162 162 pm_runtime_put_autosuspend(&port_dev->dev); ··· 1404 1404 static int uart_rs485_config(struct uart_port *port) 1405 1405 { 1406 1406 struct serial_rs485 *rs485 = &port->rs485; 1407 + unsigned long flags; 1407 1408 int ret; 1409 + 1410 + if (!(rs485->flags & SER_RS485_ENABLED)) 1411 + return 0; 1408 1412 1409 1413 uart_sanitize_serial_rs485(port, rs485); 1410 1414 uart_set_rs485_termination(port, rs485); 1411 1415 1416 + spin_lock_irqsave(&port->lock, flags); 1412 1417 ret = port->rs485_config(port, NULL, rs485); 1418 + spin_unlock_irqrestore(&port->lock, flags); 1413 1419 if (ret) 1414 1420 memset(rs485, 0, sizeof(*rs485)); 1415 1421 ··· 2480 2474 if (ret == 0) { 2481 2475 if (tty) 2482 2476 uart_change_line_settings(tty, state, NULL); 2477 + uart_rs485_config(uport); 2483 2478 spin_lock_irq(&uport->lock); 2484 2479 if (!(uport->rs485.flags & SER_RS485_ENABLED)) 2485 2480 ops->set_mctrl(uport, uport->mctrl); 2486 - else 2487 - uart_rs485_config(uport); 2488 2481 ops->start_tx(uport); 2489 2482 spin_unlock_irq(&uport->lock); 2490 2483 tty_port_set_initialized(port, true); ··· 2592 2587 port->mctrl &= TIOCM_DTR; 2593 2588 if (!(port->rs485.flags & SER_RS485_ENABLED)) 2594 2589 port->ops->set_mctrl(port, port->mctrl); 2595 - else 2596 - uart_rs485_config(port); 2597 2590 spin_unlock_irqrestore(&port->lock, flags); 2591 + 2592 + uart_rs485_config(port); 2598 2593 2599 2594 /* 2600 2595 * If this driver supports console, and it hasn't been
+2 -2
sound/soc/ti/ams-delta.c
··· 336 336 } 337 337 338 338 /* Line discipline .receive_buf() */ 339 - static void cx81801_receive(struct tty_struct *tty, const u8 *cp, 340 - const char *fp, int count) 339 + static void cx81801_receive(struct tty_struct *tty, const u8 *cp, const u8 *fp, 340 + size_t count) 341 341 { 342 342 struct snd_soc_component *component = tty->disc_data; 343 343 const unsigned char *c;