"sleep" set of pins, and this particular platform suspends and
resumes
in a way that the pin states are not preserved by the hardware, when
we
resume, we would call pinctrl_single_resume() ->
pinctrl_force_default()

-> pinctrl_select_state() and the first thing we do is check that the
pins state is the same as before, and do nothing.

Advertising

In order to fix this, decouple the actual state change from

pinctrl_select_state() and move it pinctrl_commit_state(), while
keeping
the p->state == state check in pinctrl_select_state() not to change
the

caller assumptions. pinctrl_force_sleep() and pinctrl_force_default()

are updated to bypass the state check by calling
pinctrl_commit_state().

I don't often go back over a year worth of LKML, but since this patch
recently landed in mainline as 981ed1bfbc6c, I though I'd use it as an
anchor to report the following:

It turns out that this patch completely breaks resume on my
rk3399-based Chromebook. Most things are timing out, the box is
unusable. And since this is my everyday tool, I'm mildly grumpy. Please
don't break my toys! ;-) Reverting this patch on top of 4.16-rc2 makes
me productive again...

More seriously, I have no idea what's wrong here. It could be a
SoC-related issue, hence Heiko on Cc. I'm happy to test any idea you
could have.