netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@linux.dev>
To: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Russell King <linux@armlinux.org.uk>
Cc: upstream@airoha.com, Christian Marangi <ansuelsmth@gmail.com>,
	linux-kernel@vger.kernel.org,
	Kory Maincent <kory.maincent@bootlin.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Sean Anderson <sean.anderson@linux.dev>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	UNGLinuxDriver@microchip.com
Subject: [net-next PATCH v3 04/11] net: dsa: ocelot: suppress PHY device scanning on the internal MDIO bus
Date: Tue, 15 Apr 2025 15:33:16 -0400	[thread overview]
Message-ID: <20250415193323.2794214-5-sean.anderson@linux.dev> (raw)
In-Reply-To: <20250415193323.2794214-1-sean.anderson@linux.dev>

From: Vladimir Oltean <vladimir.oltean@nxp.com>

This bus contains Lynx PCS devices, and if the lynx-pcs driver ever
decided to call mdio_device_register(), it would fail due to
mdiobus_scan() having created a dummy phydev for the same address
(the PCS responds to standard clause 22 PHY ID registers and can
therefore by autodetected by phylib which thinks it's a PHY).

On the Seville driver, things are a bit more complicated, since bus
creation is handled by mscc_miim_setup() and that is shared with the
dedicated mscc-miim driver. Suppress PHY scanning only for the Seville
internal MDIO bus rather than for the whole mscc-miim driver, since we
know that on NXP T1040, this bus only contains Lynx PCS devices.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
---

(no changes since v1)

 drivers/net/dsa/ocelot/felix_vsc9959.c   | 4 ++++
 drivers/net/dsa/ocelot/seville_vsc9953.c | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index 940f1b71226d..2de12611ab57 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -1001,6 +1001,10 @@ static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot)
 	bus->read_c45 = enetc_mdio_read_c45;
 	bus->write_c45 = enetc_mdio_write_c45;
 	bus->parent = dev;
+	/* Suppress PHY device creation in mdiobus_scan(),
+	 * we have Lynx PCSs
+	 */
+	bus->phy_mask = ~0;
 	mdio_priv = bus->priv;
 	mdio_priv->hw = hw;
 	/* This gets added to imdio_regs, which already maps addresses
diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c
index eb3944ba2a72..28bcdef34a6c 100644
--- a/drivers/net/dsa/ocelot/seville_vsc9953.c
+++ b/drivers/net/dsa/ocelot/seville_vsc9953.c
@@ -901,6 +901,11 @@ static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot)
 		return rc;
 	}
 
+	/* Suppress PHY device creation in mdiobus_scan(),
+	 * we have Lynx PCSs
+	 */
+	bus->phy_mask = ~0;
+
 	/* Needed in order to initialize the bus mutex lock */
 	rc = devm_of_mdiobus_register(dev, bus, NULL);
 	if (rc < 0) {
-- 
2.35.1.1320.gc452695387.dirty


  parent reply	other threads:[~2025-04-15 19:33 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15 19:33 [net-next PATCH v3 00/11] Add PCS core support Sean Anderson
2025-04-15 19:33 ` [net-next PATCH v3 01/11] dt-bindings: net: Add Xilinx PCS Sean Anderson
2025-04-15 19:33 ` [net-next PATCH v3 02/11] net: phylink: Support setting PCS link change callbacks Sean Anderson
2025-04-15 19:33 ` [net-next PATCH v3 03/11] net: pcs: Add subsystem Sean Anderson
2025-04-15 20:02   ` Sean Anderson
2025-04-17  8:35   ` Simon Horman
2025-04-17 14:56     ` Sean Anderson
2025-04-17  9:19   ` Simon Horman
2025-04-17 15:05     ` Sean Anderson
2025-04-18  9:47       ` Simon Horman
2025-04-15 19:33 ` Sean Anderson [this message]
2025-04-15 19:33 ` [net-next PATCH v3 05/11] net: pcs: lynx: Convert to an MDIO driver Sean Anderson
2025-05-06 21:58   ` Vladimir Oltean
2025-05-06 22:03     ` Sean Anderson
2025-05-06 22:18       ` Vladimir Oltean
2025-05-06 22:20         ` Sean Anderson
2025-05-06 22:29           ` Vladimir Oltean
2025-05-06 22:39             ` Sean Anderson
2025-05-07  0:19               ` Andrew Lunn
2025-05-08 15:57                 ` Sean Anderson
2025-05-07 15:04               ` Vladimir Oltean
2025-05-06 23:56         ` Daniel Golle
2025-05-07 14:02           ` Vladimir Oltean
2025-04-15 19:33 ` [net-next PATCH v3 06/11] net: phy: Export some functions Sean Anderson
2025-04-15 19:33 ` [net-next PATCH v3 07/11] net: pcs: Add Xilinx PCS driver Sean Anderson
2025-04-15 19:33 ` [net-next PATCH v3 08/11] net: axienet: Convert to use PCS subsystem Sean Anderson
2025-04-18  9:04   ` Gupta, Suraj
2025-04-15 19:33 ` [net-next PATCH v3 09/11] net: macb: Move most of mac_config to mac_prepare Sean Anderson
2025-04-15 19:35 ` [net-next PATCH v3 10/11] net: macb: Support external PCSs Sean Anderson
2025-04-15 19:35   ` [net-next PATCH v3 11/11] of: property: Add device link support for PCS Sean Anderson
2025-04-17 12:25 ` [net-next PATCH v3 00/11] Add PCS core support Russell King (Oracle)
2025-04-17 14:22   ` Sean Anderson
2025-04-17 15:24     ` Russell King (Oracle)
2025-04-17 15:29       ` Sean Anderson
2025-05-02 17:41         ` Sean Anderson

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=20250415193323.2794214-5-sean.anderson@linux.dev \
    --to=sean.anderson@linux.dev \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=upstream@airoha.com \
    --cc=vladimir.oltean@nxp.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).