Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp724804rdg; Wed, 11 Oct 2023 03:59:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/lGiYyChl97kngAs6QwFN23k+QXWKLn6j9bC/JNNe1lUOSin0wKKQf8CCwc9yXvYI0YK+ X-Received: by 2002:a05:6808:1aa5:b0:3ad:f6ad:b9ce with SMTP id bm37-20020a0568081aa500b003adf6adb9cemr19540246oib.15.1697021960560; Wed, 11 Oct 2023 03:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697021960; cv=none; d=google.com; s=arc-20160816; b=aghtYXJFKkHUciIwdjzgkm0tFdpeFP3BCUviCe93JlKRyZD5tyx8s6on5ExpF6nIaf vtQqD1RJ/1p+f3JAipKqd3vtBC6BiNv9TO6CCy+hPntIAV0nEqh1f0P2vj7i/WDuBKtz buI2LM/7MLEiFuQQDyReRf4S4xiWoMTTYSRKT0GolMvC8tQxQlwEvSkFKQOkmSJ2Y4Y2 8kbt9AEs4yrTshR/cnrfjatZZ9euxP9RtlXvdkNuorr3FLK4f3PYiy/Dmn8w2O8jQVZT 3XqkMVRALTxUXbcpL6EHhSO3FTwwplII+kbOVz/GBA1lEuNpx6jRvlXRMdeJnLX71CoA GRtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=NgoGY8ul0lSIdXFoxr+/I0RYC9e4Hx1h3Y0uNGEGlrU=; fh=YSVHZ/fhem76NWME0xrLEuX2U8OHHDKmJVoGdJ5Jzm0=; b=iqQbvps3WS05pPKnFZe580bYvhi0TbIpab77Eqf/zU5zIhKvOuCkaH+duaGFqjZj4y PQVebSfufs410G/7mPUeHYxMWjuOCxXjApq2Z8TZWiWK6o5J4ngDoIRYv5zZQ9g7wPBp xU2hTfWDermvOJZsJYAW2PBIHmZ3WfmXycOhMxwpLllHkGOtaTakHwRSuE9JYyylBjgk DMxntj4994gSO5UmKctIO6OvZFsTsu/pI0rfUkmNttajU7AU+0K7Xrxxq5aEP7Li2FiE o8ScaxAd4PPmBSNoawKVSvn9FNVzHd2PConvCuNRMUJ8Mb5jV4tQS5vo7YFLCqfBpOze dSJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OeIQh85t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id y3-20020a056a00190300b0068a65b26fc6si12226328pfi.43.2023.10.11.03.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:59:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OeIQh85t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 9B0A28132A62; Wed, 11 Oct 2023 03:59:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234817AbjJKK7I (ORCPT + 99 others); Wed, 11 Oct 2023 06:59:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346641AbjJKK7G (ORCPT ); Wed, 11 Oct 2023 06:59:06 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EE3A92; Wed, 11 Oct 2023 03:59:04 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 66B07FF80A; Wed, 11 Oct 2023 10:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697021943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NgoGY8ul0lSIdXFoxr+/I0RYC9e4Hx1h3Y0uNGEGlrU=; b=OeIQh85t+T0KKgIbElD8x57btZYA7ztF4sNusvphfF19MQzs9moZpFj6lNBVF29Ext5FmO 3No3s6AwC51TU9yeP6Svoi3KgE5qeZ/pvajCRyHUns3cHo+Erol7iGkKiCWau/pRBYPI7o NpVql/WHDm3Q5UK7guhJwdghkC3k+4QisqDz+6nBO9i3k8ljYoryE2G5q/XivrNBZ3qOFF +6skM/G2BtnhtOsmtngqovmp4PsdvWASrMD9SiWx0UUkHTopVneVnMq/4jqYct9mCoqOza 96vgxGMre3hQeMhmQcEIeuEs1abh3xAznpI0xs/Va0OeezAIkSUuXNNwAUumUA== Date: Wed, 11 Oct 2023 12:58:59 +0200 From: Miquel Raynal To: Srinivas Kandagatla Cc: Greg Kroah-Hartman , Michael Walle , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Marko , Thomas Petazzoni , Luka Perkov , Randy Dunlap , Chen-Yu Tsai , Daniel Golle Subject: Re: [PATCH v12 5/7] nvmem: core: Rework layouts to become regular devices Message-ID: <20231011125859.1647c08c@xps-13> In-Reply-To: <04112100-026c-b010-6e8c-730049d43e47@linaro.org> References: <20231005155907.2701706-1-miquel.raynal@bootlin.com> <20231005155907.2701706-6-miquel.raynal@bootlin.com> <20231011093843.49831a75@xps-13> <04112100-026c-b010-6e8c-730049d43e47@linaro.org> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 11 Oct 2023 03:59:17 -0700 (PDT) X-Spam-Level: ** Hi Srinivas, > > you don't have access to your modules. And anyway it's probably a bad > > idea to allow endless probe deferrals on your main storage device. > >=20 > > If the cells are not available at that time, it's not a huge deal? The > > consumers will have to wait a bit more (or take any other action, this > > is device dependent). =20 >=20 > In this case the nvmem consumers will get an -ENOENT error, which is very= confusing TBH. Maybe we can solve that situation like that (based on my current series): --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1448,7 +1448,10 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_n= ode *np, const char *id) of_node_put(cell_np); if (!cell_entry) { __nvmem_device_put(nvmem); - return ERR_PTR(-ENOENT); + if (nvmem->layout) + return ERR_PTR(-EAGAIN); + else + return ERR_PTR(-ENOENT); } =20 cell =3D nvmem_create_cell(cell_entry, id, cell_index); So this way when a (DT) consumer requests a cell: - the cell is ready and it gets it - the cell is not ready and... - the cell comes from a layout -> we return EAGAIN, which means the cell is not yet ready and this must be retried later (the caller may return EPROBE_DEFER in this case). - the cell is simply missing/not existing/not available, this is a real error. What do you think? Thanks, Miqu=C3=A8l