linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Vladimir Oltean <olteanv@gmail.com>,
	"Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Alvin __ipraga <alsi@bang-olufsen.dk>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Daniel Scally <djrscally@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	DENG Qingfang <dqfext@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	George McCollister <george.mccollister@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Hauke Mehrtens <hauke@hauke-m.de>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Kurt Kanzenbach <kurt@linutronix.de>,
	Landen Chao <Landen.Chao@mediatek.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Sean Wang <sean.wang@mediatek.com>,
	UNGLinuxDriver@microchip.com,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Woojung Huh <woojung.huh@microchip.com>
Subject: Re: [PATCH net-next 3/6] net: dsa: add support for retrieving the interface mode
Date: Sat, 23 Jul 2022 19:26:55 +0200	[thread overview]
Message-ID: <20220723192655.46de7cae@thinkpad> (raw)
In-Reply-To: <20220722223932.poxim3sxz62lhcuf@skbuf>

On Sat, 23 Jul 2022 01:39:32 +0300
Vladimir Oltean <olteanv@gmail.com> wrote:

> You mean in general, or with the firmware description you posted above?
> Because the Lynx PCS does the best it can (considering it does this from
> a function that returns void) to complain that you shouldn't put
> MLO_AN_INBAND for 2500base-x.
> 
> static void lynx_pcs_link_up_2500basex(struct mdio_device *pcs,
> 				       unsigned int mode,
> 				       int speed, int duplex)
> {
> 	u16 if_mode = 0;
> 
> 	if (mode == MLO_AN_INBAND) {
> 		dev_err(&pcs->dev, "AN not supported for 2500BaseX\n");
> 		return;
> 	}
> 
> I noticed just earlier today that I made a blunder while upstreaming some
> riser cards for some LS1028A-QDS development boards, and I did just that
> (left 2500base-x with in-band-status). But the system just errors out.
> I need to boot a board and fix that up. They're just NXP development
> systems so not a big issue. Otherwise I'm not aware of what you're
> talking about.
> 
> > However, both will request link status from the PCS side and use that
> > to determine whether the link is up, and use the parameters that the
> > PCS code returns for the link. Since 2500base-X can only operate at
> > 2.5G, PCS code always reports SPEED_2500, and as half duplex is
> > virtually never supported above 1G, DUPLEX_FULL.  
> 
> If you're saying this just because Lynx implements pcs_get_state for
> 2500base-x, it's extremely likely that this simply originates from
> vsc9959_pcs_link_state_2500basex(), which was deleted in ocelot in
> commit 588d05504d2d ("net: dsa: ocelot: use the Lynx PCS helpers in
> Felix and Seville"), and it was always dead code. It wasn't the only
> dead code, remember commit b4c2354537b4 ("net: dsa: felix: delete
> .phylink_mac_an_restart code").
> 
> Since the Lynx PCS prints error messages in inband/2500base-x mode,
> and so did Felix/Ocelot before the code became common, I'm pretty sure
> no one relies on this mode.

Does Lynx PCS support 1000base-x with AN? Because if so, it may be
possible to somehow hack working AN for 2500base-x, as I managed it for
88E6393X in the commit I mentioned (by configuring 1000base-x and then
hacking the PHY speed to 2.5x).

Anyway, I am now looking at the standards, and it seems that all the X
and R have K variant: 1000base-kx, 2500base-kx, 5gbase-kr and
10gbase-kr. These modes have mandatory clause 73 autonegotiation.

So either we need to add these as different modes of the
phy_interface_t type, or we need to differentiate whether clause 37 or
clause 73 AN should be used by another property.

But since 1000base-x supports clause 37 and 1000base-kx clause 73, the
one property that we have, managed="in-band-status" is not enough, if
we keep calling both modes '1000base-x'.

So maybe we really need to add K variants as separate
PHY_INTERFACE_MODED_ constants. That way we can keep assuming clause 37
for 2500base-x, and try to implement it for as much drivers as
possible, by hacking it up...

And I still don't understand this clause 73 AN at all. For example, if
one PHY supports only up to 2.5g speeds, will it complete AN with
another PHY that supports up to 10g speeds, if the second PHY will
(maybe?) try at higher frequency?

Marek


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-07-23 17:28 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 16:00 [PATCH net-next 0/6] net: dsa: always use phylink Russell King (Oracle)
2022-07-15 16:01 ` [PATCH net-next 1/6] net: phylink: split out and export interface to caps translation Russell King (Oracle)
2022-07-15 16:01 ` [PATCH net-next 2/6] software node: allow named software node to be created Russell King
2022-07-15 19:57   ` Andy Shevchenko
2022-07-15 20:17     ` Vladimir Oltean
2022-07-15 20:33       ` Andy Shevchenko
2022-07-15 20:48         ` Vladimir Oltean
2022-07-18 12:29           ` Andy Shevchenko
2022-07-18 13:27             ` Russell King (Oracle)
2022-07-18 18:43               ` Andy Shevchenko
2022-07-18 18:53                 ` Andy Shevchenko
2022-07-18 19:14                   ` Russell King (Oracle)
2022-07-18 19:24                     ` Andy Shevchenko
2022-07-18 20:39                       ` Marek Behún
2022-07-18 20:48                         ` Andy Shevchenko
2022-07-19  7:18                           ` Marek Behún
2022-07-29 12:08                             ` Andy Shevchenko
2022-07-18 19:11                 ` Russell King (Oracle)
2022-07-18 20:07                   ` Andy Shevchenko
2022-07-18 20:38                     ` Russell King (Oracle)
2022-07-19  8:50                       ` Sakari Ailus
2022-07-20 22:56                         ` Vladimir Oltean
2022-07-22  6:21                           ` Sakari Ailus
2022-07-18 20:42                   ` Andrew Lunn
2022-07-15 16:01 ` [PATCH net-next 3/6] net: dsa: add support for retrieving the interface mode Russell King (Oracle)
2022-07-15 17:24   ` Vladimir Oltean
2022-07-15 21:31     ` Russell King (Oracle)
2022-07-15 22:23       ` Vladimir Oltean
2022-07-15 22:57         ` Russell King (Oracle)
2022-07-16 10:57           ` Vladimir Oltean
2022-07-16 11:13             ` Russell King (Oracle)
2022-07-16 12:36               ` Vladimir Oltean
2022-07-18  8:48                 ` Russell King (Oracle)
2022-07-20 22:44                   ` Vladimir Oltean
2022-07-21 13:46                     ` Vladimir Oltean
2022-07-21 14:46                       ` Andrew Lunn
2022-07-21 14:54                       ` Russell King (Oracle)
2022-07-21 15:15                         ` Vladimir Oltean
2022-07-21 17:21                           ` Marek Behún
2022-07-21 18:15                             ` Russell King (Oracle)
2022-07-21 18:22                             ` Vladimir Oltean
2022-07-21 21:14                               ` Russell King (Oracle)
2022-07-21 21:36                                 ` Vladimir Oltean
2022-07-22  8:28                                   ` Russell King (Oracle)
2022-07-22 10:52                                     ` Vladimir Oltean
2022-07-22 11:44                                       ` Russell King (Oracle)
2022-07-22 12:14                                         ` Russell King (Oracle)
2022-07-22 12:46                                         ` Vladimir Oltean
2022-07-22 13:16                                           ` Russell King (Oracle)
2022-07-22 16:56                                             ` Vladimir Oltean
2022-07-22 21:20                                               ` Russell King (Oracle)
2022-07-22 21:53                                                 ` Andrew Lunn
2022-07-22 22:35                                                 ` Andrew Lunn
2022-07-22 22:39                                                 ` Vladimir Oltean
2022-07-23  7:12                                                   ` Russell King (Oracle)
2022-07-23 13:44                                                     ` Vladimir Oltean
2022-07-25 10:11                                                       ` Russell King (Oracle)
2022-07-23 17:26                                                   ` Marek Behún [this message]
2022-07-24 17:39                                                     ` Vladimir Oltean
2022-07-22 13:20                                         ` Andrew Lunn
2022-07-22 12:59                               ` Marek Behún
2022-07-22 13:23                                 ` Russell King (Oracle)
2022-07-22 14:19                                   ` Marek Behún
2022-07-15 16:01 ` [PATCH net-next 4/6] net: dsa: mv88e6xxx: report the default interface mode for the port Russell King (Oracle)
2022-07-15 16:01 ` [PATCH net-next 5/6] net: dsa: use swnode fixed-link if using default params Russell King (Oracle)
2022-07-15 20:11   ` Andy Shevchenko
2022-07-15 21:36     ` Russell King (Oracle)
2022-07-18 18:59       ` Andy Shevchenko
2022-07-18 19:13         ` Russell King (Oracle)
2022-07-18 20:08           ` Andy Shevchenko
2022-07-15 16:01 ` [PATCH net-next 6/6] net: dsa: mv88e6xxx: remove handling for DSA and CPU ports Russell King (Oracle)
2022-07-15 17:17 ` [PATCH net-next 0/6] net: dsa: always use phylink Vladimir Oltean
2022-07-15 20:59   ` Russell King (Oracle)
2022-07-15 23:03     ` Jakub Kicinski
2022-07-16 11:15       ` Vladimir Oltean
2022-07-16 11:43         ` Russell King (Oracle)
2022-07-16 13:13           ` Vladimir Oltean
2022-07-18  8:53             ` Russell King (Oracle)
2022-07-18 12:45               ` Vladimir Oltean
2022-07-18 13:02                 ` Russell King (Oracle)
2022-07-18 14:25                   ` Vladimir Oltean
2022-07-16 23:44         ` Jakub Kicinski
2022-07-27  9:00 ` Marek Behún
2022-07-27 13:38   ` Vladimir Oltean

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=20220723192655.46de7cae@thinkpad \
    --to=kabel@kernel.org \
    --cc=Landen.Chao@mediatek.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=djrscally@gmail.com \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=george.mccollister@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hauke@hauke-m.de \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sean.wang@mediatek.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.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).