mdiobus_read_nested(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– mdiobus_read_nested(9) πŸ’–

okay bestie, so this is mdiobus_read_nested from the Kernel API Manual β€” it's the nested-flavoured twin of mdiobus_read, and yes it's exactly as niche and exactly as iconic as it sounds πŸŽ€


✨ NAME ✨

mdiobus_read_nested β€” literally the Nested version of the mdiobus_read function, no cap πŸ’…


🌸 SYNOPSIS 🌸

int mdiobus_read_nested (struct mii_bus *bus , int addr , u32 regnum );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • bus β€” the mii_bus struct 🚌
  • addr β€” the phy address πŸ“
  • regnum β€” register number to read πŸ“–

⭐ RETURN ⭐

It gives you the register value if it worked, and a negative error code if it didn't 😭 β€” that's the whole vibe check.


πŸ’œ DESCRIPTION πŸ’œ

So like, in case of nested MDIO bus access, you avoid lockdep false positives by using mutex_lock_nested. that's it, that's the tea 🍡 the way this function exists purely to keep lockdep from panicking over nothing?? obsessed 🫢


πŸ‘‘ NOTE πŸ‘‘

🚨 MUST NOT be called from interrupt context, because the bus read/write functions may wait for an interrupt to conclude the operation. like fr fr, do NOT do it, it will not slay πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./drivers/net/phy/mdio_bus.c β€” and the whole friend group:


and that's the whole page, bestie!! sourced straight from ./drivers/net/phy, dated October 2026 β€” mwah, go read some registers responsibly πŸ’‹βœ¨πŸ’–

πŸ“¦ where this page comes from