Re: [PATCH net-next v9] net: mdio: Add RTL9300 MDIO driver
From: Andrew Lunn
Date: Mon Mar 10 2025 - 12:33:07 EST
> So far upstream Linux doesn't have generic paged PHY register functions.
Yes it does:
phy_write_paged() and phy_read_paged().
These do all the locking to make sure they are atomic with respect to
other phy read/writes while the page is selected. The driver just
needs to provide two methods to read the current page and the set the
current page,
https://elixir.bootlin.com/linux/v6.13.6/source/include/linux/phy.h#L1060
/** @read_page: Return the current PHY register page number */
int (*read_page)(struct phy_device *dev);
/** @write_page: Set the current PHY register page number */
int (*write_page)(struct phy_device *dev, int page);
Andrew