lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALHCpMjy=J7PNuDBPGOWzf35pmTAzw846DabGuHjN8nn3CftCA@mail.gmail.com>
Date: Mon, 27 Oct 2025 15:04:25 +0300
From: Maxim Kiselev <bigunclemax@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-gpio@...r.kernel.org, akaessens@...il.com, 
	arturas.moskvinas@...il.com, e.shatokhin@...ro.com, linus.walleij@...aro.org, 
	linux-kernel@...r.kernel.org, mastichi@...il.com, mike.looijmans@...ic.nl, 
	radim.pavlik@...-biometrics.com, u.kleine-koenig@...gutronix.de, 
	zou_wei@...wei.com, Sander Vanheule <sander@...nheule.net>
Subject: Re: [PATCH v3] pinctrl: mcp23s08: init reg_defaults from HW at probe
 and switch cache type

Hi !

пн, 27 окт. 2025 г. в 14:49, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com>:
>
> On Mon, Oct 27, 2025 at 01:46:26PM +0300, bigunclemax@...il.com wrote:
> >
> > 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 and provide num_reg_defaults_raw. In that
> > case the cache defaults being initialized from hardware.
> >
> > Also switch cache type to REGCACHE_MAPLE, which is aware of (in)valid
> > cache entries.
> >
> > And remove the force reset all pins to input at probe as it is no longer
> > required.
>
> > ---
>
> No changelog? No need to resend, just reply with the missing piece.

Sorry, my bad.

Changelog:
v3:
 - changed cache type from REGCACHE_FLAT to REGCACHE_MAPLE
 - added .num_reg_defaults_raw to init regs cache from HW at probe

v2:
 - rollback v1 changes
 - dropped .reg_defaults of mcp23x regmaps
 - dropped reset all pins to input at probe (commit 3ede3f8b4b4b)


>
> >  drivers/pinctrl/pinctrl-mcp23s08.c | 40 +++---------------------------
> >  1 file changed, 4 insertions(+), 36 deletions(-)
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ