From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Landen Chao <landen.chao@mediatek.com>
Cc: DENG Qingfang <dqfext@gmail.com>,
Sean Wang <Sean.Wang@mediatek.com>, Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH RFC net-next 0/7] net: dsa: mt7530: updates for phylink changes
Date: Wed, 9 Feb 2022 17:47:32 +0000 [thread overview]
Message-ID: <YgP+NBeGL4MzRcYR@shell.armlinux.org.uk> (raw)
In-Reply-To: <48d2d967a625c65308bff7bad03ae49779986549.camel@mediatek.com>
On Thu, Feb 10, 2022 at 01:33:34AM +0800, Landen Chao wrote:
> On Wed, 2022-02-09 at 21:06 +0800, Russell King (Oracle) wrote:
> > On Thu, Feb 03, 2022 at 05:30:31PM +0000, Russell King (Oracle)
> > wrote:
> > > Hi,
> > >
> > > This series is a partial conversion of the mt7530 DSA driver to the
> > > modern phylink infrastructure. This driver has some exceptional
> > > cases
> > > which prevent - at the moment - its full conversion (particularly
> > > with
> > > the Autoneg bit) to using phylink_generic_validate().
> > >
> > > What stands in the way is this if() condition in
> > > mt753x_phylink_validate():
> > >
> > > if (state->interface != PHY_INTERFACE_MODE_TRGMII ||
> > > !phy_interface_mode_is_8023z(state->interface)) {
> > >
> > > reduces to being always true. I highlight this here for the
> > > attention
> > > of the driver maintainers.
> Hi Russel,
>
> The above behaviour is really a bug. "&&" should be used to prevent
> setting MAC_10, MAC_100 and Antoneg capability in particular interface
> mode in original code. However, these capability depend on the link
> partner of the MAC, such as Ethernet phy. It's okay to keep setting
> them.
Hi Landen,
Thanks for the response. I think you have a slight misunderstanding
about these capabilities, both in the old code and the new code.
You shouldn't care about e.g. the ethernet PHY's capabilities in the
validate() callback at all - phylink will look at the capabilities
reported by phylib, and mask out anything that the MAC says shouldn't
be supported, which has the effect of restricting what the ethernet
PHY will advertise.
In the old code, the validate() callback should only be concerned with
what the MAC and PCS can support - e.g. if the MAC isn't capable of
supportig 1G half-duplex, then the 1G HD capabilities should be masked
out.
With the new code, PCS gain their own validation function, which means
that the validate() callback then becomes very much just about the MAC,
and with phylink_generic_validate(), we can get away with just
specifying a bitmap of the supported interface types for the MAC/PCS
end of the system, and the MAC speeds that are supported.
Given your feedback, I will re-jig the series to take account of your
comments - thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2022-02-09 17:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 17:30 [PATCH RFC net-next 0/7] net: dsa: mt7530: updates for phylink changes Russell King (Oracle)
2022-02-03 17:31 ` [PATCH RFC net-next 1/7] net: dsa: mt7530: populate supported_interfaces Russell King (Oracle)
2022-02-03 17:31 ` [PATCH RFC net-next 2/7] net: dsa: mt7530: remove interface checks Russell King (Oracle)
2022-02-03 17:31 ` [PATCH RFC net-next 3/7] net: dsa: mt7530: drop use of phylink_helper_basex_speed() Russell King (Oracle)
2022-02-03 17:31 ` [PATCH RFC net-next 4/7] net: dsa: mt7530: only indicate linkmodes that can be supported Russell King (Oracle)
2022-02-03 17:31 ` [PATCH RFC net-next 5/7] net: dsa: mt7530: RGMII can support 1000base-X Russell King (Oracle)
2022-02-03 17:31 ` [PATCH RFC net-next 6/7] net: dsa: mt7530: switch to use phylink_get_linkmodes() Russell King (Oracle)
2022-02-03 17:31 ` [PATCH RFC net-next 7/7] net: dsa: mt7530: mark as non-legacy Russell King (Oracle)
2022-02-09 13:06 ` [PATCH RFC net-next 0/7] net: dsa: mt7530: updates for phylink changes Russell King (Oracle)
2022-02-09 17:33 ` Landen Chao
2022-02-09 17:47 ` Russell King (Oracle) [this message]
2022-02-09 19:15 ` Landen Chao
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=YgP+NBeGL4MzRcYR@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=Sean.Wang@mediatek.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=landen.chao@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@gmail.com \
/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).