Re: [PATCH] pinctrl: Fix the clean up on pinconf_apply_setting failure

From: Linus Walleij
Date: Fri Dec 27 2024 - 11:10:53 EST


Hi Mukesh,

thanks for your patch!

On Tue, Dec 24, 2024 at 9:45 AM Mukesh Ojha
<mukesh.ojha@xxxxxxxxxxxxxxxx> wrote:

> When some client does devm_pinctrl_get() followed by
> pinctrl_select_state() that does pinmux first successfully and later
> during config setting it sets the wrong drive strenght to the pin due to
> which pinconf_apply_setting fails. Currently, on failure during config
> setting is implemented as if pinmux has failed for one of the pin but
> that does not seem right and need to undo the pinmux for all the pin if
> config setting fails.
>
> Current commit does a bit refactor to reuse the code and tries to clean
> up mux setting on config setting failure.
>
> Signed-off-by: Mukesh Ojha <mukesh.ojha@xxxxxxxxxxxxxxxx>

Hats off, it's a real nice patch. I bet these are design flaws from
my initial implementation ~13 years ago.

I have applied it for -next (v6.14) while we test it in linux-next and
think about if we should even back-port this to stable.

Yours,
Linus Walleij