public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: "Mathieu Dubois-Briand" <mathieu.dubois-briand@bootlin.com>
Cc: "Srinivas Kandagatla" <srini@kernel.org>,
	"Grégory Clement" <gregory.clement@bootlin.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvmem: layouts: Add fixed-layout driver
Date: Tue, 05 May 2026 15:15:20 +0200	[thread overview]
Message-ID: <87v7d2ngk7.fsf@bootlin.com> (raw)
In-Reply-To: <DIARECJS0ULK.2R40QF1AOGRAY@bootlin.com> (Mathieu Dubois-Briand's message of "Tue, 05 May 2026 14:58:15 +0200")

Hello,

>>> Current implementation isn't working well when device tree nodes have a
>>> phandle on a fixed-layout nvmem node. As the fixed layout is handled in
>>> nvmem core, no driver is ever associated with the layout, and the device
>>> consumer driver probe is deferred indefinitely.
>>>
>>> Remove the specific handling of fixed-layout and add a layout driver.
>>> This makes the fixed-layout similar to all other layouts, fixing the
>>> whole issue.
>>
>> I guess this deserves a Fixes tag as well as a stable backport.
>>
>
> That's right. I will add:
> Fixes: fc29fd821d9a (nvmem: core: Rework layouts to become regular devices)
>
> Arguably, we could reference a commit even before, but I believe this is
> the commit that introduced a different behaviour between fixed-layout
> and other layouts.

Agreed.

Please also don't forget to add there:

Cc: stable@vger.kernel.org

>>> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
>>> ---
>>>  MAINTAINERS                          |  5 ++++
>>>  drivers/nvmem/core.c                 | 23 +---------------
>>>  drivers/nvmem/layouts.c              | 11 --------
>>>  drivers/nvmem/layouts/Makefile       |  1 +
>>>  drivers/nvmem/layouts/fixed-layout.c | 52 ++++++++++++++++++++++++++++++++++++
>>>  include/linux/nvmem-provider.h       |  7 +++++
>>>  6 files changed, 66 insertions(+), 33 deletions(-)
>>>
>>
>> [...]
>>
>>> diff --git a/drivers/nvmem/layouts/Makefile b/drivers/nvmem/layouts/Makefile
>>> index 4940c9db0665..fbc195aa382c 100644
>>> --- a/drivers/nvmem/layouts/Makefile
>>> +++ b/drivers/nvmem/layouts/Makefile
>>> @@ -3,6 +3,7 @@
>>>  # Makefile for nvmem layouts.
>>>  #
>>>  
>>> +obj-y += fixed-layout.o
>>
>> This implies that you cannot remove that driver. I'm fine with it, but
>> maybe since this is now almost costless, we could have a Kconfig entry
>> that defaults to =y? This is not a blocker, I have no strong
>> opinion. Srinivas?
>>
>
> Right. My first idea was fixed-layout is still a bit special, and should
> always be present, just as before. But thinking again about it, there is
> no real reason to make it different.
>
> I will wait for Srinivas opinion, but I'm open to make it optional.
> Should this be a separate commit, so it can be excluded from a potential
> backport?

Definitely.

>>>  obj-$(CONFIG_NVMEM_LAYOUT_SL28_VPD) += sl28vpd.o
>>>  obj-$(CONFIG_NVMEM_LAYOUT_ONIE_TLV) += onie-tlv.o
>>>  obj-$(CONFIG_NVMEM_LAYOUT_U_BOOT_ENV) += u-boot-env.o
>>> diff --git a/drivers/nvmem/layouts/fixed-layout.c b/drivers/nvmem/layouts/fixed-layout.c
>>> new file mode 100644
>>> index 000000000000..e5078d72a6fc
>>> --- /dev/null
>>> +++ b/drivers/nvmem/layouts/fixed-layout.c
>>> @@ -0,0 +1,52 @@
>>> +// SPDX-License-Identifier: GPL-2.0-only
>>> +/*
>>> + * Copyright 2025 Bootlin
>>
>> Can probably be bumped :-)
>>
>
> Thanks :)
>
>>> + *
>>> + * Authors: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
>>> + */
>>> +
>>> +#include <linux/nvmem-provider.h>
>>> +#include <linux/of.h>
>>
>> Thanks,
>> Miquèl
>
> Thanks for your review,
> Mathieu

      reply	other threads:[~2026-05-05 13:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  8:42 [PATCH] nvmem: layouts: Add fixed-layout driver Mathieu Dubois-Briand
2026-05-05  9:14 ` Miquel Raynal
2026-05-05 12:58   ` Mathieu Dubois-Briand
2026-05-05 13:15     ` Miquel Raynal [this message]

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=87v7d2ngk7.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=gregory.clement@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.dubois-briand@bootlin.com \
    --cc=srini@kernel.org \
    --cc=thomas.petazzoni@bootlin.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