All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Alvin __ipraga" <alsi@bang-olufsen.dk>,
	"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>,
	"Marek Behún" <kabel@kernel.org>
Subject: Re: [PATCH net-next 2/6] software node: allow named software node to be created
Date: Mon, 18 Jul 2022 22:42:29 +0200	[thread overview]
Message-ID: <YtXFtTsf++AeDm1l@lunn.ch> (raw)
In-Reply-To: <YtWwbMucEyO+W8/Y@shell.armlinux.org.uk>

> > Just for my learning, why PHY uses "fixed-link" instead of relying on a
> > (firmware) graph? It might be the actual solution to your problem.
> 
> That's a question for Andrew, but I've tried to solicit his comments on
> several occasions concerning this "feature" of DSA but I keep getting
> no reply. Honestly, I don't know the answer to your question.
> 
> The only thing that I know is that Andrew has been promoting this
> feature where a switch port, whether it be connected to the CPU or
> to another switch, which doesn't specify any link parameters will
> automatically use the fastest "phy interface mode" and the fastest
> link speed that can be supported by the DSA device.

This goes back to the very beginning of DSA, as far as i know. This
was before the times of DT. Platform data was used to describe the
switch tree, and it was pretty minimalist. It just listed the ports of
the switches and their names. The 'cpu' port had the name 'cpu', and
DSA ports either did not have a name, or 'dsa'. I don't
remember. There was also a table describing the routing between
switches in the tree. The platform data had nothing to describe
interface speeds, and i'm not sure phylib was even involved to control
the integrated PHYs. Marvell switches would power up their PHYs in
autoneg mode, meaning they just worked. In order to make the CPU port
work, which did not have a PHY, the driver would configure the CPU
port into its fastest mode. Same for the DSA ports. A Marvell Switch
connected to a Marvell SoC NIC worked.

Sometime later DT became the way to describe ARM boards, and pretty
much all boards with switches were ARM boards. If i remember
correctly, Florian did the first binding, which was basically
translate the platform data straight into DT. Since the platform data
had no way to describe port speed, the DT binding had no way to
describe port speed. It just kept on defaulting to the maximum speed.

The DT world evolved, and DT bindings were produced for phylib.

At some point, DSA got an interface to phylib. Maybe it was there from
the beginning, maybe it was added later. I don't know. As a result,
the DT properties for phylib became valid for switch user ports.

Without looking at git, i'm a bit hazy why fixed-link was introduced
for CPU and DSA ports. At some point in time, i was asked to make a
Marvell switch work with a Freescale FEC. The FEC had a Fast Ethernet,
where as the switch CPU port was 1G. It could be that in order to make
this work, i added fixed-link support to CPU ports, so i could specify
the CPU port speed, rather than use the default which would not work.

At some point, i had a board with an RGMII interface used as a DSA
link between two switches, and i needed to specify the RGMII
delays. It could of been using a fixed-link allowed the phy-mode to be
specified for a DSA port, thus allowing the delays to be specified?

Basically, fixed-phy for CPU and DSA was added to solve a limitation
of the default fastest port speed not always working.

With time, more vendors got behind DSA and switches other than Marvell
were added. There was not much documentation about the expectations of
switch drivers, and i doubt this default maximum speed behaviour of
CPU ports was documented. I probably commented on earlier drivers that
fixed-link could be used, or that the Marvell behaviour could be
copied.

And some devices probably power up ports at their maximum speed,
others can probably be strapped to specific modes. Some drivers
default to maximum speed, others required fixed links to specific the
speed. As Russell says, code inspection is not enough to tell what is
going on.

	Andrew

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew@lunn.ch>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Alvin __ipraga" <alsi@bang-olufsen.dk>,
	"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>,
	"Marek Behún" <kabel@kernel.org>
Subject: Re: [PATCH net-next 2/6] software node: allow named software node to be created
Date: Mon, 18 Jul 2022 22:42:29 +0200	[thread overview]
Message-ID: <YtXFtTsf++AeDm1l@lunn.ch> (raw)
In-Reply-To: <YtWwbMucEyO+W8/Y@shell.armlinux.org.uk>

> > Just for my learning, why PHY uses "fixed-link" instead of relying on a
> > (firmware) graph? It might be the actual solution to your problem.
> 
> That's a question for Andrew, but I've tried to solicit his comments on
> several occasions concerning this "feature" of DSA but I keep getting
> no reply. Honestly, I don't know the answer to your question.
> 
> The only thing that I know is that Andrew has been promoting this
> feature where a switch port, whether it be connected to the CPU or
> to another switch, which doesn't specify any link parameters will
> automatically use the fastest "phy interface mode" and the fastest
> link speed that can be supported by the DSA device.

This goes back to the very beginning of DSA, as far as i know. This
was before the times of DT. Platform data was used to describe the
switch tree, and it was pretty minimalist. It just listed the ports of
the switches and their names. The 'cpu' port had the name 'cpu', and
DSA ports either did not have a name, or 'dsa'. I don't
remember. There was also a table describing the routing between
switches in the tree. The platform data had nothing to describe
interface speeds, and i'm not sure phylib was even involved to control
the integrated PHYs. Marvell switches would power up their PHYs in
autoneg mode, meaning they just worked. In order to make the CPU port
work, which did not have a PHY, the driver would configure the CPU
port into its fastest mode. Same for the DSA ports. A Marvell Switch
connected to a Marvell SoC NIC worked.

Sometime later DT became the way to describe ARM boards, and pretty
much all boards with switches were ARM boards. If i remember
correctly, Florian did the first binding, which was basically
translate the platform data straight into DT. Since the platform data
had no way to describe port speed, the DT binding had no way to
describe port speed. It just kept on defaulting to the maximum speed.

The DT world evolved, and DT bindings were produced for phylib.

At some point, DSA got an interface to phylib. Maybe it was there from
the beginning, maybe it was added later. I don't know. As a result,
the DT properties for phylib became valid for switch user ports.

Without looking at git, i'm a bit hazy why fixed-link was introduced
for CPU and DSA ports. At some point in time, i was asked to make a
Marvell switch work with a Freescale FEC. The FEC had a Fast Ethernet,
where as the switch CPU port was 1G. It could be that in order to make
this work, i added fixed-link support to CPU ports, so i could specify
the CPU port speed, rather than use the default which would not work.

At some point, i had a board with an RGMII interface used as a DSA
link between two switches, and i needed to specify the RGMII
delays. It could of been using a fixed-link allowed the phy-mode to be
specified for a DSA port, thus allowing the delays to be specified?

Basically, fixed-phy for CPU and DSA was added to solve a limitation
of the default fastest port speed not always working.

With time, more vendors got behind DSA and switches other than Marvell
were added. There was not much documentation about the expectations of
switch drivers, and i doubt this default maximum speed behaviour of
CPU ports was documented. I probably commented on earlier drivers that
fixed-link could be used, or that the Marvell behaviour could be
copied.

And some devices probably power up ports at their maximum speed,
others can probably be strapped to specific modes. Some drivers
default to maximum speed, others required fixed links to specific the
speed. As Russell says, code inspection is not enough to tell what is
going on.

	Andrew

_______________________________________________
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-18 20:42 UTC|newest]

Thread overview: 168+ 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:00 ` 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   ` 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 16:01   ` Russell King
2022-07-15 19:57   ` Andy Shevchenko
2022-07-15 19:57     ` Andy Shevchenko
2022-07-15 20:17     ` Vladimir Oltean
2022-07-15 20:17       ` Vladimir Oltean
2022-07-15 20:33       ` Andy Shevchenko
2022-07-15 20:33         ` Andy Shevchenko
2022-07-15 20:48         ` Vladimir Oltean
2022-07-15 20:48           ` Vladimir Oltean
2022-07-18 12:29           ` Andy Shevchenko
2022-07-18 12:29             ` Andy Shevchenko
2022-07-18 13:27             ` Russell King (Oracle)
2022-07-18 13:27               ` Russell King (Oracle)
2022-07-18 18:43               ` Andy Shevchenko
2022-07-18 18:43                 ` Andy Shevchenko
2022-07-18 18:53                 ` Andy Shevchenko
2022-07-18 18:53                   ` Andy Shevchenko
2022-07-18 19:14                   ` Russell King (Oracle)
2022-07-18 19:14                     ` Russell King (Oracle)
2022-07-18 19:24                     ` Andy Shevchenko
2022-07-18 19:24                       ` Andy Shevchenko
2022-07-18 20:39                       ` Marek Behún
2022-07-18 20:39                         ` Marek Behún
2022-07-18 20:48                         ` Andy Shevchenko
2022-07-18 20:48                           ` Andy Shevchenko
2022-07-19  7:18                           ` Marek Behún
2022-07-19  7:18                             ` Marek Behún
2022-07-29 12:08                             ` Andy Shevchenko
2022-07-29 12:08                               ` Andy Shevchenko
2022-07-18 19:11                 ` Russell King (Oracle)
2022-07-18 19:11                   ` Russell King (Oracle)
2022-07-18 20:07                   ` Andy Shevchenko
2022-07-18 20:07                     ` Andy Shevchenko
2022-07-18 20:38                     ` Russell King (Oracle)
2022-07-18 20:38                       ` Russell King (Oracle)
2022-07-19  8:50                       ` Sakari Ailus
2022-07-19  8:50                         ` Sakari Ailus
2022-07-20 22:56                         ` Vladimir Oltean
2022-07-20 22:56                           ` Vladimir Oltean
2022-07-22  6:21                           ` Sakari Ailus
2022-07-22  6:21                             ` Sakari Ailus
2022-07-18 20:42                   ` Andrew Lunn [this message]
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 16:01   ` Russell King (Oracle)
2022-07-15 17:24   ` Vladimir Oltean
2022-07-15 17:24     ` Vladimir Oltean
2022-07-15 21:31     ` Russell King (Oracle)
2022-07-15 21:31       ` Russell King (Oracle)
2022-07-15 22:23       ` Vladimir Oltean
2022-07-15 22:23         ` Vladimir Oltean
2022-07-15 22:57         ` Russell King (Oracle)
2022-07-15 22:57           ` Russell King (Oracle)
2022-07-16 10:57           ` Vladimir Oltean
2022-07-16 10:57             ` Vladimir Oltean
2022-07-16 11:13             ` Russell King (Oracle)
2022-07-16 11:13               ` Russell King (Oracle)
2022-07-16 12:36               ` Vladimir Oltean
2022-07-16 12:36                 ` Vladimir Oltean
2022-07-18  8:48                 ` Russell King (Oracle)
2022-07-18  8:48                   ` Russell King (Oracle)
2022-07-20 22:44                   ` Vladimir Oltean
2022-07-20 22:44                     ` Vladimir Oltean
2022-07-21 13:46                     ` Vladimir Oltean
2022-07-21 13:46                       ` Vladimir Oltean
2022-07-21 14:46                       ` Andrew Lunn
2022-07-21 14:46                         ` Andrew Lunn
2022-07-21 14:54                       ` Russell King (Oracle)
2022-07-21 14:54                         ` Russell King (Oracle)
2022-07-21 15:15                         ` Vladimir Oltean
2022-07-21 15:15                           ` Vladimir Oltean
2022-07-21 17:21                           ` Marek Behún
2022-07-21 17:21                             ` Marek Behún
2022-07-21 18:15                             ` Russell King (Oracle)
2022-07-21 18:15                               ` Russell King (Oracle)
2022-07-21 18:22                             ` Vladimir Oltean
2022-07-21 18:22                               ` Vladimir Oltean
2022-07-21 21:14                               ` Russell King (Oracle)
2022-07-21 21:14                                 ` Russell King (Oracle)
2022-07-21 21:36                                 ` Vladimir Oltean
2022-07-21 21:36                                   ` Vladimir Oltean
2022-07-22  8:28                                   ` Russell King (Oracle)
2022-07-22  8:28                                     ` Russell King (Oracle)
2022-07-22 10:52                                     ` Vladimir Oltean
2022-07-22 10:52                                       ` Vladimir Oltean
2022-07-22 11:44                                       ` Russell King (Oracle)
2022-07-22 11:44                                         ` Russell King (Oracle)
2022-07-22 12:14                                         ` Russell King (Oracle)
2022-07-22 12:14                                           ` Russell King (Oracle)
2022-07-22 12:46                                         ` Vladimir Oltean
2022-07-22 12:46                                           ` Vladimir Oltean
2022-07-22 13:16                                           ` Russell King (Oracle)
2022-07-22 13:16                                             ` Russell King (Oracle)
2022-07-22 16:56                                             ` Vladimir Oltean
2022-07-22 16:56                                               ` Vladimir Oltean
2022-07-22 21:20                                               ` Russell King (Oracle)
2022-07-22 21:20                                                 ` Russell King (Oracle)
2022-07-22 21:53                                                 ` Andrew Lunn
2022-07-22 21:53                                                   ` Andrew Lunn
2022-07-22 22:35                                                 ` Andrew Lunn
2022-07-22 22:35                                                   ` Andrew Lunn
2022-07-22 22:39                                                 ` Vladimir Oltean
2022-07-22 22:39                                                   ` Vladimir Oltean
2022-07-23  7:12                                                   ` Russell King (Oracle)
2022-07-23  7:12                                                     ` Russell King (Oracle)
2022-07-23 13:44                                                     ` Vladimir Oltean
2022-07-23 13:44                                                       ` Vladimir Oltean
2022-07-25 10:11                                                       ` Russell King (Oracle)
2022-07-25 10:11                                                         ` Russell King (Oracle)
2022-07-23 17:26                                                   ` Marek Behún
2022-07-23 17:26                                                     ` Marek Behún
2022-07-24 17:39                                                     ` Vladimir Oltean
2022-07-24 17:39                                                       ` Vladimir Oltean
2022-07-22 13:20                                         ` Andrew Lunn
2022-07-22 13:20                                           ` Andrew Lunn
2022-07-22 12:59                               ` Marek Behún
2022-07-22 12:59                                 ` Marek Behún
2022-07-22 13:23                                 ` Russell King (Oracle)
2022-07-22 13:23                                   ` Russell King (Oracle)
2022-07-22 14:19                                   ` Marek Behún
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   ` 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 16:01   ` Russell King (Oracle)
2022-07-15 20:11   ` Andy Shevchenko
2022-07-15 20:11     ` Andy Shevchenko
2022-07-15 21:36     ` Russell King (Oracle)
2022-07-15 21:36       ` Russell King (Oracle)
2022-07-18 18:59       ` Andy Shevchenko
2022-07-18 18:59         ` Andy Shevchenko
2022-07-18 19:13         ` Russell King (Oracle)
2022-07-18 19:13           ` Russell King (Oracle)
2022-07-18 20:08           ` Andy Shevchenko
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 16:01   ` Russell King (Oracle)
2022-07-15 17:17 ` [PATCH net-next 0/6] net: dsa: always use phylink Vladimir Oltean
2022-07-15 17:17   ` Vladimir Oltean
2022-07-15 20:59   ` Russell King (Oracle)
2022-07-15 20:59     ` Russell King (Oracle)
2022-07-15 23:03     ` Jakub Kicinski
2022-07-15 23:03       ` Jakub Kicinski
2022-07-16 11:15       ` Vladimir Oltean
2022-07-16 11:15         ` Vladimir Oltean
2022-07-16 11:43         ` Russell King (Oracle)
2022-07-16 11:43           ` Russell King (Oracle)
2022-07-16 13:13           ` Vladimir Oltean
2022-07-16 13:13             ` Vladimir Oltean
2022-07-18  8:53             ` Russell King (Oracle)
2022-07-18  8:53               ` Russell King (Oracle)
2022-07-18 12:45               ` Vladimir Oltean
2022-07-18 12:45                 ` Vladimir Oltean
2022-07-18 13:02                 ` Russell King (Oracle)
2022-07-18 13:02                   ` Russell King (Oracle)
2022-07-18 14:25                   ` Vladimir Oltean
2022-07-18 14:25                     ` Vladimir Oltean
2022-07-16 23:44         ` Jakub Kicinski
2022-07-16 23:44           ` Jakub Kicinski
2022-07-27  9:00 ` Marek Behún
2022-07-27  9:00   ` Marek Behún
2022-07-27 13:38   ` Vladimir Oltean
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=YtXFtTsf++AeDm1l@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Landen.Chao@mediatek.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsi@bang-olufsen.dk \
    --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=kabel@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.