From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BECB4C3DA7A for ; Thu, 5 Jan 2023 22:22:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LRCx3gTy3HwzFE4bcOFDpM0aLRutPWV6ElStCH+0O2A=; b=puNTjXGGE1J8g3 yqqDrPPjNdCRzErMMMg+oUCLY/gusvX806krkq3bCtMNguqQ7Nv31Hd2WPGag2AoH5Gd8SfsBR9j+ Ti/ULs+zo0W8ju8zSl4I33dDwU8ZxWWRRKf4Ii6GysUHYvLCcX6Cic17vgtlXBhjrwQtAkDlmlA8k pzrEYBx9iNLctoBJRXhtJLtq+MIXoNn4zdas3OZ3xvCya8SXR6Mq8/s5eknDGHzyQUyxWO2yPRb2O MqpNE4C8cgZ3eqcr5foYKBqX6S3TyD1f/pfmFKzzaZr5ajxnKIqJGbsrYMiwiG+rfHgzBrzSfK0kA IE1cq7QDmZ6lFdp37rCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDYby-00FXMh-R7; Thu, 05 Jan 2023 22:21:24 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDVEx-00DnHT-O8 for linux-arm-kernel@bombadil.infradead.org; Thu, 05 Jan 2023 18:45:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=JhCHkc0mEVa9z8SFt3Ty3XUNkrJ0qgLzmtmqvAN8sTU=; b=E5MaXlQH1HCV5DOFSoRsqCIq8R Vu6YTV1o3oDxoZWp/3wj7sFAPjT+/zFmdWiIrHUx/g7ELbelS9WWeRp9m6w+B0SYkXIGCYYWhZWgb QvLQRMVjg1R2axQ7hx1743i9G5BP/uK2RZb8q7+UgZneYU/gVcfjbH0UDnF8R/YkLtXWGQwBpKvBt SAaFbD3Gg6i+YC5XoD95QlZ7asU6jn6RQZHe7qcW0/EouMh/Ex3AEG+2bPujGyMBVQL01SE1racIT jZ4WM9fxrgRLE3eatq3j3m9VYXP3MesrJj16Xv7n5ZA4fJnP/Uw5GALrJAz3bLjoAVW18BnjYDUHD qxiLcqqQ==; Received: from mx1.tq-group.com ([93.104.207.81]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pDPFc-001JFc-22 for linux-arm-kernel@lists.infradead.org; Thu, 05 Jan 2023 12:21:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1672921306; x=1704457306; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JhCHkc0mEVa9z8SFt3Ty3XUNkrJ0qgLzmtmqvAN8sTU=; b=D6e6+V0djwDAywdwxHjjILQK/aXdhjFBTNg9X8NA2jgUMuDDY2qHukkE Rh1R9bBT4O0n8dSB7M5VuTuYzweZAxBfUHvrh4/6yp0004QzacdUdKwxa dQpuj3dxz1tEbTwGt4s/4Tue6bufblCOslE0pXED6YpvUAJZQ6pAi9FSE JPEHnSraBWpAmTDY065dr7lrsi9b+WP48D/99q1uvcvjaPOe1jdrTcV7w LIO82bmAkAauPrjkZ9NzzdnEoDPfgnYL8cR5NGHptdst0GdW+AdOdBFSZ z3abV219U9QdEL+ZKh+icZ2ryuJXsSC2o43u5sAHwFN9qGuhYO0CRvmQx g==; X-IronPort-AV: E=Sophos;i="5.96,302,1665439200"; d="scan'208";a="28259529" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 05 Jan 2023 13:21:39 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Thu, 05 Jan 2023 13:21:40 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Thu, 05 Jan 2023 13:21:40 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1672921300; x=1704457300; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JhCHkc0mEVa9z8SFt3Ty3XUNkrJ0qgLzmtmqvAN8sTU=; b=hdYAxr+HRLnwe4xxTOqIWS8TdguZInssVHxeqiUY3FtsTMAJSo3dT7S+ RanoKeL+pOIEGc1ViTcfajLzy9+Y4lPnNVk1mZeitekb9k4VYslhHzxm8 ywhnCebYM6v4uxoCKj75wb8szm+8dAK9dcw1l/SdyvtNt4UYz8z7+PysL NqH9gPjj80JjFVS945EiGjFbJs2cA/4bzzaIFjFDUobolRn7JJ2pkUIY2 FfrhYaxZlqbo2k1eru9WX3n3b4SMY6K4mA/lae0Bk33vS28TbCaxARBR7 MOHB3nnqEBoZcNEFs6othQtzo7Xgc2/Bjv9k4Xt0yqdrYrfNXLCL1PRZF Q==; X-IronPort-AV: E=Sophos;i="5.96,302,1665439200"; d="scan'208";a="28259528" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 05 Jan 2023 13:21:39 +0100 Received: from steina-w.localnet (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id A856C280056; Thu, 5 Jan 2023 13:21:39 +0100 (CET) From: Alexander Stein To: Miquel Raynal , Michael Walle Cc: Srinivas Kandagatla , Jonathan Corbet , Rob Herring , Frank Rowand , Sascha Hauer , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Dan Carpenter Subject: Re: [PATCH v5 00/21] nvmem: core: introduce NVMEM layouts Date: Thu, 05 Jan 2023 13:21:37 +0100 Message-ID: <5906091.UjTJXf6HLC@steina-w> Organization: TQ-Systems GmbH In-Reply-To: <34cddc1aa4f8a55c752a9565d1726127@walle.cc> References: <20221206200740.3567551-1-michael@walle.cc> <20230105123534.38a70640@xps-13> <34cddc1aa4f8a55c752a9565d1726127@walle.cc> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230105_122140_934112_1F4A0372 X-CRM114-Status: GOOD ( 25.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Michael, Am Donnerstag, 5. Januar 2023, 13:11:37 CET schrieb Michael Walle: > Hi Alexander, > > thanks for debugging. I'm not yet sure what is going wrong, so > I have some more questions below. > > >> This causes the following errors on existing boards (imx8mq-tqma8mq- > >> mba8mx.dtb): > >> root@tqma8-common:~# uname -r > >> 6.2.0-rc2-next-20230105 > >> > >> > OF: /soc@0: could not get #nvmem-cell-cells for /soc@0/bus@30000000/ > >> > >> efuse@30350000/soc-uid@4 > >> > >> > OF: /soc@0/bus@30800000/ethernet@30be0000: could not get > >> > #nvmem-cell-cells > >> > >> for /soc@0/bus@30000000/efuse@30350000/mac-address@90 > >> > >> These are caused because '#nvmem-cell-cells = <0>;' is not explicitly > >> set in > >> DT. > >> > >> > TI DP83867 30be0000.ethernet-1:0e: error -EINVAL: failed to get nvmem > >> > cell > >> > >> io_impedance_ctrl > >> > >> > TI DP83867: probe of 30be0000.ethernet-1:0e failed with error -22 > >> > >> These are caused because of_nvmem_cell_get() now returns -EINVAL > >> instead of - > >> ENODEV if the requested nvmem cell is not available. > > What do you mean with not available? Not yet available because of probe > order? Ah, I was talking about there is no nvmem cell being used in my PHY node, e.g. no 'nvmem-cells' nor 'nvmem-cell-names' (set to 'io_impedance_ctrl'). That's why of_property_match_string returns -EINVAL. > > Should we just assume #nvmem-cell-cells = <0> by default? I guess it's > > a safe assumption. > > Actually, that's what patch 2/21 is for. > > Alexander, did you verify that the EINVAL is returned by > of_parse_phandle_with_optional_args()? Yep. --8<-- diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 1b61c8bf0de4..f2a85a31d039 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1339,9 +1339,11 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, const char *id) if (id) index = of_property_match_string(np, "nvmem-cell-names", id); + pr_info("%s: index: %d\n", __func__, index); ret = of_parse_phandle_with_optional_args(np, "nvmem-cells", "#nvmem-cell-cells", index, &cell_spec); + pr_info("%s: of_parse_phandle_with_optional_args: %d\n", __func__, ret); if (ret) return ERR_PTR(ret); --8<-- Results in: > [ 1.861896] of_nvmem_cell_get: index: -22 > [ 1.865934] of_nvmem_cell_get: of_parse_phandle_with_optional_args: -22 > [ 1.872595] TI DP83867 30be0000.ethernet-1:0e: error -EINVAL: failed to get nvmem cell io_impedance_ctrl > [ 2.402575] TI DP83867: probe of 30be0000.ethernet-1:0e failed with error -22 So, the index is wrong in the first place, but this was no problem until now. Best regards, Alexander _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel