[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALHCpMgC55uTnZKPGdKmSX1f0++bSLp2odBp5gQ1kmg90JuQwQ@mail.gmail.com>
Date: Tue, 7 Feb 2023 10:51:41 +0300
From: Maxim Kiselev <bigunclemax@...il.com>
To: Saravana Kannan <saravanak@...gle.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Sudeep Holla <sudeep.holla@....com>,
Cristian Marussi <cristian.marussi@....com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Thomas Gleixner <tglx@...utronix.de>,
Marc Zyngier <maz@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Magnus Damm <magnus.damm@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Daniel Scally <djrscally@...il.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Len Brown <lenb@...nel.org>,
Rafał Miłecki <rafal@...ecki.pl>,
Abel Vesa <abel.vesa@...aro.org>,
Alexander Stein <alexander.stein@...tq-group.com>,
Tony Lindgren <tony@...mide.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
John Stultz <jstultz@...gle.com>,
Doug Anderson <dianders@...omium.org>,
Guenter Roeck <linux@...ck-us.net>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Maxim Kochetkov <fido_max@...ox.ru>,
Luca Weiss <luca.weiss@...rphone.com>,
Colin Foster <colin.foster@...advantage.com>,
Martin Kepplinger <martin.kepplinger@...i.sm>,
Jean-Philippe Brucker <jpb@...nel.org>,
Vladimir Oltean <vladimir.oltean@....com>,
kernel-team@...roid.com, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-gpio@...r.kernel.org,
linux-mtd@...ts.infradead.org, devicetree@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-acpi@...r.kernel.org
Subject: Re: [PATCH v3 12/12] mtd: mtdpart: Don't create platform device
that'll never probe
вт, 7 февр. 2023 г. в 04:42, Saravana Kannan <saravanak@...gle.com>:
>
> These "nvmem-cells" platform devices never get probed because there's no
> platform driver for it and it's never used anywhere else. So it's a
> waste of memory. These devices also cause fw_devlink to block nvmem
> consumers of "nvmem-cells" partition from probing because the supplier
> device never probes.
>
> So stop creating platform devices for nvmem-cells partitions to avoid
> wasting memory and to avoid blocking probing of consumers.
>
> Reported-by: Maxim Kiselev <bigunclemax@...il.com>
> Fixes: bcdf0315a61a ("mtd: call of_platform_populate() for MTD partitions")
> Signed-off-by: Saravana Kannan <saravanak@...gle.com>
> ---
> drivers/mtd/mtdpart.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
> index d442fa94c872..85f5ee6f06fc 100644
> --- a/drivers/mtd/mtdpart.c
> +++ b/drivers/mtd/mtdpart.c
> @@ -577,6 +577,7 @@ static int mtd_part_of_parse(struct mtd_info *master,
> {
> struct mtd_part_parser *parser;
> struct device_node *np;
> + struct device_node *child;
> struct property *prop;
> struct device *dev;
> const char *compat;
> @@ -594,6 +595,15 @@ static int mtd_part_of_parse(struct mtd_info *master,
> else
> np = of_get_child_by_name(np, "partitions");
>
> + /*
> + * Don't create devices that are added to a bus but will never get
> + * probed. That'll cause fw_devlink to block probing of consumers of
> + * this partition until the partition device is probed.
> + */
> + for_each_child_of_node(np, child)
> + if (of_device_is_compatible(child, "nvmem-cells"))
> + of_node_set_flag(child, OF_POPULATED);
> +
> of_property_for_each_string(np, "compatible", prop, compat) {
> parser = mtd_part_get_compatible_parser(compat);
> if (!parser)
> --
> 2.39.1.519.gcb327c4b5f-goog
>
Hi, Saravana!
Now it works pretty well. Thank you so much for your efforts.
> Reported-by: Maxim Kiselev <bigunclemax@...il.com>
> Fixes: bcdf0315a61a ("mtd: call of_platform_populate() for MTD partitions")
> Signed-off-by: Saravana Kannan <saravanak@...gle.com>
Tested-by: Maksim Kiselev <bigunclemax@...il.com>
Powered by blists - more mailing lists