public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@nabladev.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: linux-i2c@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Srinivas Kandagatla <srini@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvmem: core: eeprom: at24: Handle EEPROM with both read-only and wp-gpios
Date: Wed, 22 Apr 2026 13:33:08 +0200	[thread overview]
Message-ID: <210b41ca-28be-42ca-819b-de5f17dddec7@nabladev.com> (raw)
In-Reply-To: <CAMRc=Mcxport3yb28Bbf5OM5VGCerfvLnCZQvLncpUO5--vbYw@mail.gmail.com>

On 4/22/26 11:07 AM, Bartosz Golaszewski wrote:
> On Tue, Apr 21, 2026 at 4:08 PM Marek Vasut <marex@nabladev.com> wrote:
>>
>> Handle special-case of AT24 EEPROM described in DT, which contains both
>> "read-only" and "wp-gpios" properties. Interpret this configuration as
>> default read-only, but with the possibility of unlock via force_ro sysfs
>> attribute.
>>
> 
> Patch looks ok code-wise but does this really make sense? If an EEPROM
> is read-only, we should forbid writes in the kernel. Which board uses
> it? Can we simply remove the read-only flag from DT?

Currently I am not aware of any upstream users, I plan to introduce one 
once this patch or some for of it lands.

I have is an ID EEPROM which I would like to be able to program under 
special circumstances (hence the wp-gpios control) , but it should be by 
default read-only .

If I remove the read-only, then by default the EEPROM is read-write, 
which is undesired. If I remote wp-gpios then I loose access to the 
force_ro attribute which controls the nWP GPIO from userspace, which is 
undesired.

So I think defining this special-case where wp-gpios and read-only are 
used together as default-read-only is sensible.

> Admittedly: the DT bindings do allow it as read-only and wp-gpios are
> not mutually exclusive but I think it's more of an accidental omission
> than a planned feature.
I think it is currently an undefined behavior, and this patch defines it.

  reply	other threads:[~2026-04-22 16:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 14:06 [PATCH] nvmem: core: eeprom: at24: Handle EEPROM with both read-only and wp-gpios Marek Vasut
2026-04-22  9:07 ` Bartosz Golaszewski
2026-04-22 11:33   ` Marek Vasut [this message]
2026-04-22 17:01     ` Marek Vasut
2026-04-23  7:42       ` Bartosz Golaszewski
2026-04-23  9:37         ` Marek Vasut
2026-04-23 12:17           ` Bartosz Golaszewski
2026-04-23 14:06             ` Marek Vasut
2026-04-23 14:19               ` Bartosz Golaszewski
2026-04-23 19:15                 ` Marek Vasut
2026-04-24  8:12                   ` Bartosz Golaszewski
2026-04-26  2:49                     ` Marek Vasut

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=210b41ca-28be-42ca-819b-de5f17dddec7@nabladev.com \
    --to=marex@nabladev.com \
    --cc=arnd@arndb.de \
    --cc=brgl@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srini@kernel.org \
    /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