From: Helmut Grohne <helmut.grohne@intenta.de>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Russell King <linux@armlinux.org.uk>,
Palmer Dabbelt <palmer@dabbelt.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] net: macb: reject unsupported rgmii delays
Date: Wed, 17 Jun 2020 13:15:32 +0200 [thread overview]
Message-ID: <20200617111532.GA28783@laureti-dev> (raw)
In-Reply-To: <CA+h21hoTQzGwF5wYx3-0Fa_rUYWw+m2CVcBV8WUQ7OtK3DHpQA@mail.gmail.com>
Hi Vladimir,
On Wed, Jun 17, 2020 at 11:57:23AM +0200, Vladimir Oltean wrote:
> On Tue, 16 Jun 2020 at 11:00, Helmut Grohne <helmut.grohne@intenta.de> wrote:
> > --- a/drivers/net/ethernet/cadence/macb_main.c
> > +++ b/drivers/net/ethernet/cadence/macb_main.c
> > @@ -514,7 +514,7 @@ static void macb_validate(struct phylink_config *config,
> > state->interface != PHY_INTERFACE_MODE_RMII &&
> > state->interface != PHY_INTERFACE_MODE_GMII &&
> > state->interface != PHY_INTERFACE_MODE_SGMII &&
> > - !phy_interface_mode_is_rgmii(state->interface)) {
> > + state->interface != PHY_INTERFACE_MODE_RGMII_ID) {
>
> I don't think this change is correct though?
> What if there were PCB traces in place, for whatever reason? Then the
> driver would need to accept a phy with rgmii-txid, rgmii-rxid or
> rgmii.
I must confess that after rereading the discussion and the other
discussions at
https://patchwork.ozlabs.org/project/netdev/patch/20190410005700.31582-19-olteanv@gmail.com/
and
https://patchwork.ozlabs.org/project/netdev/patch/20190413012822.30931-21-olteanv@gmail.com/,
this is less and less clear to me.
I think we can agree that the current definition of phy-mode is
confusing when it comes to rgmii delays. The documentation doesn't even
mention the possibility of using serpentines.
Your interpretation seems to be that this value is solely meant for the
PHY to operate on and that the MAC should not act upon it (at least the
delay part). That interpetation is consistent with previous discussions
and mostly consistent with the documentation. The phy-mode property is
documented in ethernet-controller.yaml, which suggests that it should
apply to the MAC somehow.
Following this interpretation, I think it would be good to also document
it in ethernet-phy.yaml.
Thank you for the review. I agree that the hunk should be dropped.
However, in the fixed-link case (below) the interpretation regarding
serpentines seems to be well-defined: If serpentines are present, both
MACs should specify rgmii.
> > bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
> > return;
> > }
> > @@ -694,6 +694,13 @@ static int macb_phylink_connect(struct macb *bp)
> > struct phy_device *phydev;
> > int ret;
> >
> > + if (of_phy_is_fixed_link(dn) &&
> > + phy_interface_mode_is_rgmii(bp->phy_interface) &&
> > + bp->phy_interface != PHY_INTERFACE_MODE_RGMII) {
> > + netdev_err(dev, "RGMII delays are not supported\n");
> > + return -EINVAL;
> > + }
> > +
>
> Have you checked that this doesn't break any existing in-tree users?
It seems like all the in-tree users of this driver that do specify a
phy-mode, specify rmii.
If possible breakage is to be minimized, I'd be happy with using
netdev_warn instead. The major benefit here is getting a clear
indication of why things don't work. My emphasis is on getting something
to dmesg, not to make things fail.
So what should we prefer here? Failure or warning?
In the long run, it would be nice to refactor the way to denote delays
in a way that is consistently defined for MAC to PHY and MAC to MAC
connections while accounting for serpentines.
Helmut
next prev parent reply other threads:[~2020-06-17 11:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 7:49 [PATCH] net: macb: reject unsupported rgmii delays Helmut Grohne
2020-06-17 9:24 ` Nicolas Ferre
2020-06-17 9:57 ` Vladimir Oltean
2020-06-17 11:15 ` Helmut Grohne [this message]
2020-06-17 10:55 ` Russell King - ARM Linux admin
2020-06-17 11:21 ` Helmut Grohne
2020-06-17 11:40 ` Russell King - ARM Linux admin
2020-06-17 11:52 ` Helmut Grohne
2020-06-17 12:08 ` Russell King - ARM Linux admin
2020-06-18 8:14 ` Helmut Grohne
2020-06-18 8:45 ` Russell King - ARM Linux admin
2020-06-18 9:05 ` Helmut Grohne
2020-06-18 10:01 ` Russell King - ARM Linux admin
2020-06-18 18:26 ` Florian Fainelli
2020-06-18 18:06 ` Florian Fainelli
2020-06-18 18:49 ` Russell King - ARM Linux admin
2020-06-18 19:02 ` Florian Fainelli
2020-06-18 19:10 ` Russell King - ARM Linux admin
2020-06-17 11:32 ` Vladimir Oltean
2020-06-17 11:34 ` Russell King - ARM Linux admin
2020-06-17 11:38 ` Vladimir Oltean
2020-06-17 11:57 ` Russell King - ARM Linux admin
2020-06-18 18:25 ` Florian Fainelli
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=20200617111532.GA28783@laureti-dev \
--to=helmut.grohne@intenta.de \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=olteanv@gmail.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.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).