lkml.org 
[lkml]   [2023]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@intel.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


\
 
 \ /
  Last update: 2023-03-27 00:59    [W:3.464 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site