Re: [PATCH net-next 4/7] net: phy: add paged phy register accessors

2018-01-02 Thread Andrew Lunn
> I've decided to solve this by changing it to: > > + * phy_restore_page() must always be called after this, irrespective > + * of success or failure of this call. > > iow, not explaining /why/. Hi Russell That is fine by my. A quick read of the code makes it clear why. Andrew

Re: [PATCH net-next 4/7] net: phy: add paged phy register accessors

2018-01-02 Thread Russell King - ARM Linux
On Sun, Dec 31, 2017 at 10:07:14AM +, Russell King - ARM Linux wrote: > On Sun, Dec 31, 2017 at 09:10:39AM +0100, Andrew Lunn wrote: > > > +/** > > > + * phy_save_page() - take the bus lock and save the current page > > > + * @phydev: a pointer to a &struct phy_device > > > + * > > > + * Take t

Re: [PATCH net-next 4/7] net: phy: add paged phy register accessors

2017-12-31 Thread Russell King - ARM Linux
On Sun, Dec 31, 2017 at 09:10:39AM +0100, Andrew Lunn wrote: > > +/** > > + * phy_save_page() - take the bus lock and save the current page > > + * @phydev: a pointer to a &struct phy_device > > + * > > + * Take the MDIO bus lock, and return the current page number. On error, > > + * returns a nega

Re: [PATCH net-next 4/7] net: phy: add paged phy register accessors

2017-12-31 Thread Andrew Lunn
> +/** > + * phy_save_page() - take the bus lock and save the current page > + * @phydev: a pointer to a &struct phy_device > + * > + * Take the MDIO bus lock, and return the current page number. On error, > + * returns a negative errno. phy_restore_page() must be called after this > + * to release

[PATCH net-next 4/7] net: phy: add paged phy register accessors

2017-12-29 Thread Russell King
Add a set of paged phy register accessors which are inherently safe in their design against other accesses interfering with the paged access. Signed-off-by: Russell King --- drivers/net/phy/phy-core.c | 157 + include/linux/phy.h| 11 2 f