mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srini@kernel.org>
To: "James Hilliard" <james.hilliard1@gmail.com>,
	"Srinivas Kandagatla" <srini@kernel.org>,
	"Mathieu Dubois-Briand" <mathieu.dubois-briand@bootlin.com>,
	"Michael Walle" <mwalle@kernel.org>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"Michael Walle" <michael@walle.cc>,
	"Linus Walleij" <linusw@kernel.org>,
	"Khouloud Touil" <ktouil@baylibre.com>,
	"Bartosz Golaszewski" <brgl@kernel.org>
Cc: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Paul Cercueil <paul@crapouillou.net>,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org
Subject: Re: [PATCH v3 01/11] nvmem: retain the provider node until device release
Date: Fri, 27 Nov 2026 11:16:02 +0000	[thread overview]
Message-ID: <c55a06b5-f264-404c-b388-f74a283d123a@kernel.org> (raw)
In-Reply-To: <20261120-submit-nvmem-provider-lifetime-v1-v3-1-523610652402@gmail.com>



On 11/20/26 8:08 PM, James Hilliard wrote:
> An NVMEM device can outlive its provider after unregister. Take a
> reference to the configured OF node, or reuse the provider device's node
> when none is specified. Drop the reference in the device release path
> so the node remains valid for the lifetime of the NVMEM device.
> 
> Fixes: 1333a6779501 ("nvmem: core: allow specifying of_node")

Thanks for sending out the patches, Few things to remember.

1. None of the fixes have Stable Tag,

2. fixes should be first in the series, so that it becomes easy to pick
them up for next rc.

I have picked up few fixes with these changes but pl be mindful next time.


--srini

> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>  drivers/nvmem/core.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index 7d4cce8e2742..03ea878874e4 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -570,6 +570,7 @@ static void nvmem_release(struct device *dev)
>  	gpiod_put(nvmem->wp_gpio);
>  	nvmem_device_remove_all_cells(nvmem);
>  	ida_free(&nvmem_ida, nvmem->id);
> +	of_node_put(nvmem->dev.of_node);
>  	cleanup_srcu_struct(&nvmem->srcu);
>  	kfree(nvmem);
>  }
> @@ -973,9 +974,9 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
>  	nvmem->keepout = config->keepout;
>  	nvmem->nkeepout = config->nkeepout;
>  	if (config->of_node)
> -		nvmem->dev.of_node = config->of_node;
> +		nvmem->dev.of_node = of_node_get(config->of_node);
>  	else
> -		nvmem->dev.of_node = config->dev->of_node;
> +		device_set_of_node_from_dev(&nvmem->dev, config->dev);
>  
>  	switch (config->id) {
>  	case NVMEM_DEVID_NONE:
> 


  reply	other threads:[~2026-11-27 11:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 20:08 [PATCH v3 00/11] nvmem: complete provider and layout disconnection James Hilliard
2026-11-20 20:08 ` [PATCH v3 01/11] nvmem: retain the provider node until device release James Hilliard
2026-11-27 11:16   ` Srinivas Kandagatla [this message]
2026-11-20 20:08 ` [PATCH v3 02/11] nvmem: drain keepout and cell post-processing accesses James Hilliard
2026-11-20 20:08 ` [PATCH v3 03/11] nvmem: exclude disconnected providers from callback admission James Hilliard
2026-11-20 20:08 ` [PATCH v3 04/11] nvmem: release write protection when the provider disconnects James Hilliard
2026-11-20 20:08 ` [PATCH v3 05/11] nvmem: reference cell entries independently of their provider list James Hilliard
2026-11-20 20:08 ` [PATCH v3 06/11] nvmem: manage cell attributes independently of device resources James Hilliard
2026-11-20 20:08 ` [PATCH v3 07/11] nvmem: distinguish layout cells from provider cells James Hilliard
2026-11-20 20:08 ` [PATCH v3 08/11] nvmem: disconnect cells before removing their layout James Hilliard
2026-11-20 20:08 ` [PATCH v3 09/11] nvmem: disconnect published devices before registration rollback James Hilliard
2026-11-20 20:08 ` [PATCH v3 10/11] nvmem: u-boot-env: propagate cell registration errors James Hilliard
2026-11-20 20:08 ` [PATCH v3 11/11] nvmem: allow providers to specify an explicit NULL owner James Hilliard
2026-11-27 11:14 ` (subset) [PATCH v3 00/11] nvmem: complete provider and layout disconnection Srinivas Kandagatla

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=c55a06b5-f264-404c-b388-f74a283d123a@kernel.org \
    --to=srini@kernel.org \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=james.hilliard1@gmail.com \
    --cc=ktouil@baylibre.com \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mathieu.dubois-briand@bootlin.com \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=mwalle@kernel.org \
    --cc=paul@crapouillou.net \
    --cc=rafal@milecki.pl \
    /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

all inboxes | Powered by JetHome®