From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 4BE63353EF3 for ; Tue, 5 May 2026 12:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777985910; cv=none; b=QjmIBk0sZqEps8o85IWqTGUdKn2ZV+qlEm51bCoX1blXRW6M78bCjlPvon/V983yaVx6Fr9MKOFxgiRyUoADJbY9/qzo4ujbloBqbjiBZ3U7jDqRIY1HbSOUFuBvF9p2RkJTzTWHjck4EFOm77giFCOQSNhCOc1ZNdcpLBJLaF0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777985910; c=relaxed/simple; bh=9himcbhcbQY2RtD9vUyZ0Rld6jYQ5zSVa3lvCQLvDsI=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Subject:Cc: References:In-Reply-To; b=hA1TSFESSEJtlaDRL0tmKKCdXAAqmLemIJqaDl1okWPoqUydqb13eQe5wZ4gUuq1SxNGnWHwbjxg+FsdcmUV/IsPz1bgnrNUjfzY+RbPI3+0xdLSVxmBLTHYzjwPdVloI1DjRXa7LQe8t56LTiQ47yuZBUuK7MgqxkSU7rB38J4= 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=te4UN3zJ; arc=none smtp.client-ip=185.171.202.116 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="te4UN3zJ" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id A93D7C5D73C; Tue, 5 May 2026 12:59:04 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D4BA16053C; Tue, 5 May 2026 12:58:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 523B311AD017C; Tue, 5 May 2026 14:58:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1777985897; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=B0MTu01V/xEanPSLE8STJmUDPByIun0SobwUcPXdghg=; b=te4UN3zJkEu43ABZQmiWWBFyg1lXkJDOQL7Qj4RRH4f64nL7S8sLHt5D0JQNjuhVRi1Yg0 jUwEOrmLJ2K2Mg0xoYSLVHnjgiCMsaSVoxAtWL3Qy7x35+8BuvUPVGDQ9wACnNOWhuIR6/ SXsgfxhhjxYjawu1g41XtExoQuwqmN5ahjkk8+anmcO/wJmDTAxLrXNemCQTEvWUS9pG7F lhT7UxY+j9xTmBk1ZektYJ7BevWaUIqxxBf1VGNJNk7DDWZLkuTpZJ5t2FUE/RPhgPGGix 6uTbUcZpECQJ+YW1PgxrLb7Vi4jIQEhRAT26vpI25IB4AiLI7wVpdQT4akhwBQ== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 05 May 2026 14:58:15 +0200 Message-Id: From: "Mathieu Dubois-Briand" To: "Miquel Raynal" Subject: Re: [PATCH] nvmem: layouts: Add fixed-layout driver Cc: "Srinivas Kandagatla" , =?utf-8?q?Gr=C3=A9gory_Clement?= , "Thomas Petazzoni" , X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260505-mathieu-nvmem-fixed-layout-v1-1-7f6ecbce108d@bootlin.com> <87cxzap69t.fsf@bootlin.com> In-Reply-To: <87cxzap69t.fsf@bootlin.com> X-Last-TLS-Session-Version: TLSv1.3 On Tue May 5, 2026 at 11:14 AM CEST, Miquel Raynal wrote: > Hi Mathieu, Hi Miquel, > > On 05/05/2026 at 10:42:10 +02, Mathieu Dubois-Briand wrote: > >> 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. >> 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/Make= file >> index 4940c9db0665..fbc195aa382c 100644 >> --- a/drivers/nvmem/layouts/Makefile >> +++ b/drivers/nvmem/layouts/Makefile >> @@ -3,6 +3,7 @@ >> # Makefile for nvmem layouts. >> # >> =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? >> 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/layout= s/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 --=20 Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com