Re: [PATCH v2] pinctrl: mcp23s08: delete regmap reg_defaults to avoid cache sync issues
From: Linus Walleij
Date: Mon Oct 13 2025 - 09:22:32 EST
Hi Maksim,
thanks for your patch!
On Thu, Oct 9, 2025 at 3:29 PM <bigunclemax@xxxxxxxxx> wrote:
>
> From: Maksim Kiselev <bigunclemax@xxxxxxxxx>
>
> The probe function does not guarantee that chip registers are in their
> default state. Thus using reg_defaults for regmap is incorrect.
>
> For example, the chip may have already been configured by the bootloader
> before the Linux driver loads, or the mcp might not have a reset at all
> and not reset a state between reboots.
>
> In such cases, using reg_defaults leads to the cache values diverging
> from the actual registers values in the chip.
>
> Previous attempts to fix consequences of this issue were made in
> 'commit 3ede3f8b4b4b ("pinctrl: mcp23s08: Reset all pins to input at
> probe")', but this is insufficient. The OLAT register reset is also
> required. And there's still potential for new issues arising due to cache
> desynchronization of other registers.
>
> Therefore, remove reg_defaults entirely to eliminate the root cause
> of these problems.
>
> Also remove the force reset all pins to input at probe as it is no longer
> required.
>
> Link: https://lore.kernel.org/all/20251006074934.27180-1-bigunclemax@xxxxxxxxx/
> Suggested-by: Mike Looijmans <mike.looijmans@xxxxxxxx>
> Signed-off-by: Maksim Kiselev <bigunclemax@xxxxxxxxx>
I would surely like to see some Tested-by on this patch because
this driver has *many* users.
I added some people to the To: line who recently made changes to this
driver, maybe they can test.
Yours,
Linus Walleij