All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: 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 16:44:55 +0100	[thread overview]
Message-ID: <20190304154455.GD18622@lunn.ch> (raw)
In-Reply-To: <97425bd9-3ea5-b2c3-abc1-e5285a3e677e@synopsys.com>

On Mon, Mar 04, 2019 at 03:07:24PM +0000, Jose Abreu wrote:
> 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 ?
 
Hi Jose

It is actually quite difficult to determine when the link is up. I
personally would not trust gen10g_read_status() to get this right, and
would always implement the read_status callback.

Which PHY driver are you using, which does not support
read_status(). All the mainline PHY drivers do seem to have
read_status implemented.

    Andrew

  reply	other threads:[~2019-03-04 15:45 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
2019-03-04 15:44       ` Andrew Lunn [this message]
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=20190304154455.GD18622@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=joao.pinto@synopsys.com \
    --cc=jose.abreu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.