netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: phy: improve link partner capability detection
Date: Fri, 5 Apr 2019 23:38:27 +0200	[thread overview]
Message-ID: <626265b0-3020-8971-1a11-0fce46075bef@gmail.com> (raw)
In-Reply-To: <20190405212734.GE27350@lunn.ch>

On 05.04.2019 23:27, Andrew Lunn wrote:
>> +	if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT,
>> +			      phydev->supported))
>> +		phydev->is_gigabit_capable = 1;
>> +	if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
>> +			      phydev->supported))
>> +		phydev->is_gigabit_capable = 1;
>> +
> 
> What i'm trying to get at is, why do we need this bit of the patch?
> Why do we need this flag? The hardware should tell us if it can do
> gigabit.
> 
The code to query BMSR_ESTATEN and MII_ESTATUS is in genphy_read_status.
However we also have to cover the case that this function isn't used.
Therefore I query phydev->supported before the speed could be limited.
(relying on the PHY driver not lying about gigabit capability)
This part of the patch is directly before of_set_phy_supported().

I just see that we can re-use is_gigabit_capable also in
genphy_config_advert.

Of course I can read in every place the hardware for gigabit support.
But IMO this creates unnecessary code duplication.

> 	Andrew
> 
Heiner

  reply	other threads:[~2019-04-05 21:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05 19:23 [PATCH net-next] net: phy: improve link partner capability detection Heiner Kallweit
2019-04-05 19:48 ` Andrew Lunn
2019-04-05 20:04   ` Heiner Kallweit
2019-04-05 20:27     ` Andrew Lunn
2019-04-05 20:32       ` Heiner Kallweit
2019-04-05 20:43         ` Andrew Lunn
2019-04-05 20:51           ` Heiner Kallweit
2019-04-05 21:11             ` Florian Fainelli
2019-04-05 21:16               ` Heiner Kallweit
2019-04-05 21:20                 ` Heiner Kallweit
2019-04-05 21:28                   ` Florian Fainelli
2019-04-05 21:27 ` Andrew Lunn
2019-04-05 21:38   ` Heiner Kallweit [this message]
2019-04-05 21:52     ` Heiner Kallweit
2019-04-05 21:54       ` Florian Fainelli
2019-04-06 16:25         ` Heiner Kallweit
2019-04-06 20:21           ` Florian Fainelli
2019-04-06 20:21 ` Florian Fainelli
2019-04-08 22:18 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=626265b0-3020-8971-1a11-0fce46075bef@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).