[net-next,2/3] net: phy: broadcom: Have bcm54xx_adjust_rxrefclk() check for flags
diff mbox series

Message ID 20200214233853.27217-3-f.fainelli@gmail.com
State Superseded
Delegated to: David Miller
Headers show
Series
  • net: phy: Better support for BCM54810
Related show

Commit Message

Florian Fainelli Feb. 14, 2020, 11:38 p.m. UTC
bcm54xx_adjust_rxrefclk() already checks for the flags and will
correctly reacting to the 3 different flags it check, allow it to be
unconditionally called.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/broadcom.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Andrew Lunn Feb. 15, 2020, 4:08 p.m. UTC | #1
On Fri, Feb 14, 2020 at 03:38:52PM -0800, Florian Fainelli wrote:
> bcm54xx_adjust_rxrefclk() already checks for the flags and will
> correctly reacting to the 3 different flags it check, allow it to be
> unconditionally called.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/net/phy/broadcom.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
> index 4ad2128cc454..b4eae84a9195 100644
> --- a/drivers/net/phy/broadcom.c
> +++ b/drivers/net/phy/broadcom.c
> @@ -273,10 +273,7 @@ static int bcm54xx_config_init(struct phy_device *phydev)
>  	    (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE))
>  		bcm_phy_write_shadow(phydev, BCM54XX_SHD_RGMII_MODE, 0);
>  
> -	if ((phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) ||
> -	    (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY) ||
> -	    (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
> -		bcm54xx_adjust_rxrefclk(phydev);
> +	bcm54xx_adjust_rxrefclk(phydev);

Hi Florian

PHY_BRCM_RX_REFCLK_UNUSED is not unconditionally checked in
bcm54xx_adjust_rxrefclk(), where as here it is. I assume this is O.K?
The same is tree for PHY_BRCM_AUTO_PWRDWN_ENABLE.  Maybe worth a
comment in the commit message if you need to respin.

      Andrew
Florian Fainelli Feb. 19, 2020, 7:43 p.m. UTC | #2
On 2/15/20 8:08 AM, Andrew Lunn wrote:
> On Fri, Feb 14, 2020 at 03:38:52PM -0800, Florian Fainelli wrote:
>> bcm54xx_adjust_rxrefclk() already checks for the flags and will
>> correctly reacting to the 3 different flags it check, allow it to be
>> unconditionally called.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>  drivers/net/phy/broadcom.c | 5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
>> index 4ad2128cc454..b4eae84a9195 100644
>> --- a/drivers/net/phy/broadcom.c
>> +++ b/drivers/net/phy/broadcom.c
>> @@ -273,10 +273,7 @@ static int bcm54xx_config_init(struct phy_device *phydev)
>>  	    (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE))
>>  		bcm_phy_write_shadow(phydev, BCM54XX_SHD_RGMII_MODE, 0);
>>  
>> -	if ((phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) ||
>> -	    (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY) ||
>> -	    (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
>> -		bcm54xx_adjust_rxrefclk(phydev);
>> +	bcm54xx_adjust_rxrefclk(phydev);
> 
> Hi Florian
> 
> PHY_BRCM_RX_REFCLK_UNUSED is not unconditionally checked in
> bcm54xx_adjust_rxrefclk(), where as here it is. I assume this is O.K?
> The same is tree for PHY_BRCM_AUTO_PWRDWN_ENABLE.  Maybe worth a
> comment in the commit message if you need to respin.

Indeed, let me correct that in the commit message.

Patch
diff mbox series

diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 4ad2128cc454..b4eae84a9195 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -273,10 +273,7 @@  static int bcm54xx_config_init(struct phy_device *phydev)
 	    (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE))
 		bcm_phy_write_shadow(phydev, BCM54XX_SHD_RGMII_MODE, 0);
 
-	if ((phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) ||
-	    (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY) ||
-	    (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
-		bcm54xx_adjust_rxrefclk(phydev);
+	bcm54xx_adjust_rxrefclk(phydev);
 
 	if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E) {
 		err = bcm54210e_config_init(phydev);