From patchwork Thu Apr 3 18:18:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 14036976 X-Patchwork-Delegate: kuba@kernel.org Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF214253B5D for ; Thu, 3 Apr 2025 18:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743704376; cv=none; b=eDKCaRc4JFSxLf1IsS06VnuaNCtCa/UJj32HCO5VuNJx/smrHGyu0h9U/ohLVbpAuyj36nqA90PgaWV92ySGSbkUxqOoobEDox+gJwEYNjVBd5t0E4oL81RpLD4nza2KBUMxltwuzO8nfBrvp3uwWYz5BYl8bRAj5VjuVJChJXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743704376; c=relaxed/simple; bh=CeETfnzCyXMG4XEtCWVol8vt14JIrIYsxnGpZ2xl/BE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XQvVbnXl974AbrmOKyh2if9TOHcdQ9A9/Feu8b64WXLJ0Ow2y8GYc/ZNTnr3hRSHiZUQvSEDpdDcNBubz5yzS7lE20BJqjfgRTxo0BiBMiKT4LvJ+Da+7dKg5xFW7j2X7kOWdCi4okMXVUvPkTO51zrklSo/5h9GBXnQZQ85PAA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=WKkRd8EK; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="WKkRd8EK" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1743704372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=phS1BrEwoCpumqFkbhdbyadxm6yPKvRhcIrB5404n+s=; b=WKkRd8EK/ZK1z70/4o0buWubaw2DanWl0mQDuDgBu4DdpeKlWC1opJj9xIcWJpYAZ1+k2J 4X6kSHUUpdzEPwV4F+I4zJsROnEoVLtEqR4xV6Kp2X5q1Jc/+vZWXrocBl9AmS+UjtMlrU qXHgr1idHru7DZYiIwoesMIyK9pthWk= From: Sean Anderson To: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King Cc: linux-kernel@vger.kernel.org, Christian Marangi , upstream@airoha.com, Heiner Kallweit , Vladimir Oltean , Sean Anderson , Alexandre Belloni , Claudiu Manoil , UNGLinuxDriver@microchip.com Subject: [RFC net-next PATCH 04/13] net: dsa: ocelot: suppress PHY device scanning on the internal MDIO bus Date: Thu, 3 Apr 2025 14:18:58 -0400 Message-Id: <20250403181907.1947517-5-sean.anderson@linux.dev> In-Reply-To: <20250403181907.1947517-1-sean.anderson@linux.dev> References: <20250403181907.1947517-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC From: Vladimir Oltean 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 Signed-off-by: Sean Anderson --- 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) {