pinctrl: mcp23s08: delete regmap reg_defaults to avoid cache sync issues
Quoted 34 lines · Linus Walleij
Hi Maksim,
thanks for your patch!
Quoted 22 lines · On Thu, Oct 9, 2025 at 3:29 PM <[email protected]> wrote:
From: Maksim Kiselev <[email protected]>
The probe function does not guarantee that chip registers are in their default state. Thus using
reg_defaultsfor 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_defaultsleads 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_defaultsentirely to eliminate the root cause of these problems.Quoted 6 lines
Also remove the force reset all pins to input at probe as it is no longer required.
Suggested-by Mike Looijmans <[email protected]>Signed-off-by Maksim Kiselev <[email protected]>
Quoted 5 lines
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.
To add, I would suggest to look at Cypress driver, it uses the method to recover defaults from the actual HW state.
Signature · 2 lines
With Best Regards, Andy Shevchenko