[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZBCU+8MpTCWAfJLG@smile.fi.intel.com>
Date: Tue, 14 Mar 2023 17:38:35 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Tony Lindgren <tony@...mide.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Johan Hovold <johan@...nel.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Vignesh Raghavendra <vigneshr@...com>,
linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org
Subject: Re: [PATCH v7 1/1] serial: core: Start managing serial controllers
to enable runtime PM
On Tue, Mar 14, 2023 at 03:38:10PM +0200, Tony Lindgren wrote:
> * Andy Shevchenko <andriy.shevchenko@...el.com> [230314 13:25]:
> > On Tue, Mar 14, 2023 at 09:35:59AM +0200, Tony Lindgren wrote:
...
> > > + /* Increment the runtime PM usage count for the active check below */
> > > + err = pm_runtime_get(port_dev);
> >
> > The question here is why don't we need to actually turn on the device immediately
> > (sync) if it's not already powered?
> Doing it would require the use of pm_runtime_irq_safe() at least currently.
> > > + if (err < 0) {
> > > + pm_runtime_put_noidle(port_dev);
> > > + return;
> > > + }
> >
> > > + /*
> > > + * Start TX if enabled, and kick runtime PM. Otherwise we must
> > > + * wait for a retry. See also serial_port.c for runtime PM
> > > + * autosuspend timeout.
> > > + */
> >
> > I.o.w. does the start_tx() require device to be powered on at this point?
>
> Yes. And if the device is not enabled, serial_port.c runtime_resume()
> calls this function again after the hardware is enabled.
Ah, that makes sense.
> > > + if (pm_runtime_active(port_dev))
> > > port->ops->start_tx(port);
> > > + pm_runtime_mark_last_busy(port_dev);
> > > + pm_runtime_put_autosuspend(port_dev);
>
> For your other comments, I'll take a look thanks.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists