pm_clk_op_lock(9)
π pm_clk_op_lock β Kernel API Manual era β¨
ok so bestie, welcome to pm_clk_op_lock(9) β the little function that makes sure nobody's stepping on anybody's toes while we're doing clock operations. it's giving "bouncer at the club" energy ngl π
β¨ NAME β¨
pm_clk_op_lock β bestie's whole job is ensure exclusive access for performing clock operations. that's it. that's the vibe. π
π¦ SYNOPSIS π¦
int pm_clk_op_lock (struct pm_subsys_data *psd , unsigned long *flags ,
const char *fn );
look at her go π three whole arguments, she's so lowkey iconic
πΈ ARGUMENTS πΈ
psdβ thepm_subsys_datainstance that corresponds to the PM clock entry list and theclk_op_might_sleepcount being used. she's literally the main character here πflagsβ stored irq flags. that's the whole thing, they're just chillin' in there π«Άfnβ a string for the caller function's name. so like, who's calling. name and shame but make it cute β¨
π DESCRIPTION π
okay so here's the tea β β this function is used by pm_clk_suspend and pm_clk_resume to guard against concurrent modifications to the clock entry list and the clock_op_might_sleep count. no cap, no racing, no chaos π
and it's got two whole modes, depending on the count:
- if
clock_op_might_sleepis != 0 then only the mutex can be locked, and those functions can only be used in non atomic context. so watch out bestie, context matters π - if
clock_op_might_sleep== 0 then those functions may be used in any context, and only the spinlock can be locked. slay, free real estate β¨
π¨ and she Returns -EINVAL if called in atomic context when clock ops might sleep. literally not me finding out the hard way π
π₯ SEE ALSO π₯
kernel file ./drivers/base/power/clock_ops.c and honestly the whole friend group π
pm_clk_list_lock(9)pm_clk_list_unlock(9)pm_clk_op_unlock(9)__pm_clk_enable(9)pm_clk_acquire(9)pm_clk_add(9)pm_clk_add_clk(9)of_pm_clk_add_clks(9)__pm_clk_remove(9)pm_clk_remove_clk(9)pm_clk_init(9)pm_clk_create(9)pm_clk_destroy(9)pm_clk_suspend(9)pm_clk_resume(9)pm_clk_notify(9)enable_clock(9)disable_clock(9)pm_clk_notify(9)pm_clk_add_notifier(9)
(and yes pm_clk_notify(9) is in there twice β she's just that iconic, we don't question the source π
)
that's the whole page bestie, iykyk π§ββοΈ
signing off from ./drivers/base/power, dated October 2026 β stay locked, stay safe, and may your context never be atomic at the wrong moment πβ¨π
π¦ 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