Re: [PATCH v2 2/2] of: dynamic: flush devlinks workqueue before destroying the changeset

Andy Shevchenko
2024-02-05T12:36:26Z

On Mon, Feb 05, 2024 at 01:09:33PM +0100, Nuno Sa via B4 Relay wrote:
> From: Nuno Sa <nuno.sa@analog.com>
>
> Device links will drop their supplier + consumer refcounts
> asynchronously. That means that the refcount of the of_node attached to
> these devices will also be dropped asynchronously and so we cannot
> guarantee the DT overlay assumption that the of_node refcount must be 1 in
> __of_changeset_entry_destroy().
>
> Given the above, call the new fwnode_links_flush_queue() helper to flush
> the devlink workqueue so we can be sure that all links are dropped before
> doing the proper checks.

Have you seen my comments against v1?

> +++ b/drivers/of/dynamic.c
> @@ -14,6 +14,7 @@
> #include <linux/slab.h>
> #include <linux/string.h>
> #include <linux/proc_fs.h>
> +#include <linux/fwnode.h>

Try to squeeze this to make it ordered (with given context it may go before
linux/s* ones, but maybe you may find a better spot).

...

> + /*
> + * device links drop their device references (and hence their of_node

Device links...

> + * references) asynchronously on a dedicated workqueue. Hence we need
> + * to flush it to make sure everything is done before doing the below
> + * checks.
> + */

--
With Best Regards,
Andy Shevchenko