From: Antonio Borneo <antonio.borneo@st.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>,
Heiner Kallweit <hkallweit1@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, <netdev@vger.kernel.org>,
Yonglong Liu <liuyonglong@huawei.com>, <stable@vger.kernel.org>,
<linuxarm@huawei.com>, Salil Mehta <salil.mehta@huawei.com>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: phy: fix auto-negotiation in case of 'down-shift'
Date: Tue, 24 Nov 2020 16:31:40 +0100 [thread overview]
Message-ID: <e6cd5bdc3b50dedc4b751f86b8769dad6219591e.camel@st.com> (raw)
In-Reply-To: <20201124151716.GG1551@shell.armlinux.org.uk>
On Tue, 2020-11-24 at 15:17 +0000, Russell King - ARM Linux admin wrote:
> On Tue, Nov 24, 2020 at 04:03:40PM +0100, Heiner Kallweit wrote:
> > Am 24.11.2020 um 15:38 schrieb Antonio Borneo:
> > > If the auto-negotiation fails to establish a gigabit link, the phy
> > > can try to 'down-shift': it resets the bits in MII_CTRL1000 to
> > > stop advertising 1Gbps and retries the negotiation at 100Mbps.
> > >
> > I see that Russell answered already. My 2cts:
> >
> > Are you sure all PHY's supporting downshift adjust the
> > advertisement bits? IIRC an Aquantia PHY I dealt with does not.
> > And if a PHY does so I'd consider this problematic:
> > Let's say you have a broken cable and the PHY downshifts to
> > 100Mbps. If you change the cable then the PHY would still negotiate
> > 100Mbps only.
>
> From what I've seen, that is not how downshift works, at least on
> the PHYs I've seen.
>
> When the PHY downshifts, it modifies the advertisement registers,
> but it also remembers the original value. When the cable is
> unplugged, it restores the setting to what was previously set.
In fact, at least rtl8211f is able to recover the original settings and
returns to 1Gbps once a decent cable gets plugged-in.
>
> It is _far_ from nice, but the fact is that your patch that Antonio
> identified has broken previously working support, something that I
> brought up when I patched one of the PHY drivers that was broken by
> this very same problem by your patch.
The idea to fix it for a general case was indeed triggered by the fact that
before commit 5502b218e001 this was the norm. I considered it as a
regression.
>
> That said, _if_ the PHY has a way to read the resolved state rather
> than reading the advertisement registers, that is what should be
> used (as I said previously) rather than trying to decode the
> advertisement registers ourselves. That is normally more reliable
> for speed and duplex.
>
Wrt rtl8211f I don't have info other then the public datasheet, and there I
didn't found any way other than reading the advertisement register.
I have read the latest comment from Heiner. I will check aqr107!
Thanks
Antonio
next prev parent reply other threads:[~2020-11-24 15:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-24 14:38 Antonio Borneo
2020-11-24 14:56 ` Russell King - ARM Linux admin
2020-11-24 15:17 ` Antonio Borneo
2020-11-24 15:26 ` Heiner Kallweit
2020-11-24 15:37 ` Russell King - ARM Linux admin
2020-11-24 17:00 ` Antonio Borneo
2020-11-24 15:03 ` Heiner Kallweit
2020-11-24 15:17 ` Russell King - ARM Linux admin
2020-11-24 15:31 ` Antonio Borneo [this message]
2020-11-24 15:46 ` David Laight
2020-11-24 21:59 ` [PATCH v2] net: phy: realtek: read actual speed on rtl8211f to detect downshift Antonio Borneo
2020-11-24 22:22 ` Heiner Kallweit
2020-11-24 22:33 ` Antonio Borneo
2020-11-24 22:41 ` Heiner Kallweit
2020-11-24 23:07 ` [PATCH v3 net-next] " Antonio Borneo
2020-11-25 15:03 ` Yonglong Liu
2020-11-25 16:57 ` Yonglong Liu
2020-11-25 17:07 ` Russell King - ARM Linux admin
2020-11-26 1:15 ` Yonglong Liu
2020-11-25 20:30 ` Jakub Kicinski
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=e6cd5bdc3b50dedc4b751f86b8769dad6219591e.camel@st.com \
--to=antonio.borneo@st.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@armlinux.org.uk \
--cc=linuxarm@huawei.com \
--cc=liuyonglong@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=stable@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
all inboxes | Powered by JetHome®