netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Klaus Kudielka <klaus.kudielka@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Michael Walle <michael@walle.cc>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Felix Fietkau <nbd@nbd.name>, John Crispin <john@phrozen.org>,
	Sean Wang <sean.wang@mediatek.com>,
	Mark Lee <Mark-MC.Lee@mediatek.com>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Bryan Whitehead <bryan.whitehead@microchip.com>,
	UNGLinuxDriver@microchip.com,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-aspeed@lists.ozlabs.org,
	Jesse Brandeburg <jesse.brandeburg@intel.com>
Subject: Re: [PATCH net-next v2 4/6] net: mdio: scan bus based on bus capabilities for C22 and C45
Date: Sat, 11 Mar 2023 17:11:08 +0100	[thread overview]
Message-ID: <2f64385a350359c5755eb4d2479e2efef7a96216.camel@gmail.com> (raw)
In-Reply-To: <a57a216d-ff5a-46e6-9780-e53772dcefc8@lunn.ch>

On Sat, 2023-03-11 at 16:39 +0100, Andrew Lunn wrote:
> 
> I have one more idea which can speed things up. The scanning of the
> MDIO bus works in two different ways depending on if there is a DT
> node, describing what should be found on the bus. For mv88e6xxx, using
> DT is optional. Some boards do, some don't.
> 
> If there is a DT node, only the addresses listed in DT are scanned.

Here's the definition of the switch in the Turris Omnia device tree.

	/* Switch MV88E6176 at address 0x10 */
	switch@10 {
		pinctrl-names = "default";
		pinctrl-0 = <&swint_pins>;
		compatible = "marvell,mv88e6085";
		#address-cells = <1>;
		#size-cells = <0>;

		dsa,member = <0 0>;
		reg = <0x10>;

		interrupt-parent = <&gpio1>;
		interrupts = <13 IRQ_TYPE_LEVEL_LOW>;

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			ports@0 {
				reg = <0>;
				label = "lan0";
			};

			ports@1 {
				reg = <1>;
				label = "lan1";
			};

			ports@2 {
				reg = <2>;
				label = "lan2";
			};

			ports@3 {
				reg = <3>;
				label = "lan3";
			};

			ports@4 {
				reg = <4>;
				label = "lan4";
			};

			ports@5 {
				reg = <5>;
				label = "cpu";
				ethernet = <&eth1>;
				phy-mode = "rgmii-id";

				fixed-link {
					speed = <1000>;
					full-duplex;
				};
			};

			ports@6 {
				reg = <6>;
				label = "cpu";
				ethernet = <&eth0>;
				phy-mode = "rgmii-id";

				fixed-link {
					speed = <1000>;
					full-duplex;
				};
			};
		};

> 
> If there is no DT node, by default, all 32 addresses on the bus are
> scanned. However, DSA makes another assumption. There is a one to one
> mapping between port number and PHY address on the MDIO bus. Port 0
> uses MDIO address 0. Port 7 uses MDIO address 7 etc. If you have an 8
> port switch, there is no point scanning addresses 8 to 31, they will
> never be used.
> 
> The mdio bus structure has a member phy_mask. This is a bitmap. If bit
> N is set, address N is not scanned. So i suggest you extend
> mv88e6xxx_mdio_register() to set phy_mask based on
> mv88e6xxx_num_ports(chip).
> 

What you are proposing here would not show any improvement on the
Omnia, as only the 6 ports would be scanned - right? 

>         Andrew


  reply	other threads:[~2023-03-11 16:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 10:01 [PATCH net-next v2 0/6] net: phy: Remove probe_capabilities Michael Walle
2023-01-18 10:01 ` [PATCH net-next v2 1/6] net: mdio: Move mdiobus_scan() within file Michael Walle
2023-01-18 10:01 ` [PATCH net-next v2 2/6] net: mdio: Rework scanning of bus ready for quirks Michael Walle
2023-01-18 10:01 ` [PATCH net-next v2 3/6] net: mdio: Add workaround for Micrel PHYs which are not C45 compatible Michael Walle
2023-01-18 10:01 ` [PATCH net-next v2 4/6] net: mdio: scan bus based on bus capabilities for C22 and C45 Michael Walle
2023-03-05 18:13   ` Klaus Kudielka
2023-03-05 18:35     ` Andrew Lunn
2023-03-06 18:40       ` Klaus Kudielka
2023-03-06 19:02         ` Andrew Lunn
2023-03-07 19:48           ` Klaus Kudielka
2023-03-07 20:35             ` Andrew Lunn
2023-03-08 18:34               ` Klaus Kudielka
2023-03-09 16:36                 ` Andrew Lunn
2023-03-10 20:22                   ` Klaus Kudielka
2023-03-10 23:49                     ` Andrew Lunn
2023-03-11  6:49                       ` Klaus Kudielka
2023-03-11 15:39                         ` Andrew Lunn
2023-03-11 16:11                           ` Klaus Kudielka [this message]
2023-03-11 17:32                             ` Klaus Kudielka
2023-03-11 17:57                               ` Andrew Lunn
2023-03-12  2:53                             ` Andrew Lunn
2023-03-12  9:04                               ` Klaus Kudielka
2023-03-12 15:15                                 ` Klaus Kudielka
2023-03-12 23:57                                   ` Andrew Lunn
2023-01-18 10:01 ` [PATCH net-next v2 5/6] net: phy: Decide on C45 capabilities based on presence of method Michael Walle
2023-01-18 10:01 ` [PATCH net-next v2 6/6] net: phy: Remove probe_capabilities Michael Walle
2023-01-19  5:02   ` Andrew Jeffery
2023-01-19 15:30 ` [PATCH net-next v2 0/6] " patchwork-bot+netdevbpf

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=2f64385a350359c5755eb4d2479e2efef7a96216.camel@gmail.com \
    --to=klaus.kudielka@gmail.com \
    --cc=Mark-MC.Lee@mediatek.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@aj.id.au \
    --cc=andrew@lunn.ch \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=joabreu@synopsys.com \
    --cc=joel@jms.id.au \
    --cc=john@phrozen.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=michael@walle.cc \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=sean.wang@mediatek.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).