Re: [PATCH net-next] net: phy: improve genphy_read_status

2019-04-02 Thread Heiner Kallweit
On 31.03.2019 17:05, Heiner Kallweit wrote: > On 31.03.2019 16:58, Andrew Lunn wrote: >>> - In auto-neg case, skip populating lp_advertising if we >>> don't have a link. This avoids quite some unnecessary >>> MDIO reads in case of phylib polling mode. >> >> Hi Heiner >> >> Could it be that we d

Re: [PATCH net-next] net: phy: improve genphy_read_status

2019-04-01 Thread David Miller
From: Heiner Kallweit Date: Sat, 30 Mar 2019 10:22:45 +0100 > This patch improves few aspects of genphy_read_status(): > > - Don't initialize lpagb, it's not needed. > > - Move initializing phydev->speed et al before the if clause. > > - In auto-neg case, skip populating lp_advertising if we >

Re: [PATCH net-next] net: phy: improve genphy_read_status

2019-03-31 Thread Andrew Lunn
On Sun, Mar 31, 2019 at 04:59:13PM +0200, Heiner Kallweit wrote: > On 31.03.2019 16:52, Andrew Lunn wrote: > >> - if (AUTONEG_ENABLE == phydev->autoneg) { > >> + if (phydev->autoneg == AUTONEG_ENABLE && phydev->link) { > > > > Hi Heiner > > > > I don't necessary agree with placing the constant

Re: [PATCH net-next] net: phy: improve genphy_read_status

2019-03-31 Thread Heiner Kallweit
On 31.03.2019 16:58, Andrew Lunn wrote: >> - In auto-neg case, skip populating lp_advertising if we >> don't have a link. This avoids quite some unnecessary >> MDIO reads in case of phylib polling mode. > > Hi Heiner > > Could it be that we don't have a link because what the partner is > adve

Re: [PATCH net-next] net: phy: improve genphy_read_status

2019-03-31 Thread Heiner Kallweit
On 31.03.2019 16:52, Andrew Lunn wrote: >> -if (AUTONEG_ENABLE == phydev->autoneg) { >> +if (phydev->autoneg == AUTONEG_ENABLE && phydev->link) { > > Hi Heiner > > I don't necessary agree with placing the constant first in the > comparison, but it is best practice not to change it when ma

Re: [PATCH net-next] net: phy: improve genphy_read_status

2019-03-31 Thread Andrew Lunn
> - In auto-neg case, skip populating lp_advertising if we > don't have a link. This avoids quite some unnecessary > MDIO reads in case of phylib polling mode. Hi Heiner Could it be that we don't have a link because what the partner is advertising does not intersect with what we are advertisi

Re: [PATCH net-next] net: phy: improve genphy_read_status

2019-03-31 Thread Andrew Lunn
> - if (AUTONEG_ENABLE == phydev->autoneg) { > + if (phydev->autoneg == AUTONEG_ENABLE && phydev->link) { Hi Heiner I don't necessary agree with placing the constant first in the comparison, but it is best practice not to change it when making additions. It makes it a little bit harder to

[PATCH net-next] net: phy: improve genphy_read_status

2019-03-30 Thread Heiner Kallweit
This patch improves few aspects of genphy_read_status(): - Don't initialize lpagb, it's not needed. - Move initializing phydev->speed et al before the if clause. - In auto-neg case, skip populating lp_advertising if we don't have a link. This avoids quite some unnecessary MDIO reads in case