[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZTe9NdS160EU1RJJ@hovoldconsulting.com>
Date: Tue, 24 Oct 2023 14:48:53 +0200
From: Johan Hovold <johan@...nel.org>
To: Tony Lindgren <tony@...mide.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Rob Herring <robh@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...el.com>,
Dhruva Gole <d-gole@...com>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
John Ogness <john.ogness@...utronix.de>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Vignesh Raghavendra <vigneshr@...com>,
linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
Maximilian Luz <luzmaximilian@...il.com>
Subject: Re: [RFC PATCH 1/2] serial: core: Move tty and serdev to be children
of serial core port device
On Tue, Oct 24, 2023 at 02:36:18PM +0300, Tony Lindgren wrote:
> Let's move tty and serdev controller to be children of the serial core port
> device. This way the runtime PM usage count of a child device propagates
> to the serial hardware device.
> The tty device moves happily with just a change of the parent device.
> @@ -3153,7 +3153,8 @@ static int serial_core_add_one_port(struct uart_driver *drv, struct uart_port *u
> * setserial to be used to alter this port's parameters.
> */
> tty_dev = tty_port_register_device_attr_serdev(port, drv->tty_driver,
> - uport->line, uport->dev, port, uport->tty_groups);
> + uport->line, uport->dev, &uport->port_dev->dev, port,
> + uport->tty_groups);
> if (!IS_ERR(tty_dev)) {
> device_set_wakeup_capable(tty_dev, 1);
> } else {
> struct device *tty_port_register_device_attr_serdev(struct tty_port *port,
> struct tty_driver *driver, unsigned index,
> - struct device *device, void *drvdata,
> + struct device *host, struct device *parent, void *drvdata,
> const struct attribute_group **attr_grp)
> {
> struct device *dev;
>
> tty_port_link_device(port, driver, index);
>
> - dev = serdev_tty_port_register(port, device, driver, index);
> + dev = serdev_tty_port_register(port, host, parent, driver, index);
> if (PTR_ERR(dev) != -ENODEV) {
> /* Skip creating cdev if we registered a serdev device */
> return dev;
> }
>
> - return tty_register_device_attr(driver, index, device, drvdata,
> + return tty_register_device_attr(driver, index, parent, drvdata,
> attr_grp);
> }
Looks like this patch breaks the wakeup-irq hack in uart_suspend_port():
tty_dev = device_find_child(uport->dev, &match, serial_match_port);
if (tty_dev && device_may_wakeup(tty_dev)) {
enable_irq_wake(uport->irq);
put_device(tty_dev);
mutex_unlock(&port->mutex);
return 0;
}
There may be more of these hard-coded assumptions, this one I happened
to be aware of.
Johan
Powered by blists - more mailing lists