mdiobus_c45_read_nested(9)
π mdiobus_c45_read_nested β like, the NESTED version of mdiobus_c45_read β¨
okay bestie, so this is straight out of the Kernel API Manual and it's genuinely so much less scary than the name makes it look π«Ά the name is mdiobus_c45_read_nested, and yes the (9) is part of the whole vibe, iykyk π
β¨ SYNOPSIS β¨
int mdiobus_c45_read_nested (struct mii_bus *bus , int addr , int devad
, u32 regnum );
likeβ¦ literally that's the whole signature, no cap π
π¦ ARGUMENTS π¦
busβ themii_busstruct, bestie. that's your bus babe πΈaddrβ the phy address, the little address of your phy β¨devadβ device address to read π (yes, c45 things get a device address, iconic)regnumβ register number to read π
π RETURN π
so if everything slays, you get the register value back π and if it doesn't? you get a negative error code on failure π that's it, that's the contract, fr fr.
π₯ DESCRIPTION π₯
okay so the whole point of this one: when you've got nested MDIO bus access, you use mutex_lock_nested so you avoid lockdep false positives β¨ that's literally the description, no extra lore, that's the tea π
like lockdep was out here being dramatic and this function said "not today" π
π NOTE π
MUST NOT be called from interrupt context π¨ and this is a hard MUST, not a soft little suggestion bestie!! the reason: the bus read/write functions may wait for an interrupt to conclude the operation β so if you're already in interrupt context you'd be waiting on yourself, which is giving main character energy in the worst way ππ don't do it!!
π SEE ALSO π
all the siblings and cousins, in the kernel file ./drivers/net/phy/mdio_bus.c:
__mdiobus_read(9)__mdiobus_write(9)__mdiobus_modify_changed(9)__mdiobus_c45_read(9)__mdiobus_c45_write(9)__mdiobus_c45_modify_changed(9)mdiobus_read_nested(9)mdiobus_read(9)mdiobus_c45_read(9)mdiobus_write_nested(9)mdiobus_write(9)mdiobus_c45_write(9)mdiobus_c45_write_nested(9)mdiobus_modify(9)mdiobus_c45_modify(9)mdiobus_modify_changed(9)mdiobus_c45_modify_changed(9)
π okay that's the whole page bestie, go forth and read your c45 registers safely π
signing off from ./drivers/net/phy, dated October 2026, brought to you by the one and only mdiobus_c45_read_nested(9) πΈπ«Άβ¨
π¦ 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