devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] fix DT overlays when device links are released
@ 2024-02-02 12:18 Nuno Sa via B4 Relay
  2024-02-02 12:18 ` [PATCH 1/2] driver: core: add dedicated workqueue for devlink removal Nuno Sa via B4 Relay
  2024-02-02 12:18 ` [PATCH 2/2] of: dynamic: flush devlinks workqueue before destroying the changeset Nuno Sa via B4 Relay
  0 siblings, 2 replies; 6+ messages in thread
From: Nuno Sa via B4 Relay @ 2024-02-02 12:18 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Frank Rowand, Rob Herring,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Len Brown
  Cc: linux-acpi, devicetree, linux-kernel

Link to RFC:
 * https://lore.kernel.org/lkml/20240123-fix-device-links-overlays-v1-1-9e4f6acaab6c@analog.com/

Changes since RFC:
 * Use a dedicated workqueue to remove devlinks;
 * Flush the devlink workqueue before checking the of_node refcount
   value.

The following series is the result of the discussion I had with Rafael.
To sum up the fundamental issue, device links drop their refcounts
asynchronously and that means that the of_node refcount associated with
the device will also be dropped asynchronously. Now, in
__of_changeset_entry_destroy(), the assumption is that the node refcount
must be 1 and that cannot be guaranteed given the above.

I'm pasting again the link of the first time I exposed the issue where
one can see the resulps (big splat) of failing DT assumption:

https://lore.kernel.org/linux-devicetree/20230511151047.1779841-1-nuno.sa@analog.com/

---
Nuno Sa (2):
      driver: core: add dedicated workqueue for devlink removal
      of: dynamic: flush devlinks workqueue before destroying the changeset

 drivers/base/core.c    | 33 +++++++++++++++++++++++++++++----
 drivers/of/dynamic.c   |  8 ++++++++
 include/linux/fwnode.h |  1 +
 3 files changed, 38 insertions(+), 4 deletions(-)
---
base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d
change-id: 20240123-fix-device-links-overlays-5422e033a09b
--

Thanks!
- Nuno Sá


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-05 13:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02 12:18 [PATCH 0/2] fix DT overlays when device links are released Nuno Sa via B4 Relay
2024-02-02 12:18 ` [PATCH 1/2] driver: core: add dedicated workqueue for devlink removal Nuno Sa via B4 Relay
2024-02-02 15:59   ` Rafael J. Wysocki
2024-02-05  8:29     ` Nuno Sá
2024-02-05 13:36       ` Rafael J. Wysocki
2024-02-02 12:18 ` [PATCH 2/2] of: dynamic: flush devlinks workqueue before destroying the changeset Nuno Sa via B4 Relay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).