phy_modify_changed(9)
π 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β thephy_devicestruct. 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 inmaskto write toregnum. 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:
phy_speed_to_str(9)phy_duplex_to_str(9)phy_rate_matching_to_str(9)phy_fix_phy_mode_for_mac_delays(9)phy_interface_num_ports(9)phy_set_max_speed(9)of_set_phy_timing_role(9)phy_resolve_aneg_pause(9)phy_resolve_aneg_linkmode(9)phy_check_downshift(9)__phy_read_mmd(9)phy_read_mmd(9)__phy_write_mmd(9)phy_write_mmd(9)__phy_modify(9)phy_modify(9)__phy_modify_mmd_changed(9)phy_modify_mmd_changed(9)__phy_modify_mmd(9)phy_modify_mmd(9)phy_save_page(9)phy_select_page(9)phy_restore_page(9)phy_read_paged(9)phy_write_paged(9)phy_modify_paged_changed(9)phy_modify_paged(9)
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
- 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