public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: bigunclemax@gmail.com
Cc: linux-gpio@vger.kernel.org, akaessens@gmail.com,
	arturas.moskvinas@gmail.com, e.shatokhin@yadro.com,
	linus.walleij@linaro.org, linux-kernel@vger.kernel.org,
	mastichi@gmail.com, mike.looijmans@topic.nl,
	radim.pavlik@tbs-biometrics.com, u.kleine-koenig@pengutronix.de,
	zou_wei@huawei.com, Sander Vanheule <sander@svanheule.net>
Subject: Re: [PATCH v3] pinctrl: mcp23s08: init reg_defaults from HW at probe and switch cache type
Date: Mon, 27 Oct 2025 13:49:28 +0200	[thread overview]
Message-ID: <aP9cSArwCdvPZff3@smile.fi.intel.com> (raw)
In-Reply-To: <20251027104746.282351-1-bigunclemax@gmail.com>

On Mon, Oct 27, 2025 at 01:46:26PM +0300, bigunclemax@gmail.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.

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

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-10-27 11:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-27 10:46 [PATCH v3] pinctrl: mcp23s08: init reg_defaults from HW at probe and switch cache type bigunclemax
2025-10-27 11:49 ` Andy Shevchenko [this message]
2025-10-27 12:04   ` Maxim Kiselev
2025-10-29 14:13     ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aP9cSArwCdvPZff3@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=akaessens@gmail.com \
    --cc=arturas.moskvinas@gmail.com \
    --cc=bigunclemax@gmail.com \
    --cc=e.shatokhin@yadro.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mastichi@gmail.com \
    --cc=mike.looijmans@topic.nl \
    --cc=radim.pavlik@tbs-biometrics.com \
    --cc=sander@svanheule.net \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=zou_wei@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox