linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andy Shevchenko <andriy.shevchenko@intel.com>,
	Jiri Slaby <jirislaby@kernel.org>,
	Johan Hovold <johan@kernel.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-serial <linux-serial@vger.kernel.org>,
	linux-omap@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] serial: core: Start managing serial controllers to enable runtime PM
Date: Mon, 28 Nov 2022 08:45:09 +0200	[thread overview]
Message-ID: <Y4RY9XxkK6hHEur4@atomide.com> (raw)
In-Reply-To: <e6922dd6-8968-b54-afbc-d5ad969f64@linux.intel.com>

Hi,

* Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [221125 14:02]:
> On Wed, 23 Nov 2022, Tony Lindgren wrote:
> > +	/*
> > +	 * Keep the port device enabled unless autosuspend is supported.
> > +	 * Released on port shutdown.
> > +	 */
> > +	if (!controller->supports_autosuspend) {
> > +		ret = pm_runtime_resume_and_get(dev);
> 
> Should this be done regardless of autosuspend if the port is console?

Well hopefully no need to check anything here for the console unless
enabled state needs to be inherited from the early console.

Note that with what Jiri is proposing, we can just unconditionally do the
pm_runtime_resume_and_get() here on the generic serial port controller
struct device. We can also leave out the tinkering of the serial port
hardware struct device.

The hardware serial port controller drivers that do support autosuspend
can just decrement the runtime PM usage count for the generic serial port
controller child device as needed to enable aggressive PM.

> There's a problem in the current place where this being called from 
> though, uart_console_enabled() doesn't return the correct value with at 
> least some devices this early:
> 
> https://lore.kernel.org/linux-serial/AS8PR04MB84047F39CD10C00CEE29213F92219@AS8PR04MB8404.eurprd04.prod.outlook.com/

OK. Seems the issues with the boot console and early serial port struct
device or whatever might be missing are there even without runtime PM.

Regards,

Tony

      reply	other threads:[~2022-11-28  6:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23  8:28 [PATCH v3 1/2] serial: core: Start managing serial controllers to enable runtime PM Tony Lindgren
2022-11-23  8:28 ` [PATCH v3 2/2] serial: core: Add port port device to flush TX on runtime resume Tony Lindgren
2022-11-23 18:37   ` Andy Shevchenko
2022-11-24  6:50     ` Tony Lindgren
2022-11-24  8:41       ` Andy Shevchenko
2022-11-23 18:41 ` [PATCH v3 1/2] serial: core: Start managing serial controllers to enable runtime PM Andy Shevchenko
2022-11-25 14:02 ` Ilpo Järvinen
2022-11-28  6:45   ` Tony Lindgren [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y4RY9XxkK6hHEur4@atomide.com \
    --to=tony@atomide.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).