rtl83xx_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” a realtek_priv pointer πŸ’– (yes it's void * 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_lock lock πŸ”

🌈 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 πŸ’œ

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