linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Is Documentation/networking/phy.txt still up-to-date?
@ 2016-11-09 13:24 Sebastian Frias
  2016-11-09 17:07 ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Frias @ 2016-11-09 13:24 UTC (permalink / raw)
  To: afleming, jgarzik, Måns Rullgård, Florian Fainelli
  Cc: netdev, LKML, David S. Miller

Hi,

Documentation/networking/phy.txt discusses phy_connect and states that:

 "...

 interface is a u32 which specifies the connection type used
 between the controller and the PHY.  Examples are GMII, MII,
 RGMII, and SGMII.  For a full list, see include/linux/phy.h

 Now just make sure that phydev->supported and phydev->advertising have any
 values pruned from them which don't make sense for your controller (a 10/100
 controller may be connected to a gigabit capable PHY, so you would need to
 mask off SUPPORTED_1000baseT*).  See include/linux/ethtool.h for definitions
 for these bitfields. Note that you should not SET any bits, or the PHY may
 get put into an unsupported state.

 ..."

However, 'drivers/net/ethernet/aurora/nb8800.c' for example, does SETs some
bits (in function 'nb8800_pause_adv').

I checked 'drivers/net/ethernet/broadcom/genet/bcmmii.c' and that one CLEARs
bits (as per the documentation).

Does anybody knows what is the correct/recommended approach?

Best regards,

Sebastian

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

* Re: Is Documentation/networking/phy.txt still up-to-date?
  2016-11-09 13:24 Is Documentation/networking/phy.txt still up-to-date? Sebastian Frias
@ 2016-11-09 17:07 ` Florian Fainelli
  2016-11-14 13:18   ` Sebastian Frias
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2016-11-09 17:07 UTC (permalink / raw)
  To: Sebastian Frias, afleming, jgarzik, Måns Rullgård
  Cc: netdev, LKML, David S. Miller

On 11/09/2016 05:24 AM, Sebastian Frias wrote:
> Hi,
> 
> Documentation/networking/phy.txt discusses phy_connect and states that:
> 
>  "...
> 
>  interface is a u32 which specifies the connection type used
>  between the controller and the PHY.  Examples are GMII, MII,
>  RGMII, and SGMII.  For a full list, see include/linux/phy.h
> 
>  Now just make sure that phydev->supported and phydev->advertising have any
>  values pruned from them which don't make sense for your controller (a 10/100
>  controller may be connected to a gigabit capable PHY, so you would need to
>  mask off SUPPORTED_1000baseT*).  See include/linux/ethtool.h for definitions
>  for these bitfields. Note that you should not SET any bits, or the PHY may
>  get put into an unsupported state.
> 
>  ..."
> 
> However, 'drivers/net/ethernet/aurora/nb8800.c' for example, does SETs some
> bits (in function 'nb8800_pause_adv').

All pause/flow control related bits should be set by the Ethernet MAC
driver because this is an Ethernet MAC, not PHY, thing. See this
discussion for some details:

https://www.mail-archive.com/netdev@vger.kernel.org/msg135347.html

So the nb8800 drivers does the correct thing here, but the documentation
should be updated to reflect that this applies to all bits, except the
Pause capabilities because these need to come from the Ethernet MAC.

> 
> I checked 'drivers/net/ethernet/broadcom/genet/bcmmii.c' and that one CLEARs
> bits (as per the documentation).
> 
> Does anybody knows what is the correct/recommended approach?

Both drivers do correct things, they just don't set the same things here.
-- 
Florian

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

* Re: Is Documentation/networking/phy.txt still up-to-date?
  2016-11-09 17:07 ` Florian Fainelli
@ 2016-11-14 13:18   ` Sebastian Frias
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Frias @ 2016-11-14 13:18 UTC (permalink / raw)
  To: Florian Fainelli, afleming, jgarzik, Måns Rullgård
  Cc: netdev, LKML, David S. Miller, Mason

On 11/09/2016 06:07 PM, Florian Fainelli wrote:
> On 11/09/2016 05:24 AM, Sebastian Frias wrote:
>> Hi,
>>
>> Documentation/networking/phy.txt discusses phy_connect and states that:
>>
>>  "...
>>
>>  interface is a u32 which specifies the connection type used
>>  between the controller and the PHY.  Examples are GMII, MII,
>>  RGMII, and SGMII.  For a full list, see include/linux/phy.h
>>
>>  Now just make sure that phydev->supported and phydev->advertising have any
>>  values pruned from them which don't make sense for your controller (a 10/100
>>  controller may be connected to a gigabit capable PHY, so you would need to
>>  mask off SUPPORTED_1000baseT*).  See include/linux/ethtool.h for definitions
>>  for these bitfields. Note that you should not SET any bits, or the PHY may
>>  get put into an unsupported state.
>>
>>  ..."
>>
>> However, 'drivers/net/ethernet/aurora/nb8800.c' for example, does SETs some
>> bits (in function 'nb8800_pause_adv').
> 
> All pause/flow control related bits should be set by the Ethernet MAC
> driver because this is an Ethernet MAC, not PHY, thing. See this
> discussion for some details:
> 
> https://www.mail-archive.com/netdev@vger.kernel.org/msg135347.html
> 
> So the nb8800 drivers does the correct thing here, but the documentation
> should be updated to reflect that this applies to all bits, except the
> Pause capabilities because these need to come from the Ethernet MAC.
> 

Ok, thanks.

>>
>> I checked 'drivers/net/ethernet/broadcom/genet/bcmmii.c' and that one CLEARs
>> bits (as per the documentation).
>>
>> Does anybody knows what is the correct/recommended approach?
> 
> Both drivers do correct things, they just don't set the same things here.
> 

Thanks!

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

end of thread, other threads:[~2016-11-14 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-09 13:24 Is Documentation/networking/phy.txt still up-to-date? Sebastian Frias
2016-11-09 17:07 ` Florian Fainelli
2016-11-14 13:18   ` Sebastian Frias

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).