linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: bcmgenet: Set phydev->dev_flags only for internal PHYs
@ 2019-10-11 19:53 Florian Fainelli
  2019-10-11 19:57 ` Florian Fainelli
  2019-10-15 17:55 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Florian Fainelli @ 2019-10-11 19:53 UTC (permalink / raw)
  To: netdev
  Cc: phil, jonathan, matthias.bgg, linux-rpi-kernel, wahrenst,
	nsaenzjulienne, Florian Fainelli, Doug Berger, David S. Miller,
	open list:BROADCOM GENET ETHERNET DRIVER, open list

phydev->dev_flags is entirely dependent on the PHY device driver which
is going to be used, setting the internal GENET PHY revision in those
bits only makes sense when drivers/net/phy/bcm7xxx.c is the PHY driver
being used.

Fixes: 487320c54143 ("net: bcmgenet: communicate integrated PHY revision to PHY driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/broadcom/genet/bcmmii.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 970e478a9017..94d1dd5d56bf 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -273,11 +273,12 @@ int bcmgenet_mii_probe(struct net_device *dev)
 	struct bcmgenet_priv *priv = netdev_priv(dev);
 	struct device_node *dn = priv->pdev->dev.of_node;
 	struct phy_device *phydev;
-	u32 phy_flags;
+	u32 phy_flags = 0;
 	int ret;
 
 	/* Communicate the integrated PHY revision */
-	phy_flags = priv->gphy_rev;
+	if (priv->internal_phy)
+		phy_flags = priv->gphy_rev;
 
 	/* Initialize link state variables that bcmgenet_mii_setup() uses */
 	priv->old_link = -1;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: bcmgenet: Set phydev->dev_flags only for internal PHYs
  2019-10-11 19:53 [PATCH net] net: bcmgenet: Set phydev->dev_flags only for internal PHYs Florian Fainelli
@ 2019-10-11 19:57 ` Florian Fainelli
  2019-10-15  0:49   ` Doug Berger
  2019-10-15 17:55 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2019-10-11 19:57 UTC (permalink / raw)
  To: Florian Fainelli, netdev
  Cc: phil, jonathan, matthias.bgg, linux-rpi-kernel, wahrenst,
	nsaenzjulienne, Doug Berger, David S. Miller,
	open list:BROADCOM GENET ETHERNET DRIVER, open list

On 10/11/19 12:53 PM, Florian Fainelli wrote:
> phydev->dev_flags is entirely dependent on the PHY device driver which
> is going to be used, setting the internal GENET PHY revision in those
> bits only makes sense when drivers/net/phy/bcm7xxx.c is the PHY driver
> being used.
> 
> Fixes: 487320c54143 ("net: bcmgenet: communicate integrated PHY revision to PHY driver")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

FWIW, I am preparing net-next material which allows the phy_flags to be
scoped towards a specific PHY driver, and not broadly applied, but until
this happens, we should probably go with this change.

> ---
>  drivers/net/ethernet/broadcom/genet/bcmmii.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
> index 970e478a9017..94d1dd5d56bf 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
> @@ -273,11 +273,12 @@ int bcmgenet_mii_probe(struct net_device *dev)
>  	struct bcmgenet_priv *priv = netdev_priv(dev);
>  	struct device_node *dn = priv->pdev->dev.of_node;
>  	struct phy_device *phydev;
> -	u32 phy_flags;
> +	u32 phy_flags = 0;
>  	int ret;
>  
>  	/* Communicate the integrated PHY revision */
> -	phy_flags = priv->gphy_rev;
> +	if (priv->internal_phy)
> +		phy_flags = priv->gphy_rev;
>  
>  	/* Initialize link state variables that bcmgenet_mii_setup() uses */
>  	priv->old_link = -1;
> 


-- 
Florian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: bcmgenet: Set phydev->dev_flags only for internal PHYs
  2019-10-11 19:57 ` Florian Fainelli
@ 2019-10-15  0:49   ` Doug Berger
  0 siblings, 0 replies; 4+ messages in thread
From: Doug Berger @ 2019-10-15  0:49 UTC (permalink / raw)
  To: Florian Fainelli, netdev
  Cc: phil, jonathan, matthias.bgg, linux-rpi-kernel, wahrenst,
	nsaenzjulienne, David S. Miller,
	open list:BROADCOM GENET ETHERNET DRIVER, open list

On 10/11/19 12:57 PM, Florian Fainelli wrote:
> On 10/11/19 12:53 PM, Florian Fainelli wrote:
>> phydev->dev_flags is entirely dependent on the PHY device driver which
>> is going to be used, setting the internal GENET PHY revision in those
>> bits only makes sense when drivers/net/phy/bcm7xxx.c is the PHY driver
>> being used.
>>
>> Fixes: 487320c54143 ("net: bcmgenet: communicate integrated PHY revision to PHY driver")
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> FWIW, I am preparing net-next material which allows the phy_flags to be
> scoped towards a specific PHY driver, and not broadly applied, but until
> this happens, we should probably go with this change.
> 
>> ---
>>  drivers/net/ethernet/broadcom/genet/bcmmii.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
>> index 970e478a9017..94d1dd5d56bf 100644
>> --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
>> +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
>> @@ -273,11 +273,12 @@ int bcmgenet_mii_probe(struct net_device *dev)
>>  	struct bcmgenet_priv *priv = netdev_priv(dev);
>>  	struct device_node *dn = priv->pdev->dev.of_node;
>>  	struct phy_device *phydev;
>> -	u32 phy_flags;
>> +	u32 phy_flags = 0;
>>  	int ret;
>>  
>>  	/* Communicate the integrated PHY revision */
>> -	phy_flags = priv->gphy_rev;
>> +	if (priv->internal_phy)
>> +		phy_flags = priv->gphy_rev;
>>  
>>  	/* Initialize link state variables that bcmgenet_mii_setup() uses */
>>  	priv->old_link = -1;
>>
> 
> 
Acked-by: Doug Berger <opendmb@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: bcmgenet: Set phydev->dev_flags only for internal PHYs
  2019-10-11 19:53 [PATCH net] net: bcmgenet: Set phydev->dev_flags only for internal PHYs Florian Fainelli
  2019-10-11 19:57 ` Florian Fainelli
@ 2019-10-15 17:55 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2019-10-15 17:55 UTC (permalink / raw)
  To: f.fainelli
  Cc: netdev, phil, jonathan, matthias.bgg, linux-rpi-kernel, wahrenst,
	nsaenzjulienne, opendmb, bcm-kernel-feedback-list, linux-kernel

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 11 Oct 2019 12:53:49 -0700

> phydev->dev_flags is entirely dependent on the PHY device driver which
> is going to be used, setting the internal GENET PHY revision in those
> bits only makes sense when drivers/net/phy/bcm7xxx.c is the PHY driver
> being used.
> 
> Fixes: 487320c54143 ("net: bcmgenet: communicate integrated PHY revision to PHY driver")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied and queued up for -stable, thanks Florian.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-15 17:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-11 19:53 [PATCH net] net: bcmgenet: Set phydev->dev_flags only for internal PHYs Florian Fainelli
2019-10-11 19:57 ` Florian Fainelli
2019-10-15  0:49   ` Doug Berger
2019-10-15 17:55 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).