devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@baylibre.com>
To: "Markus Schneider-Pargmann" <msp@baylibre.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Tony Lindgren" <tony@atomide.com>,
	"John Ogness" <john.ogness@linutronix.de>,
	"Markus Schneider-Pargmann" <msp@baylibre.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Ronald Wahl" <ronald.wahl@raritan.com>,
	"Thomas Richard" <thomas.richard@bootlin.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Vignesh Raghavendra" <vigneshr@ti.com>
Cc: Vibhore Vardhan <vibhore@ti.com>, Dhruva Gole <d-gole@ti.com>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 5/5] serial: 8250: omap: Set wakeup pinctrl on suspend
Date: Tue, 30 Jul 2024 14:22:49 -0700	[thread overview]
Message-ID: <7hh6c660d2.fsf@baylibre.com> (raw)
In-Reply-To: <20240523075819.1285554-6-msp@baylibre.com>

Markus Schneider-Pargmann <msp@baylibre.com> writes:

> To enable the serial driver and it's pin to be a wakeup source in
> suspend to ram states, select the wakeup pinctrl state on suspend and
> restore the default pinctrl state on resume.
>
> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>

Reviewed-by: Kevin Hilman <khilman@baylibre.com>

but with a minor nit below...

> ---
>  drivers/tty/serial/8250/8250_omap.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
> index 617a421a1396..61f056c4e78e 100644
> --- a/drivers/tty/serial/8250/8250_omap.c
> +++ b/drivers/tty/serial/8250/8250_omap.c
> @@ -1663,6 +1663,13 @@ static int omap8250_suspend(struct device *dev)
>  	struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
>  	int err = 0;
>  
> +	err = omap8250_select_wakeup_pinctrl(dev, priv);
> +	if (err) {
> +		dev_err(dev, "Failed to select wakeup pinctrl, aborting suspend %pe\n",
> +			ERR_PTR(err));
> +		return err;
> +	}
> +
>  	serial8250_suspend_port(priv->line);
>  
>  	err = pm_runtime_resume_and_get(dev);
> @@ -1696,6 +1703,13 @@ static int omap8250_resume(struct device *dev)
>  	struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
>  	int err;
>  
> +	err = pinctrl_select_default_state(dev);
> +	if (err) {
> +		dev_err(dev, "Failed to select default pinctrl state on resume: %pe\n",
> +			ERR_PTR(err));
> +		return err;
> +	}

Shouldn't this bit should be at the end of this resume function?
Otherwise, if this fails, the UART could be left unusable, and if it's
the console UART, you wouldn't get any logs to know why.

>  	if (uart_console(&up->port) && console_suspend_enabled) {
>  		if (console_suspend_enabled) {
>  			err = pm_runtime_force_resume(dev);
> -- 
> 2.43.0

Kevin

  reply	other threads:[~2024-07-30 21:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-23  7:58 [PATCH 0/5] serial: 8250: omap: Add am62 wakeup support Markus Schneider-Pargmann
2024-05-23  7:58 ` [PATCH 1/5] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state Markus Schneider-Pargmann
2024-05-28 16:01   ` Rob Herring (Arm)
2024-05-23  7:58 ` [PATCH 2/5] serial: 8250: omap: Remove unused wakeups_enabled Markus Schneider-Pargmann
2024-05-23  7:58 ` [PATCH 3/5] serial: 8250: omap: Set wakeup capable, do not enable Markus Schneider-Pargmann
2024-05-27 16:31   ` Andy Shevchenko
2024-07-30 19:33   ` Kevin Hilman
2024-07-30 21:19   ` Kevin Hilman
2024-05-23  7:58 ` [PATCH 4/5] serial: 8250: omap: Support wakeup pinctrl state Markus Schneider-Pargmann
2024-05-27 16:34   ` Andy Shevchenko
2024-07-30 21:16   ` Kevin Hilman
2024-05-23  7:58 ` [PATCH 5/5] serial: 8250: omap: Set wakeup pinctrl on suspend Markus Schneider-Pargmann
2024-07-30 21:22   ` Kevin Hilman [this message]
2024-05-23 19:07 ` [PATCH 0/5] serial: 8250: omap: Add am62 wakeup support Francesco Dolcini

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=7hh6c660d2.fsf@baylibre.com \
    --to=khilman@baylibre.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=conor+dt@kernel.org \
    --cc=d-gole@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=msp@baylibre.com \
    --cc=robh@kernel.org \
    --cc=ronald.wahl@raritan.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.richard@bootlin.com \
    --cc=tony@atomide.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vibhore@ti.com \
    --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).