From nobody Fri Jul 24 22:54:57 2026 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E027257824 for ; Wed, 22 Jul 2026 13:19:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784726400; cv=none; b=Y03bYUqiEnvIISSjbQYoVwDSd35AW1RdiHPGgpMuEX/sQ3ytE94ZUObE76pTS6N1KLF/p4V3fiM8exduK1ESqo3ilaNsEM0eVWKz9BJdMHX2TW3c8zivl4TaqB39COa4kNvp13s7MWMAMMy0Q5wplFpEvlGZkggdZ09MjSe+hR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784726400; c=relaxed/simple; bh=BqjtnbOXG4Fh7SFEObLdm4QiDsMOAdXbHDJBsl4pjd0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=SmAE2GI+BIiem5ePA62fo41DWAv9egEz9eorF2Yuh4KUCW4/wF6+CZ5psi2FGgjPz/UrG2cYh2rsKwuzY0UKakbmFi/TPvaj6rpyNqqBfg5MYX1SXTOKqSu1Ezc8wQSBeXwGRfd4QZxoSsKacEkU0tduHmbYhhw42l3kJ9ETams= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TQI/c251; arc=none smtp.client-ip=209.85.215.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TQI/c251" Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-c998fd549a8so8289289a12.2 for ; Wed, 22 Jul 2026 06:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784726398; x=1785331198; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=YkleSo/mHT7B7/DelUTKo1SDFA3O4GZirFnblobGSyk=; b=TQI/c251tn0BVfrClJ8asm5qWDTE4YfgtA+VeR5TC92UsapdSmHoxjHxXwgLoqNtAm Jk/y2s210YqOhfv3t2DrvQ+4QhwRdrcIkROC1r+05TnYLDmKFzDwXpy4f5CkV7QvUsGa tIdnOyIxLMfBUscdA0grM2+RdExYFnvjyFnnnl8rB3STnMG3Q232SFu5mQlpxFjVq1Wf virjuvcigRzFIozNlJJFZqIIQ6L1nevB1CaGSXp3WWhFIWT3Hul+I0SJuUOrtkAWPElo Ncj107c0yvyryRV0CL4Np0W37uVE2KBbu2nZHUy6ukMqpieEu1sHnganQCHNbCO2mCEn FWZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784726398; x=1785331198; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=YkleSo/mHT7B7/DelUTKo1SDFA3O4GZirFnblobGSyk=; b=S/BVo+qD5QcveC7PmdA6SFmaKb+t6hzPAp0frLtfcRJNn3ICTtfP/C9GrJeEk+9KSj LwmgUrPBSEoLmrAWIq5W2HqOa1rRDz0462P8bLlacuy6RJhWI+DAgCclq39qYsYXpEUw tMijg7Z0yclGd42vaHmXpJEdnGNwKQT0RpPy2+3OY94J+RLEpRaLfEBymlNeRiDbzEjf wOugTqWseP9lm0xzVovTb84msBKwPoV8VnSBF1hQFKZE72XTyF/iEqvjb38Uz80mj0/V aUKqEa/KL8yaY6tynl4vJzicGIvD6ItMkFwG4RGv/8f/J+d0awxDGZFDcpJMUUJ4OARV uIMw== X-Forwarded-Encrypted: i=1; AHgh+RpWTL1nTse+zI0riFD+KtBk9Upda4PpGVdVnsiXS//8GITZIcLq5IeK7WPu97hGxJo4X51cWB3NXTJSnL4=@vger.kernel.org X-Gm-Message-State: AOJu0YybRmiWVM6B4BidrFOh4G8xLUZJ5xY/wJAeRtIDO1aJSrHQYLPL mBgU1Nb8y4twnKP7SdBarAVwbPOZbfnHRxd6b5/bwv15yHn863qZ7fzz X-Gm-Gg: AR+sD13TvaXA1KyP5ixn6tsMw0OzS/5nqkrxzbc9D+KKww6A97WO63jlEtRJ817Wcet TEWxEGOfKBA5v6jNyWj8UMXUGcfikGLRqenW5Z+zsHlwZPm8Fjt50C7KXmJFFiiFkf6y07EOuFP vJUB408U8KvW8Pti4fibaNnbVYFo8D2m5VthLMGEtNVNTt7z0RoUiH0M2Oxe1eaHT73HgVPE3Dk hOWtGNv0yJsrglQ/TcRssjygCQRPTzGm+g00jYD9z4IFIWUY8XYAhzIJ9EwsZ/hIrDL+vtqtfgJ 5c2Zpbbu5uCgKVGQXI/whjeTh6XEujLrC4MRJSBH2H11mGoIzf7e23gJm2qbtmC9z4sS7/6v4ih UogX2GsyqH7Y8cYGHnlAg2/nD0dJTmCSppWTyPbi/BBDAJHhITu/d+frBUZVT8G4a57eGQF5gzm eL X-Received: by 2002:a05:6a21:6110:b0:3c3:a140:938a with SMTP id adf61e73a8af0-3c3ad947db0mr26030102637.45.1784726397859; Wed, 22 Jul 2026 06:19:57 -0700 (PDT) Received: from server227.. ([39.170.101.209]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbb8f18ba96sm1112292a12.17.2026.07.22.06.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 06:19:57 -0700 (PDT) From: Zxyan Zhu To: netdev@vger.kernel.org Cc: Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Russell King , Russell King , Maxime Chevallier , Serge Semin , Romain Gantois , Hariprasad Kelam , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Zxyan Zhu Subject: [PATCH net] net: stmmac: Skip PHY attach if custom PCS is in use Date: Wed, 22 Jul 2026 21:19:18 +0800 Message-Id: <20260722131918.685761-1-zxyan0222@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When a platform provides a custom PCS via the pcs_init callback (e.g., for USXGMII with in-band autoneg), the MAC's phylink_pcs is already configured. In this case, phylink validates against the PCS's supported interfaces and manages link state through the PCS, so no traditional PHY device is needed. Without this, stmmac_init_phy() falls through to the no-phy-node path and errors out with "no phy found" when the DT has no phy-handle for such interfaces. Skip the PHY attach when priv->hw->phylink_pcs is already set and no phy-handle is specified in the device tree, allowing platform PCS implementations to handle the link autonomously. Fixes: f0ef433fc264 ("net: stmmac: introduce pcs_init/pcs_exit stmmac opera= tions") Signed-off-by: Zxyan Zhu --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 2a0d7eff88d3..54c5281e91ab 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1346,6 +1346,10 @@ static int stmmac_init_phy(struct net_device *dev) int addr =3D priv->plat->phy_addr; struct phy_device *phydev; =20 + /* If a custom PCS is in use, no PHY is needed */ + if (priv->hw->phylink_pcs) + return 0; + if (addr < 0) { netdev_err(priv->dev, "no phy found\n"); return -ENODEV; --=20 2.34.1