On 17/11/2026 12:00, Philipp Stanner wrote:
On Tue, 2026-11-17 at 10:06 +0000, Tvrtko Ursulin wrote:
Simplify the code and theoretical runtime combinations by disallowing
initializing entities with un-initialized schedulers.
Signed-off-by: Tvrtko Ursulin <[email protected]>
Cc: Christian König <[email protected]>
Cc: Danilo Krummrich <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: Philipp Stanner <[email protected]>
---
I do not *think* any of the drivers relies on this inverted initialization
order but it needs more eyes for sure.
I increasingly think that the way to go forward is to demand from API
users that they use the API correctly and appreciate the distinct
lifetimes and especially initialization and teardown orders.
Enforcing initialisation order is what the patch is doing.
Sure the API can warn when it's misused, but we have certainly not put
enough emphasis on really motivating people to set up things right.
Most APIs I see in the kernel do not warn in foo_init() whether
foo_init() had been called already.
Exactly, so making entity initialisation fail when the provided list of
schedulers contains uninitialised elements is this strong motivation you
are looking for. New callers simply cannot pass driver bring-up with the
wrong init order.
What we actually need is more documentation
As opposed to adding restrictions where we can, or in tandem to adding
restrictions?
Tvrtko