From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Michał Kardaś" <mkmkl@google.com>
Cc: "Linus Walleij" <linusw@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Douglas Anderson" <dianders@chromium.org>,
"Vic Huang" <vich@google.com>,
linux-gpio@vger.kernel.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/2] tty: serial: 8250_dw: Keep init pinctrl state until first open
Date: Mon, 10 Aug 2026 21:17:52 +0300 [thread overview]
Message-ID: <anoV0K_Xk19DsDlI@ashevche-desk.local> (raw)
In-Reply-To: <20260810130635.1166626-3-mkmkl@google.com>
On Mon, Aug 10, 2026 at 01:06:35PM +0000, Michał Kardaś wrote:
> When a UART port is connected to an external peripheral whose power
> domain is kept powered off until first use, transitioning the UART
> pins from the "init" state to the "default" state prematurely at probe
> completion can cause parasitic back-powering into the unpowered
> peripheral.
>
> Ensure that on boards specifying an "init" pinctrl state for the port,
> the "init" state is preserved until the port is first opened:
>
> 1. In dw8250_probe(), call pinctrl_keep_init_state(dev) to opt out of the
> automatic "init" -> "default" transition at probe completion and record
> this in data->in_init_state.
> 2. In dw8250_do_pm(), when the port is opened (state == 0), transition
> pins from "init" to "default" if data->in_init_state is set, and clear
> the flag.
...
> dw8250_do_pm(struct uart_port *port, unsigned int state, unsigned int old)
> {
> - if (!state)
> + struct dw8250_data *d = to_dw8250_data(port->private_data);
> +
> + if (!state) {
> pm_runtime_get_sync(port->dev);
> + if (d->in_init_state) {
> + d->in_init_state = false;
Mistyped assignee. Should be 0.
> + pinctrl_pm_select_default_state(port->dev);
> + }
> + }
Obviously the above needs a good comment in the code explaining why it is doing
that.
...
> if (data->data.line < 0)
> return data->data.line;
And a good comment explaining what you put in the commit message.
> + data->in_init_state = pinctrl_keep_init_state(dev);
> platform_set_drvdata(pdev, data);
>
> pm_runtime_enable(dev);
...
Wondering if this anyhow affects the future idea of the OOB wakeup for the UART
using its Rx as GPIO wake source in the suspend.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-08-10 18:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 13:06 [PATCH v1 0/2] pinctrl / 8250_dw: Allow drivers to keep init pinctrl state until first open Michał Kardaś
2026-08-10 13:06 ` [PATCH v1 1/2] pinctrl: core: Allow drivers to keep "init" pinctrl state after probe Michał Kardaś
2026-08-10 18:12 ` Andy Shevchenko
2026-08-10 13:06 ` [PATCH v1 2/2] tty: serial: 8250_dw: Keep init pinctrl state until first open Michał Kardaś
2026-08-10 18:17 ` Andy Shevchenko [this message]
2026-08-11 6:36 ` Linus Walleij
2026-08-11 6:34 ` [PATCH v1 0/2] pinctrl / 8250_dw: Allow drivers to keep " Linus Walleij
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=anoV0K_Xk19DsDlI@ashevche-desk.local \
--to=andriy.shevchenko@linux.intel.com \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=mkmkl@google.com \
--cc=vich@google.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