Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-10 Thread Andrew Lunn
> I guess it boils down to: how hard should we try to get the driver > behave correctly if the user is changing registers. All bets are off if root starts messing with the PHY state from userspace. Its a foot gun, don't be surprised with what happens when you use it. Andrew

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-10 Thread Heiner Kallweit
On 10.02.2021 13:17, Michael Walle wrote: > Am 2021-02-10 12:48, schrieb Russell King - ARM Linux admin: >> On Wed, Feb 10, 2021 at 12:14:35PM +0100, Michael Walle wrote: >>> Am 2021-02-10 11:49, schrieb Russell King - ARM Linux admin: >>> The PHY doesn't support fiber and register 0..15 are

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-10 Thread Michael Walle
Am 2021-02-10 12:48, schrieb Russell King - ARM Linux admin: On Wed, Feb 10, 2021 at 12:14:35PM +0100, Michael Walle wrote: Am 2021-02-10 11:49, schrieb Russell King - ARM Linux admin: The PHY doesn't support fiber and register 0..15 are always available regardless of the selected page for the

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-10 Thread Russell King - ARM Linux admin
On Wed, Feb 10, 2021 at 12:14:35PM +0100, Michael Walle wrote: > Am 2021-02-10 11:49, schrieb Russell King - ARM Linux admin: > The PHY doesn't support fiber and register 0..15 are always available > regardless of the selected page for the IP101G. > > genphy_() stuff will work, but the IP101G PHY

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-10 Thread Michael Walle
Am 2021-02-10 11:49, schrieb Russell King - ARM Linux admin: On Wed, Feb 10, 2021 at 11:38:18AM +0100, Michael Walle wrote: Am 2021-02-10 11:30, schrieb Russell King - ARM Linux admin: > On Wed, Feb 10, 2021 at 08:03:07AM +0100, Heiner Kallweit wrote: > > On 09.02.2021 17:40, Michael Walle

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-10 Thread Russell King - ARM Linux admin
On Wed, Feb 10, 2021 at 11:38:18AM +0100, Michael Walle wrote: > Am 2021-02-10 11:30, schrieb Russell King - ARM Linux admin: > > On Wed, Feb 10, 2021 at 08:03:07AM +0100, Heiner Kallweit wrote: > > > On 09.02.2021 17:40, Michael Walle wrote: > > > > +out: > > > > + return

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-10 Thread Michael Walle
Am 2021-02-10 11:30, schrieb Russell King - ARM Linux admin: On Wed, Feb 10, 2021 at 08:03:07AM +0100, Heiner Kallweit wrote: On 09.02.2021 17:40, Michael Walle wrote: > +out: > + return phy_restore_page(phydev, oldpage, err); If a random page was set before entering config_init, do we

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-10 Thread Russell King - ARM Linux admin
On Wed, Feb 10, 2021 at 08:03:07AM +0100, Heiner Kallweit wrote: > On 09.02.2021 17:40, Michael Walle wrote: > > +out: > > + return phy_restore_page(phydev, oldpage, err); > > If a random page was set before entering config_init, do we actually want > to restore it? Or wouldn't it be better to

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-10 Thread Michael Walle
Hi, Am 2021-02-10 10:03, schrieb Heiner Kallweit: [..] +    return phy_restore_page(phydev, oldpage, err); If a random page was set before entering config_init, do we actually want to restore it? Or wouldn't it be better to set the default page as part of initialization? First, I want to

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-10 Thread Heiner Kallweit
On 10.02.2021 09:25, Michael Walle wrote: > Hi, > > Am 2021-02-10 08:03, schrieb Heiner Kallweit: >> On 09.02.2021 17:40, Michael Walle wrote: >>> Registers >= 16 are paged. Be sure to set the page. It seems this was >>> working for now, because the default is correct for the registers used >>>

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-10 Thread Michael Walle
Hi, Am 2021-02-10 08:03, schrieb Heiner Kallweit: On 09.02.2021 17:40, Michael Walle wrote: Registers >= 16 are paged. Be sure to set the page. It seems this was working for now, because the default is correct for the registers used in the driver at the moment. But this will also assume,

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-09 Thread Heiner Kallweit
On 09.02.2021 17:40, Michael Walle wrote: > Registers >= 16 are paged. Be sure to set the page. It seems this was > working for now, because the default is correct for the registers used > in the driver at the moment. But this will also assume, nobody will > change the page select register before

Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-09 Thread Andrew Lunn
On Tue, Feb 09, 2021 at 05:40:49PM +0100, Michael Walle wrote: > Registers >= 16 are paged. Be sure to set the page. It seems this was > working for now, because the default is correct for the registers used > in the driver at the moment. But this will also assume, nobody will > change the page

[PATCH net-next 7/9] net: phy: icplus: select page before writing control register

2021-02-09 Thread Michael Walle
Registers >= 16 are paged. Be sure to set the page. It seems this was working for now, because the default is correct for the registers used in the driver at the moment. But this will also assume, nobody will change the page select register before linux is started. The page select register is