Re: [PATCH v3 06/11] nvmem: manage cell attributes independently of device resources
From: Bartosz Golaszewski
Date: Mon Nov 30 2026 - 10:22:44 EST
On Fri, Nov 20, 2026 at 01:08:36PM -0700, James Hilliard wrote:
> Cell attributes are populated once and remain until device deletion. A
> layout bound after provider registration therefore cannot publish its
> cells through an existing group, and the group cannot be refreshed when
> cells are removed.
>
> Keep the group in the NVMEM device and explicitly allocate and release
> its attributes. Each attribute holds a cell reference until sysfs has
> drained its readers. Rebuild the group from the current cell list, and
> unwind partial allocations if population fails.
>
> Serialize group replacement separately from cell-list updates so removal
> can wait for sysfs readers without holding nvmem_mutex. Remove the group
> before device deletion on both unregister and registration failure.
>
> Fixes: 0331c611949f ("nvmem: core: Expose cells through sysfs")
> Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
> ---
FWIW I've posted an overlapping patch several weeks ago:
https://lore.kernel.org/all/20261028-nvmem-no-devm-in-core-v2-1-8ad001474cc4@xxxxxxxxxxxxxxxx/
Bart