Message ID | 20240123014517.5787-5-mcpratt@pm.me |
---|---|
State | New |
Headers | show |
Series | fw_devlink: generically handle bad links to child fwnodes | expand |
Hi Michael, mcpratt@pm.me wrote on Tue, 23 Jan 2024 01:47:21 +0000: > This reverts commit fb42378dcc7f247df56f0ecddfdae85487495fbc > ("mtd: mtdpart: Don't create platform device that'll never probe"). > > That commit is a manual named exception in order to avoid fw_devlink links > to an "nvmem-cells" compatible node which is a descendant of the fwnode > that represents the real supplier device that probes. > > The commit does not work for newer cases, like the "fixed-layout" Do you have plans for it? Because it is the modern description that is now expected, so I don't feel convinced by all this work (which is nevertheless considerable) if fixed-layouts are still broken? > compatible nodes, but instead of adding another compatible string, > remove this workaround as it is no longer needed after > the previous few commits which handle the situation in a generic way > for all supplier nodes that are a child or further descendant fwnode > of a parent device that can probe, including when the consumer device > has a probe attempt before the supplier device, by using an existing > incorrect fwnode or device link to recreate the correct one. > > Signed-off-by: Michael Pratt <mcpratt@pm.me> Thanks, Miquèl
Hi Miquel, Sorry for the wait in replying. On Monday, February 5th, 2024 at 10:11, Miquel Raynal <miquel.raynal@bootlin.com> wrote: > > Hi Michael, > > mcpratt@pm.me wrote on Tue, 23 Jan 2024 01:47:21 +0000: > > > This reverts commit fb42378dcc7f247df56f0ecddfdae85487495fbc > > ("mtd: mtdpart: Don't create platform device that'll never probe"). > > > > That commit is a manual named exception in order to avoid fw_devlink links > > to an "nvmem-cells" compatible node which is a descendant of the fwnode > > that represents the real supplier device that probes. > > > > The commit does not work for newer cases, like the "fixed-layout" > > > Do you have plans for it? Because it is the modern description that is > now expected, so I don't feel convinced by all this work (which is > nevertheless considerable) if fixed-layouts are still broken? > Sorry for the misunderstanding, I was referring to the already existing commit cited in the message when saying "The commit does not work for newer cases..." which is why reverting it in this patch is part of the series. I'll reword it. > > > Thanks, > Miquèl
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 6811a714349d..dd2b27674f56 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -582,7 +582,6 @@ 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; @@ -600,15 +599,6 @@ 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)
This reverts commit fb42378dcc7f247df56f0ecddfdae85487495fbc ("mtd: mtdpart: Don't create platform device that'll never probe"). That commit is a manual named exception in order to avoid fw_devlink links to an "nvmem-cells" compatible node which is a descendant of the fwnode that represents the real supplier device that probes. The commit does not work for newer cases, like the "fixed-layout" compatible nodes, but instead of adding another compatible string, remove this workaround as it is no longer needed after the previous few commits which handle the situation in a generic way for all supplier nodes that are a child or further descendant fwnode of a parent device that can probe, including when the consumer device has a probe attempt before the supplier device, by using an existing incorrect fwnode or device link to recreate the correct one. Signed-off-by: Michael Pratt <mcpratt@pm.me> --- drivers/mtd/mtdpart.c | 10 ---------- 1 file changed, 10 deletions(-)