All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] Dynamic OF and use after free related fixes
@ 2022-04-07 13:30 Nuno Sá
  2022-04-07 13:30 ` [RFC PATCH 1/4] clk: clk-conf: properly release of nodes Nuno Sá
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Nuno Sá @ 2022-04-07 13:30 UTC (permalink / raw)
  To: linux-clk; +Cc: Michael Turquette, Stephen Boyd

This series is a collection of fixes with things I encountered when
handling a system with device tree overlays "fun". This effectively means
removing and adding devices which led to me the found issues.

patch 1 is fairly straight and indeed an issue related with of_nodes not
being put.

For patches 2 and 3, they are only triggered if someone first removes the
provider which is a dumb thing to do. However, I guess we should be
prepared for that and the framework even has some efforts to deal with
these cases (eg: clk_nodrv_ops). That said, patch 2 is more or less
straight (even though catching the guilty line wasn't), we add something
to a list during resgister, we need to remove it on the unregister path.
Patch 3 is a different beast... though I think krefs are the proper solution
here, I'm not sure I covered all the corner cases with all the reparenting
that might happen (mainly reason why this is RFC). Nullyfing
clk_core->parent during unregister might suffice but I'm more in favor of
proper refcounting (for now at least). Patch 3 also does not have a fixes
tag because I genuily don't know when this became a problem. Maybe right
from the beginning?

Patch 4 is just a minor improvement and not really a fix...

Nuno Sá (4):
  clk: clk-conf: properly release of nodes
  clk: fix clk not being unlinked from consumers list
  clk: refcount the active parent clk_core
  clk: use clk_core_unlink_consumer() helper

 drivers/clk/clk-conf.c | 18 +++++++--
 drivers/clk/clk.c      | 83 +++++++++++++++++++++++++++---------------
 2 files changed, 67 insertions(+), 34 deletions(-)

-- 
2.35.1


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

end of thread, other threads:[~2022-04-22  7:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 13:30 [RFC PATCH 0/4] Dynamic OF and use after free related fixes Nuno Sá
2022-04-07 13:30 ` [RFC PATCH 1/4] clk: clk-conf: properly release of nodes Nuno Sá
2022-04-21 19:58   ` Stephen Boyd
2022-04-22  7:18     ` Sa, Nuno
2022-04-22  7:20     ` Sa, Nuno
2022-04-07 13:30 ` [RFC PATCH 2/4] clk: fix clk not being unlinked from consumers list Nuno Sá
2022-04-22  0:20   ` Stephen Boyd
2022-04-22  7:40     ` Sa, Nuno
2022-04-07 13:30 ` [RFC PATCH 3/4] clk: refcount the active parent clk_core Nuno Sá
2022-04-07 13:30 ` [RFC PATCH 4/4] clk: use clk_core_unlink_consumer() helper Nuno Sá

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.