From patchwork Wed Apr 26 07:36:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 87694 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp72825vqo; Wed, 26 Apr 2023 00:55:20 -0700 (PDT) X-Google-Smtp-Source: AKy350Zbm02ejVs5D64Fl3h44SZZwK2XhxlO/5T5JF+95hoNUa7en25p1fn2E1M+AcFDq/fK961M X-Received: by 2002:a05:6a20:8f29:b0:f2:813b:ac5c with SMTP id b41-20020a056a208f2900b000f2813bac5cmr23581859pzk.21.1682495719859; Wed, 26 Apr 2023 00:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682495719; cv=none; d=google.com; s=arc-20160816; b=mKgvQnimuRknJlI5YeHxsYoU4l/GZlYFl/EZtuuzRhSkVQ08vYi8//QWjyRmXK9SpK mnWYvA5q32TIVghhUMNVOMARAjBA83rODQkeq/HCXK5QdR8My7LtDkdxCZsQ/o/PBEID 5xT4scQDzlPBKBgukJbBmQ52hIxMHzVvVQQ4xKqvH+oMzUtKPBxE853OIiuauwYK6Wwd InW5V3/aTNgl2Sg2R51CSEWwrAfhTc1pvz0XZ20uPZk+oi5h+Csv6yZ8KERcOy7YowmZ oN6HeSWdHPnhldzg3AcrvS9Y8d8l118GoWCkg9nFcMzZMebaEb8bcFUzzknrCl/w/cWU 6imQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2gMo3+6yJgM1RhFv5pwf0HhZ2CqqzaenJjvpSBYPU1U=; b=WVkzFOQNQ1+qUkkI4sOqQPRHvgOjwiIIqs1NApwRZjDI9RFoHAJBu20NO86l9Kq6X0 lDG4bpgp2fcbrt/fB+GMjreF6wmGiRXurOl4lLxqqDUsAm2BPlH06gcYUdEIgphrBnxR U+zPOJsLPp05JnZIsBUIXWfnPJKx4QF8rnEEU/T3YVU1D3/2sHyaS9ORRdgE0aCkwM0u a+OH/KNM7OnayNDm09nZShJ16QrHBQ3wHSHMHS4JJDGNyZDW7Bo5MxrPQS+jKfv9sUnB 2JK3ld3AMcDniGfzxuIfjWNIj2CtHzHoxaFsuRfWOLmJerqtqjnsTJdp6qy2URyDjiYW IJ/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=cVdGqoNP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020a654141000000b0051b749eb32fsi15149240pgp.562.2023.04.26.00.55.03; Wed, 26 Apr 2023 00:55:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=cVdGqoNP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239795AbjDZHlq (ORCPT + 99 others); Wed, 26 Apr 2023 03:41:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239848AbjDZHl2 (ORCPT ); Wed, 26 Apr 2023 03:41:28 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2573F3AA6 for ; Wed, 26 Apr 2023 00:41:25 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 6073F5FD6F; Wed, 26 Apr 2023 10:41:23 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1682494883; bh=2gMo3+6yJgM1RhFv5pwf0HhZ2CqqzaenJjvpSBYPU1U=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=cVdGqoNPv6iHUtqd8oaNXO4U5yhqS+mPEh7Oo/BPDBwzFUrp6ccrxFtVtXJSrycuL xrolozu6/KlN2+Gt01fzBhEfSaXtoHGu6dJl+zDOFxOxF687hYMpr8cJjI5MijHW9h c/BFMuNthBV98PYG84bkK1sZi9RsZS541Fer7W0bRMs9UfHr9ozmMfoR46hIdioOE5 JipYeSaVdJ/orpgYV7kD96znwu0NmHhhKKjf6E45ileKOOF5QgbojKdtmOh59QbEO+ FqhtXT1vvcLYBCcaVeP1lHQvBxYkFBy9uV9pGtGYk+UABWPOBf3u17ZTlHKThsh7Vy AvB5SAWlzIbPg== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 26 Apr 2023 10:41:23 +0300 (MSK) From: Arseniy Krasnov To: Liang Yang , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Yixun Lan , Jianxin Pan CC: , , Arseniy Krasnov , , , , Subject: [PATCH v2 5/5] mtd: rawnand: meson: rename node for chip select Date: Wed, 26 Apr 2023 10:36:31 +0300 Message-ID: <20230426073632.3905682-6-AVKrasnov@sberdevices.ru> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230426073632.3905682-1-AVKrasnov@sberdevices.ru> References: <20230426073632.3905682-1-AVKrasnov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/04/26 04:45:00 #21166225 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764224631610170506?= X-GMAIL-MSGID: =?utf-8?q?1764224631610170506?= This renames node with values for chip select from "reg" to "cs". It is needed because when OTP access is enabled on the attached storage, MTD subsystem registers this storage in the NVMEM subsystem. NVMEM in turn tries to use "reg" node in its own manner, supposes that it has another layout. All of this leads to device initialization failure. Example: [...] nvmem mtd0-user-otp: nvmem: invalid reg on /soc/bus@ffe00000/... [...] mtd mtd0: Failed to register OTP NVMEM device [...] meson-nand ffe07800.nfc: failed to register MTD device: -22 [...] meson-nand ffe07800.nfc: failed to init NAND chips [...] meson-nand: probe of ffe07800.nfc failed with error -22 Signed-off-by: Arseniy Krasnov --- drivers/mtd/nand/raw/meson_nand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index 3737024c33d6..4ff3a3e50c4b 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1537,7 +1537,7 @@ meson_nfc_nand_chip_init(struct device *dev, int ret, i; u32 tmp, nsels; - nsels = of_property_count_elems_of_size(np, "reg", sizeof(u32)); + nsels = of_property_count_elems_of_size(np, "cs", sizeof(u32)); if (!nsels || nsels > MAX_CE_NUM) { dev_err(dev, "invalid register property size\n"); return -EINVAL; @@ -1551,7 +1551,7 @@ meson_nfc_nand_chip_init(struct device *dev, meson_chip->nsels = nsels; for (i = 0; i < nsels; i++) { - ret = of_property_read_u32_index(np, "reg", i, &tmp); + ret = of_property_read_u32_index(np, "cs", i, &tmp); if (ret) { dev_err(dev, "could not retrieve register property: %d\n", ret);