Message ID | 20230718084804.20139-1-zajec5@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1607983vqt; Tue, 18 Jul 2023 02:14:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlFhG9jEVJqKPKJo1dyrt3BBYlQ7Bu8iQmekgjqF1Sr7WW0HX/01a5qmmDOH/Q0qkh2nQiTB X-Received: by 2002:ac2:47e8:0:b0:4fb:78b1:1cd4 with SMTP id b8-20020ac247e8000000b004fb78b11cd4mr8584796lfp.49.1689671652848; Tue, 18 Jul 2023 02:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689671652; cv=none; d=google.com; s=arc-20160816; b=hDW35A3HI8Uv35R8sA6m+/zSZVKWTuvHWE2KteTEH6b6IQIiD/sR+zvMON6R8AcFxW 0LlnENZ2DNk/w8TP3PpO2wur12v0W9wc9ZhyvjoV0mU9MdyETz002Q5X8X1K5fXG6pw8 b3VfNN2F9WjwUOOz5yw2WC93SFQxbWmTv8ctp3G9lWPdM1tqLpowoXy1wJjlmUZgZBdd Jn6iRl8eC6U8si8dASAY2d0Uw2PL4FMYAw7dwd46PVy7Tv4U5XkMoeL2Xg9Tb51lVhkx P+JlPrQ7rfU/BbOnpQY5ur/JH4L/+Jejq9lgESQLUcSox+t34KB1HVEOYaITjhlfhzs9 d2hQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=IKQrnAAXrxm+V/7/n+4Qloa2USS24OYRqHFta7qvgAQ=; fh=d7Y2saiw29uND/SsOBJ2retNF3iguTe+P+E/YgZRf2U=; b=dcVRF83SEbopENkHzPiGdN1/EhQD9GRdpDMbFsqUhZfg6HPPC2kgAVsJjdPo6iM87G DuseGJ4FA6rASzAFBB5ymYuNB79yRHz90F7T7+y2ANCTBFPwqbuwCozM/wjRBCBfxfUt 8THt5HMBnzG7h5Vdq2LCUdJ/ruYj8gPt4vBtmxxrJHbo4amqr2EKAJ8PHqxb3rSP9ykf huPaX4ozEihI5D739uqs3RDsMAI9W7Vz2iKaymAAmsI/ZATQLIlx0Ck+R/nr5bUbG9Yh b9ci3pHgHEZs19h/bo/uTa3zyH5Nsa11O1l26J0yUfi+AzoxcbCioDdV/Cnq9FtxqEUK 77Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=AeVsisMe; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d15-20020a05640208cf00b0051dd49a94c2si865666edz.583.2023.07.18.02.13.49; Tue, 18 Jul 2023 02:14:12 -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=@gmail.com header.s=20221208 header.b=AeVsisMe; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232031AbjGRIsP (ORCPT <rfc822;chrisben.tianve@gmail.com> + 99 others); Tue, 18 Jul 2023 04:48:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230397AbjGRIsO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Jul 2023 04:48:14 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EBDBF7 for <linux-kernel@vger.kernel.org>; Tue, 18 Jul 2023 01:48:12 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fdb3f66fd6so4598251e87.3 for <linux-kernel@vger.kernel.org>; Tue, 18 Jul 2023 01:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689670090; x=1692262090; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IKQrnAAXrxm+V/7/n+4Qloa2USS24OYRqHFta7qvgAQ=; b=AeVsisMeDdKDMuBy4M5Ao2mQiTv19RMdqCBe8cETcF3jf7dsgpNOWeHswgA5cAJXuA n0lCzW9TLN7VFYDPpK0/ghORSyAZpNKOMAaPri84J9v6cpns3G0n+W2MToiOZc7lQR+G AqlqA8fx3uZJShWIFkzAYUhM7qISpYN2mfqjgpBm6NyxUKfai5rpGcip/aX7BAUm6bdf 1Y1HeLl6CJyRJvoOBLI5RdZ6zgv3TuOFyZghIMH4atj3W7ZgH63MnoByoApnTrFSqcJT zhe/DXazrYsDJxRSr19dFQFpwRW0ANPsRulC3HIjfYjdTaW0tnK5dPfJ1wC4Wn3kVYyD 0prA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689670090; x=1692262090; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IKQrnAAXrxm+V/7/n+4Qloa2USS24OYRqHFta7qvgAQ=; b=A3RvBTJ02ePsAuOXlWfhIedNQMK1+riDozNEiz+z9twUSzykLHA7fcMQGh9rJ7yDs7 5II56I4oH+LfKm9jT3wJxXhLYBXrsphuY3+fESA5nGPpt/6nybt4jYtEiS05/n/+6UGT ge/AAnubMBT1Al1EiNR/rjAvNRLCovaZt341yUK6h96dXE51DVAS3acgAhqUYKky32Ld 9Fo3j6hD42K9GRRdBJP/k6XLqPmoUCMVA21Lw8U/191TR26JJVavXrj/ZoXB2n0SrMxH tTh11VBs1H8eCzODVcJa7//fJukTc0pJo4JvpFz0NBC3r8Qa+o2BDOI+7DWs9usTbsje RXNw== X-Gm-Message-State: ABy/qLb/3xP3ZRlIHcTrV/K+dIskLLsHEg2q2Q2kRd3/TYG4zYWx8Y+f IoWOL0hs5DisUMnyw2sg5WY= X-Received: by 2002:a05:6512:3b0a:b0:4fb:9595:15e9 with SMTP id f10-20020a0565123b0a00b004fb959515e9mr11844227lfv.22.1689670090272; Tue, 18 Jul 2023 01:48:10 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id m15-20020a056512014f00b004fb85ffc82csm340944lfo.10.2023.07.18.01.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 01:48:09 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= <zajec5@gmail.com> To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: Miquel Raynal <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>, Bartosz Golaszewski <bgolaszewski@baylibre.com>, Alban Bedel <albeu@free.fr>, Christian Marangi <ansuelsmth@gmail.com>, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= <rafal@milecki.pl> Subject: [PATCH] Revert "nvmem: add new config option" Date: Tue, 18 Jul 2023 10:48:04 +0200 Message-Id: <20230718084804.20139-1-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771749142865653669 X-GMAIL-MSGID: 1771749142865653669 |
Series |
Revert "nvmem: add new config option"
|
|
Commit Message
Rafał Miłecki
July 18, 2023, 8:48 a.m. UTC
From: Rafał Miłecki <rafal@milecki.pl> This reverts commit 517f14d9cf3533d5ab4fded195ab6f80a92e378f. It seems that "no_of_node" config option was added to help mtd's case. DT nodes of MTD partitions (that are also NVMEM devices) may contain subnodes that SHOULD NOT be treated as NVMEM fixed cells. To prevent NVMEM core code from parsing them "no_of_node" was set to true and that made for_each_child_of_node() in NVMEM a no-op. With the introduction of "add_legacy_fixed_of_cells" config option things got more explicit. MTD subsystem simply tells NVMEM when to look for fixed cells and there is no need to hack "of_node" pointer anymore. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> --- Important: this is based on top of the [PATCH V4] nvmem: add explicit config option to read old syntax fixed OF cells --- drivers/mtd/mtdcore.c | 1 - drivers/nvmem/core.c | 2 +- include/linux/nvmem-provider.h | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-)
Comments
Hi Rafał, zajec5@gmail.com wrote on Tue, 18 Jul 2023 10:48:04 +0200: > From: Rafał Miłecki <rafal@milecki.pl> > > This reverts commit 517f14d9cf3533d5ab4fded195ab6f80a92e378f. > > It seems that "no_of_node" config option was added to help mtd's case. > > DT nodes of MTD partitions (that are also NVMEM devices) may contain > subnodes that SHOULD NOT be treated as NVMEM fixed cells. To prevent > NVMEM core code from parsing them "no_of_node" was set to true and that > made for_each_child_of_node() in NVMEM a no-op. > > With the introduction of "add_legacy_fixed_of_cells" config option > things got more explicit. MTD subsystem simply tells NVMEM when to look > for fixed cells and there is no need to hack "of_node" pointer anymore. > > Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Thanks, Miquèl
Hi Rafał,
kernel test robot noticed the following build warnings:
[auto build test WARNING on mtd/mtd/next]
[also build test WARNING on mtd/mtd/fixes linus/master v6.5-rc2 next-20230718]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Rafa-Mi-ecki/Revert-nvmem-add-new-config-option/20230718-170441
base: https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next
patch link: https://lore.kernel.org/r/20230718084804.20139-1-zajec5%40gmail.com
patch subject: [PATCH] Revert "nvmem: add new config option"
config: i386-randconfig-i002-20230718 (https://download.01.org/0day-ci/archive/20230718/202307182316.AVNL1wNs-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230718/202307182316.AVNL1wNs-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307182316.AVNL1wNs-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/mtd/mtdcore.c: In function 'mtd_nvmem_add':
>> drivers/mtd/mtdcore.c:542:29: warning: unused variable 'node' [-Wunused-variable]
542 | struct device_node *node = mtd_get_of_node(mtd);
| ^~~~
vim +/node +542 drivers/mtd/mtdcore.c
c4dfa25ab307a2 Alban Bedel 2018-11-13 539
c4dfa25ab307a2 Alban Bedel 2018-11-13 540 static int mtd_nvmem_add(struct mtd_info *mtd)
c4dfa25ab307a2 Alban Bedel 2018-11-13 541 {
658c4448bbbf02 Christian Marangi 2021-03-12 @542 struct device_node *node = mtd_get_of_node(mtd);
c4dfa25ab307a2 Alban Bedel 2018-11-13 543 struct nvmem_config config = {};
c4dfa25ab307a2 Alban Bedel 2018-11-13 544
75f32f4b9d5263 Miquel Raynal 2023-03-07 545 config.id = NVMEM_DEVID_NONE;
c4dfa25ab307a2 Alban Bedel 2018-11-13 546 config.dev = &mtd->dev;
7b01b7239d0dc9 Ricardo Ribalda 2020-04-30 547 config.name = dev_name(&mtd->dev);
c4dfa25ab307a2 Alban Bedel 2018-11-13 548 config.owner = THIS_MODULE;
c4dfa25ab307a2 Alban Bedel 2018-11-13 549 config.reg_read = mtd_nvmem_reg_read;
c4dfa25ab307a2 Alban Bedel 2018-11-13 550 config.size = mtd->size;
c4dfa25ab307a2 Alban Bedel 2018-11-13 551 config.word_size = 1;
c4dfa25ab307a2 Alban Bedel 2018-11-13 552 config.stride = 1;
c4dfa25ab307a2 Alban Bedel 2018-11-13 553 config.read_only = true;
c4dfa25ab307a2 Alban Bedel 2018-11-13 554 config.root_only = true;
6c7621890995d0 Christophe Kerello 2022-02-20 555 config.ignore_wp = true;
c4dfa25ab307a2 Alban Bedel 2018-11-13 556 config.priv = mtd;
c4dfa25ab307a2 Alban Bedel 2018-11-13 557
c4dfa25ab307a2 Alban Bedel 2018-11-13 558 mtd->nvmem = nvmem_register(&config);
c4dfa25ab307a2 Alban Bedel 2018-11-13 559 if (IS_ERR(mtd->nvmem)) {
c4dfa25ab307a2 Alban Bedel 2018-11-13 560 /* Just ignore if there is no NVMEM support in the kernel */
5cab06156aade1 Miquel Raynal 2023-03-07 561 if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP)
c4dfa25ab307a2 Alban Bedel 2018-11-13 562 mtd->nvmem = NULL;
5cab06156aade1 Miquel Raynal 2023-03-07 563 else
5cab06156aade1 Miquel Raynal 2023-03-07 564 return dev_err_probe(&mtd->dev, PTR_ERR(mtd->nvmem),
5cab06156aade1 Miquel Raynal 2023-03-07 565 "Failed to register NVMEM device\n");
c4dfa25ab307a2 Alban Bedel 2018-11-13 566 }
c4dfa25ab307a2 Alban Bedel 2018-11-13 567
c4dfa25ab307a2 Alban Bedel 2018-11-13 568 return 0;
c4dfa25ab307a2 Alban Bedel 2018-11-13 569 }
c4dfa25ab307a2 Alban Bedel 2018-11-13 570
On 2023-07-18 18:00, kernel test robot wrote: > drivers/mtd/mtdcore.c: In function 'mtd_nvmem_add': >>> drivers/mtd/mtdcore.c:542:29: warning: unused variable 'node' >>> [-Wunused-variable] > 542 | struct device_node *node = mtd_get_of_node(mtd); > | ^~~~ My patch I mentioned: [PATCH V4] nvmem: add explicit config option to read old syntax fixed OF cells adds following line: config.add_legacy_fixed_of_cells = of_device_is_compatible(node, "nvmem-cells"); So this is a false kernel bot warning (but I understand kernel bot couldn't understand it needs my other patch).
Srini, On 26.08.2023 22:15, Rafał Miłecki wrote: > On 18.07.2023 10:48, Rafał Miłecki wrote: >> From: Rafał Miłecki <rafal@milecki.pl> >> >> This reverts commit 517f14d9cf3533d5ab4fded195ab6f80a92e378f. >> >> It seems that "no_of_node" config option was added to help mtd's case. >> >> DT nodes of MTD partitions (that are also NVMEM devices) may contain >> subnodes that SHOULD NOT be treated as NVMEM fixed cells. To prevent >> NVMEM core code from parsing them "no_of_node" was set to true and that >> made for_each_child_of_node() in NVMEM a no-op. >> >> With the introduction of "add_legacy_fixed_of_cells" config option >> things got more explicit. MTD subsystem simply tells NVMEM when to look >> for fixed cells and there is no need to hack "of_node" pointer anymore. >> >> Signed-off-by: Rafał Miłecki <rafal@milecki.pl> >> --- >> Important: this is based on top of the >> [PATCH V4] nvmem: add explicit config option to read old syntax fixed OF cells > > I see you skipped those two patches for 6.6. > > Can you queue them for 6.7, please? Did you have a chance to look at this one? >> --- >> drivers/mtd/mtdcore.c | 1 - >> drivers/nvmem/core.c | 2 +- >> include/linux/nvmem-provider.h | 2 -- >> 3 files changed, 1 insertion(+), 4 deletions(-) >> >> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c >> index 9db8d7853639..3d781ffb8c32 100644 >> --- a/drivers/mtd/mtdcore.c >> +++ b/drivers/mtd/mtdcore.c >> @@ -554,7 +554,6 @@ static int mtd_nvmem_add(struct mtd_info *mtd) >> config.read_only = true; >> config.root_only = true; >> config.ignore_wp = true; >> - config.no_of_node = !of_device_is_compatible(node, "nvmem-cells"); >> config.priv = mtd; >> mtd->nvmem = nvmem_register(&config); >> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c >> index 58d8919e6682..a0c9153cda28 100644 >> --- a/drivers/nvmem/core.c >> +++ b/drivers/nvmem/core.c >> @@ -1027,7 +1027,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) >> nvmem->nkeepout = config->nkeepout; >> if (config->of_node) >> nvmem->dev.of_node = config->of_node; >> - else if (!config->no_of_node) >> + else >> nvmem->dev.of_node = config->dev->of_node; >> switch (config->id) { >> diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h >> index 1b81adebdb8b..e3930835235b 100644 >> --- a/include/linux/nvmem-provider.h >> +++ b/include/linux/nvmem-provider.h >> @@ -89,7 +89,6 @@ struct nvmem_cell_info { >> * @read_only: Device is read-only. >> * @root_only: Device is accessibly to root only. >> * @of_node: If given, this will be used instead of the parent's of_node. >> - * @no_of_node: Device should not use the parent's of_node even if it's !NULL. >> * @reg_read: Callback to read data. >> * @reg_write: Callback to write data. >> * @size: Device size. >> @@ -122,7 +121,6 @@ struct nvmem_config { >> bool ignore_wp; >> struct nvmem_layout *layout; >> struct device_node *of_node; >> - bool no_of_node; >> nvmem_reg_read_t reg_read; >> nvmem_reg_write_t reg_write; >> int size; >
On Tue, 18 Jul 2023 10:48:04 +0200, Rafał Miłecki wrote: > This reverts commit 517f14d9cf3533d5ab4fded195ab6f80a92e378f. > > It seems that "no_of_node" config option was added to help mtd's case. > > DT nodes of MTD partitions (that are also NVMEM devices) may contain > subnodes that SHOULD NOT be treated as NVMEM fixed cells. To prevent > NVMEM core code from parsing them "no_of_node" was set to true and that > made for_each_child_of_node() in NVMEM a no-op. > > [...] Applied, thanks! [1/1] Revert "nvmem: add new config option" commit: bb519262f1a9b4c37046be5a3851ab1681d7158a Best regards,
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 9db8d7853639..3d781ffb8c32 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -554,7 +554,6 @@ static int mtd_nvmem_add(struct mtd_info *mtd) config.read_only = true; config.root_only = true; config.ignore_wp = true; - config.no_of_node = !of_device_is_compatible(node, "nvmem-cells"); config.priv = mtd; mtd->nvmem = nvmem_register(&config); diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 58d8919e6682..a0c9153cda28 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1027,7 +1027,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) nvmem->nkeepout = config->nkeepout; if (config->of_node) nvmem->dev.of_node = config->of_node; - else if (!config->no_of_node) + else nvmem->dev.of_node = config->dev->of_node; switch (config->id) { diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 1b81adebdb8b..e3930835235b 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -89,7 +89,6 @@ struct nvmem_cell_info { * @read_only: Device is read-only. * @root_only: Device is accessibly to root only. * @of_node: If given, this will be used instead of the parent's of_node. - * @no_of_node: Device should not use the parent's of_node even if it's !NULL. * @reg_read: Callback to read data. * @reg_write: Callback to write data. * @size: Device size. @@ -122,7 +121,6 @@ struct nvmem_config { bool ignore_wp; struct nvmem_layout *layout; struct device_node *of_node; - bool no_of_node; nvmem_reg_read_t reg_read; nvmem_reg_write_t reg_write; int size;