From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A03921883E for ; Tue, 5 May 2026 13:15:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777986931; cv=none; b=tvo2yo/dtXl/Ixj4GmxtmD3pikmDgL/RdaIsyaWknaobMamHQB3t4mq+c7DWoOguAl4oI4ofvHG8WewAWEzJHu1xuaXORUK+i5RzK+qvKsk6mt8HohHOtDs3kIj5vnf/DrPU2ZVdkHx3lEGYsyqQCnZAxOBlW86YFirItbF0u2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777986931; c=relaxed/simple; bh=bscO6BQkdkL4Ww3pnkW5N1OkHSMwdNnK5idj6/pUGF8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=DrghyODMdmDY933HpRTFR9lnG+PBom8ZnSVXyN2W7e6vxdXchjjL+2cx8oke/6H577iQYxAfbcPfqm2gcDMM/acWU5utkFdTlKR33YuOtkolU4ARXVQlGtCQDLNgdrnaD45NBKywMqdBKUKGr8nmaDvKlFblEvk+ZahmF0twLLM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=tRGCX0Bw; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="tRGCX0Bw" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id A07424E42BB4 for ; Tue, 5 May 2026 13:15:21 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 76AA36053C; Tue, 5 May 2026 13:15:21 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 71D0011AD019C; Tue, 5 May 2026 15:15:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1777986921; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=sqkZG5Vr4KFSjF7V7myYMqKdjg+fXP7zx4rXlD/HJ/k=; b=tRGCX0Bwc78qfueKkv9UOWUplRTiTln23Ezt8LH1PGAvahdJ/6/M3RhA05mulgLlW8I3di qIRG8JkC6XJCNfrUZa0UIKLtRm3Dy9tAIY3E8xoNlttGnjdQx1WQvtql8s6E2OEm2Oe4Ug d/qZ7k0l5hgFOGWcF+kLICLE9cbrv/t6SZKmkKeich2nZTdKIcvwg6mdwdtYzxnyzCOK7V buvC2ztMyQ3T36Z2Nw7CF/JgSDVYrsqXi3zBfkfGmZyVITbqkVnpZE8xkv7IQoeuBnGrHJ 8nwKTReEFW3hMcJ1Gg2G4WLS3ba9cSkCQi/7j95FWr2MZVUfTkIO8kPwi/xRvA== From: Miquel Raynal To: "Mathieu Dubois-Briand" Cc: "Srinivas Kandagatla" , =?utf-8?Q?Gr=C3=A9gory?= Clement , "Thomas Petazzoni" , Subject: Re: [PATCH] nvmem: layouts: Add fixed-layout driver In-Reply-To: (Mathieu Dubois-Briand's message of "Tue, 05 May 2026 14:58:15 +0200") References: <20260505-mathieu-nvmem-fixed-layout-v1-1-7f6ecbce108d@bootlin.com> <87cxzap69t.fsf@bootlin.com> User-Agent: mu4e 1.12.7; emacs 30.2 Date: Tue, 05 May 2026 15:15:20 +0200 Message-ID: <87v7d2ngk7.fsf@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 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 device= s) > > 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 >>> --- >>> 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/Mak= efile >>> index 4940c9db0665..fbc195aa382c 100644 >>> --- a/drivers/nvmem/layouts/Makefile >>> +++ b/drivers/nvmem/layouts/Makefile >>> @@ -3,6 +3,7 @@ >>> # Makefile for nvmem layouts. >>> # >>>=20=20 >>> +obj-y +=3D 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 =3Dy? 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) +=3D sl28vpd.o >>> obj-$(CONFIG_NVMEM_LAYOUT_ONIE_TLV) +=3D onie-tlv.o >>> obj-$(CONFIG_NVMEM_LAYOUT_U_BOOT_ENV) +=3D u-boot-env.o >>> diff --git a/drivers/nvmem/layouts/fixed-layout.c b/drivers/nvmem/layou= ts/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 >>> + */ >>> + >>> +#include >>> +#include >> >> Thanks, >> Miqu=C3=A8l > > Thanks for your review, > Mathieu