Re: [PATCH v1 0/2] pinctrl / 8250_dw: Allow drivers to keep init pinctrl state until first open

From: Andy Shevchenko

Date: Wed Aug 12 2026 - 02:51:50 EST


On Tue, Aug 11, 2026 at 01:15:27PM -0700, Doug Anderson wrote:
> On Tue, Aug 11, 2026 at 11:47 AM Linus Walleij <linusw@xxxxxxxxxx> wrote:

...

> > > > What if this is not good for all devices?
> > >
> > > At the moment, I couldn't find any device that the above rules would
> > > break. Certainly I could have missed something.
> >
> > No you're right, nothing breaks other than the that for one
> > instance of a driver the default/init semantics change.
> > Which isn't elegant IMO, but it works.
> >
> > > Definitely the things Michał wants to achieve can be done without
> > > changing the pinctrl core by using named pinctrl states and
> > > transitioning at the right times.
> >
> > I think we need to do that. This approach is a hack, it will be
> > hard for others to understand and lead to a lot of questions
> > about why this is done and so on. Better use a custom state.
>
> Sure, that's a fair argument. To me, it felt like adding the extra
> state was more of a hack / working around the pinctrl limitations, but
> I can certainly see both perspectives.

FWIW, I'm also with Linus here, the fixing code and make exceptions smells like
a hack. Even having duplicating states with different names (mean semantics) is
much better approach.

...

> * At probe time, select "default" state since the port is closed.
> * At port open time, select "open" state if it exists.
> * If a port runtime suspends while open, select "idle" state if it exists.
> * If a port runtime resumes while open, try to select "open" if it
> exists, or fallback to "default".
> * If a port does system suspend while open, select "sleep" state if it exists.
> * If a port does system resume while open, try to select "open" if it
> exists, or fallback to "default".

> * If any kind of suspend/resume happens while a port is closed, it
> stays in "default"

Not sure about this one as it might be tricky for the case with OOB wake.
Yeah, it's questionable if we want wake source on never opened port
(kernel console?).

--
With Best Regards,
Andy Shevchenko