mdiobus_write_nested(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ mdiobus_write_nested(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸ’– and today's main character is mdiobus_write_nested β€” literally the nested version of the mdiobus_write function, no cap 🫢


🌸 NAME 🌸

mdiobus_write_nested β€” it's giving "nested version of the mdiobus_write function" ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

int mdiobus_write_nested (struct mii_bus *bus , int addr , u32 regnum ,
       u16 val );

like, that's the whole signature, slay πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • bus β€” the mii_bus struct, your bus babe, the whole vibe 🌈
  • addr β€” the phy address, iykyk πŸ‘‘
  • regnum β€” register number to write, like the exact drawer you're putting stuff in πŸ“
  • val β€” value to write to regnum, the actual thing going in πŸ”₯

⭐ RETURN ⭐

Zero if successful 😌 negative error code on failure 😭

like, zero = ate, negative = it's giving disaster fr fr πŸ’€


πŸ’œ DESCRIPTION πŸ’œ

In case of nested MDIO bus access, avoid lockdep false positives by using mutex_lock_nested. ✨

lowkey iconic that this is the entire reason this function exists β€” it's just out here protecting you from fake lockdep drama 🧚 no cap πŸ’…


🩷 NOTE 🩷

MUST NOT be called from interrupt context, because the bus read/write functions may wait for an interrupt to conclude the operation. 🚨

like seriously bestie, do NOT do this from interrupt context β€” highkey it will not end well for you πŸ™ˆπŸ’€


🌈 SEE ALSO 🌈

Kernel file ./drivers/net/phy/mdio_bus.c plus the whole squad, and yes I'm listing every single one because we don't skip anyone in this house 🫢:


and that's the page!! πŸŽ€ sign-off time: this little baddie lives in ./drivers/net/phy, the version stamp says October 2026, and the manual name is mdiobus_write_nested(9) β€” go forth and write your registers responsibly bestie, mwah πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from