mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jose Abreu <jose.abreu@synopsys.com>
To: Andrew Lunn <andrew@lunn.ch>, Jose Abreu <jose.abreu@synopsys.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Joao Pinto <joao.pinto@synopsys.com>,
	Heiner Kallweit <hkallweit1@gmail.com>
Subject: Re: [PATCH net 2/2] net: phy: Use C45 Helpers in PHY_FORCING state
Date: Mon, 4 Mar 2019 15:07:24 +0000	[thread overview]
Message-ID: <97425bd9-3ea5-b2c3-abc1-e5285a3e677e@synopsys.com> (raw)
In-Reply-To: <20190301135302.GB19813@lunn.ch>

Hi Andrew,

On 3/1/2019 1:53 PM, Andrew Lunn wrote:
> On Fri, Mar 01, 2019 at 11:54:24AM +0100, Jose Abreu wrote:
>> +static inline int phy_update_link(struct phy_device *phydev)
>> +{
>> +	if (!phydev->drv)
>> +		return -EIO;
>> +
>> +	if (phydev->drv->read_status)
>> +		return phydev->drv->read_status(phydev);
>> +	else if (phydev->is_c45)
>> +		return gen10g_read_status(phydev);
>> +	else
>> +		return genphy_update_link(phydev);
>> +}
> 
> Hi Jose
> 
> The asymmetry here could be an issue.  We might fall into the trap
> that a c45 PHY has the full state in phydev updated, were as a c22
> only has the link updated. Somebody testing on C45 might miss a bug
> for a C22 device.

Notice that this phy_update_link() is called from PHY_FORCING
state which in my case happens when autoneg is not enabled / is
not supported.

I think it makes sense, in this case, to only update link status,
no ?

Thanks,
Jose Miguel Abreu

> 
> Maybe this should be called phy_read_state(), and calls
> genphy_read_status() not genphy_update_link().
> 
>      Andrew
> 

  reply	other threads:[~2019-03-04 15:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 10:54 [PATCH net 0/2] Use C45 Helpers when possible Jose Abreu
2019-03-01 10:54 ` [PATCH net 1/2] net: phy: Use C45 Helpers in phy_read_status() Jose Abreu
2019-03-02  3:14   ` Florian Fainelli
2019-03-02 14:11     ` Andrew Lunn
2019-03-02 14:52       ` Heiner Kallweit
2019-03-01 10:54 ` [PATCH net 2/2] net: phy: Use C45 Helpers in PHY_FORCING state Jose Abreu
2019-03-01 13:53   ` Andrew Lunn
2019-03-04 15:07     ` Jose Abreu [this message]
2019-03-04 15:44       ` Andrew Lunn
2019-03-04 18:10         ` Heiner Kallweit
2019-03-01 13:44 ` [PATCH net 0/2] Use C45 Helpers when possible Andrew Lunn

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=97425bd9-3ea5-b2c3-abc1-e5285a3e677e@synopsys.com \
    --to=jose.abreu@synopsys.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=joao.pinto@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

Powered by JetHome