rtl83xx_lock(9)
π rtl83xx_lock(9) β from the Kernel API Manual, bestie
okay so picture this: you're deep in the Realtek DSA driver, everything's vibing, and then two regmap operations try to happen at the same time. chaos. not the aesthetic. so we have rtl83xx_lock β the little function that says "one at a time, babes" π
β¨ NAME β¨
rtl83xx_lock β locks the mutex used by regmaps π
like it literally just grabs the mutex and holds it, that's the whole job, and honestly? iconic of it.
πΈ SYNOPSIS πΈ
void rtl83xx_lock (void *ctx );
π¦ ARGUMENTS π¦
ctxβ arealtek_privpointer π (yes it'svoid *in the signature, no I don't make the rules, it just gets cast back to the real thing inside)
π DESCRIPTION π
so here's the tea βοΈ: this function gets handed over to regmap and lives there as the lock function. that's its main character gig.
it also gets called externally β from outside β to block regmap before you go execute a bunch of operations that absolutely must happen in sequence. no skipping the line, no interleaving, no "oops I ran in the middle of your sequence" energy. π
and when you're doing that whole externally-locked sequence thing? those inner operations use realtek_priv.map_nolock instead. because likeβ¦ you already have the lock, bestie, we're not about to deadlock ourselves trying to grab it twice π iykyk.
π CONTEXT π
- can sleep π΄ (so no, this is not the function to call from atomic context, love that for you)
- holds the
priv->map_locklock π
π RETURN π
nothing. void. it returns vibes and that's it. no status code, no error, no little treat for you at the end π
β SEE ALSO β
all my friends, all my faves, the whole group chat π
rtl83xx_unlock(9)rtl83xx_setup_user_mdio(9)rtl83xx_probe(9)rtl83xx_register_switch(9)rtl83xx_unregister_switch(9)rtl83xx_shutdown(9)rtl83xx_remove(9)rtl83xx_port_bridge_join(9)rtl83xx_port_bridge_leave(9)rtl83xx_port_fast_age(9)rtl83xx_port_fdb_add(9)rtl83xx_port_fdb_del(9)rtl83xx_port_fdb_dump(9)rtl83xx_port_mdb_add(9)rtl83xx_port_mdb_del(9)rtl83xx_port_bridge_flags(9)rtl83xx_setup_port_flood_control(9)
and the kernel file itself lives at ./drivers/net/dsa/realtek/rtl83xx.c β go read it, it's giving source of truth β¨
real talk though: if you call this and then forget to call the unlock, you will simply sit there forever. no cap. that lock does not free itself. π
okay that's the page, mwah π this lil number is from the <lavender>./drivers/net/dsa/realtek</lavender> corner of the kernel, dated <rainbow>October 2026</rainbow>, and yes β it's rtl83xx_lock(9)` walking out the door in full main character energy πβ¨
π¦ 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