From: Florian Fainelli <f.fainelli@gmail.com>
To: Heiner Kallweit <hkallweit1@gmail.com>,
Andrew Lunn <andrew@lunn.ch>, David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: phy: add GBit master / slave error detection
Date: Wed, 18 Jul 2018 02:22:19 -0700 [thread overview]
Message-ID: <a2e47fd0-f9a1-b8bd-c84d-6940d75dd453@gmail.com> (raw)
In-Reply-To: <60685308-a848-e4d0-e170-f2738f046679@gmail.com>
On 07/17/2018 11:14 PM, Heiner Kallweit wrote:
> Certain PHY's have issues when operating in GBit slave mode and can
> be forced to master mode. Examples are RTL8211C, also the Micrel PHY
> driver has a DT setting to force master mode.
> If two such chips are link partners the autonegotiation will fail.
> Standard defines a self-clearing on read, latched-high bit to
> indicate this error. Check this bit to inform the user.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> drivers/net/phy/phy_device.c | 5 +++++
> include/uapi/linux/mii.h | 1 +
> 2 files changed, 6 insertions(+)
>
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index b9f5f40a..249c6f75 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1551,6 +1551,11 @@ int genphy_read_status(struct phy_device *phydev)
> if (lpagb < 0)
> return lpagb;
>
> + if (lpagb & LPA_1000MSFAIL) {
> + phydev_err(phydev, "Master/Slave resolution failed, maybe conflicting manual settings?\n");
> + return -ENOLINK;
> + }
> +
You should also be able to read whether Master/Slave was configured as
automatic or manual, and possibly issue a different message when
automatic/forced is specified?
AFAIR there was a patch a while ago from Mellanox guys that was possibly
extending the link notification with an error cause, this sounds like
something that could be useful to report to user space somehow to help
troubleshoot link down events.
Thanks for your improvements to PHYLIB.
--
Florian
next prev parent reply other threads:[~2018-07-18 9:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-18 6:14 [PATCH net-next] net: phy: add GBit master / slave error detection Heiner Kallweit
2018-07-18 9:22 ` Florian Fainelli [this message]
2018-07-19 5:54 ` Heiner Kallweit
2018-07-19 14:46 ` Andrew Lunn
2018-07-19 21:11 ` Heiner Kallweit
2018-07-19 21:45 ` 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=a2e47fd0-f9a1-b8bd-c84d-6940d75dd453@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@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).