phy_restore_page(9)
π phy_restore_page β the kernel API glow-up π¦
okay so this is from the Kernel API Manual bestie, and it's literally the cleanup function you call after you've been messing with PHY pages. it puts the page register back and drops the bus lock. very "leave it how you found it" of her π
β¨ NAME β¨
phy_restore_page β restore the page register and release the bus lock π
πΈ SYNOPSIS πΈ
int phy_restore_page (struct phy_device *phydev , int oldpage , int ret );
π¦ ARGUMENTS π¦
phydevβ a pointer to astruct phy_deviceπ like, the device in question.oldpageβ the old page π― this is the return value fromphy_save_pageorphy_select_page, so don't just make one up.retβ the operation's return code π whatever the thing you were doing handed back.
π DESCRIPTION π
so what she does is release the MDIO bus lock, restoring oldpage if it's a valid page β¨ and yes she does both, she's a multi-tasker.
also important: this function propagates the earliest error code from the group of operations. so if something went wrong first, that's the error you're getting back. no cap π
π RETURN π
okay so the return value is a little priority list, pay attention bestie π:
oldpageβ if it was a negative value π- otherwise
retβ if it was a negativeerrnovalue - otherwise
phy_write_page's negative value β if it were in error - otherwise
retπ«Ά
so like, first negative thing wins. that's the whole vibe check.
β SEE ALSO β
kernel file ./drivers/net/phy/phy-core.c β and omg the friend group is huge, here's everyone π§:
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_changed(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_read_paged(9)phy_write_paged(9)phy_modify_paged_changed(9)phy_modify_paged(9)
lowkey the wholephy_save_pageβphy_select_pageβphy_restore_pagetrio is giving main character energy. save, select, restore. iconic π
and that's the page!! πΈ from ./drivers/net/phy, dated October 2026, brought to you by the phy_restore_page(9) girlies β mwah, love u, go restore those pages responsibly πππ¦
π¦ 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