phy_modify_changed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– phy_modify_changed(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so. this is phy_modify_changed, a function from the Linux Kernel API Manual. lowercase. affectionate. iconic. let's get into it ✨


🌸 NAME 🌸

phy_modify_changed β€” literally the function for modifying a PHY register. that's it, that's the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

int phy_modify_changed (struct phy_device *phydev , u32 regnum , u16
mask , u16 set );

bestie look at this signature. it returns an int. it takes four things. we're gonna go through them one by one, no skipping, i promise 🫢


πŸ’… ARGUMENTS πŸ’…

  • phydev β€” the phy_device struct. your main character. the device we're messing with πŸ’œ
  • regnum β€” register number to modify. which register are we touching, bestie? say it with your chest πŸ“
  • mask β€” bit mask of bits to clear. so these are the bits getting yeeted πŸ”₯
  • set β€” new value of bits set in mask to write to regnum. so these are the bits getting written in πŸŽ€

🚨 NOTE 🚨

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

read that again. MUST NOT. not "shouldn't", not "maybe don't", not "lowkey avoid it" β€” MUST NOT. if you call this from interrupt context you're gonna have a bad time, because the bus read/write functions may be out here waiting for an interrupt to conclude the operation, and you'll just be sitting there. deadlock energy. do not do it πŸ™ˆπŸ’€

and the returns? listen up:

  • negative errno β€” something went wrong 😭
  • 0 β€” there was no change. nothing moved. the register said "we're good" 🧚
  • 1 β€” in case of change!! something actually changed, slay πŸ‘‘

πŸ”Ž SEE ALSO πŸ”Ž

Kernel file ./drivers/net/phy/phy-core.c, plus the whole friend group β€” and when i say whole friend group i mean the WHOLE friend group, we are not leaving anyone out:

all twenty-seven of them. i counted. you're welcome πŸ’–


and that's the page!! this one's living in ./drivers/net/phy, dated October 2026, from the Kernel API Manual β€” so go forth, modify your PHY registers, and remember: not from interrupt context, bestie. never from interrupt context. periodt πŸ’…βœ¨πŸŒˆ

stay slay, stay in process context πŸŽ€

πŸ“¦ where this page comes from