__scmi_event...dler_get_ops(9)
πΈ __scmi_event...dler_get_ops(9) πΈ
okay bestie, welcome to the Kernel API Manual β¨ (yes, the kernel has lore now, and you're gonna eat this up π
). This is the page for __scmi_event...dler_get_ops(9) β the little utility that goes and finds you an event handler, or literally makes one from scratch if you ask nicely π«Ά
π NAME π
__scmi_event_handler_get_ops β the utility that gets you an event handler or creates one, whichever the vibe check demands π₯
β¨ SYNOPSIS β¨
struct scmi_event_handler * __scmi_event_handler_get_ops (struct
scmi_notify_instance *ni , u32 evt_key , bool create );
π ARGUMENTS π
niβ a reference to the notification instance you're gonna use π«evt_keyβ the event key, like the handler's little name tag π·οΈcreateβ a boolean flag that says "bestie, if it doesn't exist yet, make it exist" π
π¦ DESCRIPTION π¦
So here's the plan: it searches for the handler you want (matching by key, obviously) in both places β the per-protocol registered table and the common pending table π
- if it's found, it adjusts the users refcount π
- if it's not found and
createistrue, it creates and registers the new handler β and heads up, that handler could end up registered as pending if no matching event could be found π«
Okay and this next part is important, so listen up π’ An handler is guaranteed to live in one and only one of the tables at any one time. To make that happen, the whole search-and-create situation is performed while holding the pending_mtx lock, with registered_mtx additionally acquired if needed ππ
And when a nested acquisition of these mutexes is needed, the locking order is always the same (same as in init_work), no cap:
pending_mtxregistered_mtx
π¨ Do NOT go flipping that order around. That's how you get deadlocks, and nobody wants that energy. π¨
Also, events generation is NOT enabled right after creation within this routine β because at creation time we usually want all the setup done and ready before the events really start flowing π Like, let her get dressed first, damn π
π RETURN π
A properly refcounted handler on Success, ERR_PTR on Failure π (yes, failure is possible, it's giving plot twist)
π SEE ALSO π
So many friends, so much scrolling, iykyk π
Kernel file ./drivers/firmware/arm_scmi/notify.c, Theory of operation(9), struct scmi_notify_instance(9), struct events_queue(9), struct scmi_event_header(9), struct scmi_registered_events_desc(9), struct scmi_registered_event(9), struct scmi_event_handler(9), scmi_lookup_and_call_event_chain(9), scmi_process_event_header(9), scmi_process_event_payload(9), scmi_events_dispatcher(9), scmi_notify(9), scmi_kfifo_free(9), scmi_initialize_events_queue(9), scmi_allocate_registered_events_desc(9), scmi_register_protocol_events(9), scmi_deregister_protocol_events(9), scmi_allocate_event_handler(9), scmi_free_event_handler(9), scmi_bind_event_handler(9), scmi_valid_pending_handler(9), scmi_register_event_handler(9), scmi_get_active_handler(9), __scmi_enable_evt(9), scmi_put_handler_unlocked(9), scmi_event_handler_enable_events(9), scmi_notifier_register(9), scmi_notifier_unregister(9), scmi_devm_notifier_register(9), scmi_devm_notifier_unregister(9), scmi_protocols_late_init(9), scmi_notification_init(9), scmi_notification_quiesce(9), scmi_notification_exit(9)
πΈ okay that's the whole thing, you're officially educated πΈ Sourced straight from ./drivers/firmware/arm_scmi, dated October 2026, and filed under __scmi_event...dler_get_ops(9). go forth and handle your events, queen ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms