From nobody Sun Sep 14 14:48:45 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99A48EB64DA for ; Wed, 12 Jul 2023 15:08:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233085AbjGLPIe (ORCPT ); Wed, 12 Jul 2023 11:08:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233385AbjGLPH5 (ORCPT ); Wed, 12 Jul 2023 11:07:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E41A170E for ; Wed, 12 Jul 2023 08:07:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A040D61868 for ; Wed, 12 Jul 2023 15:07:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0F1DC4167D; Wed, 12 Jul 2023 15:07:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689174469; bh=ddCdu6WVsdWVFfvgBcdVDn3T10QccxGUylRsenvX6jw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DitXThW4uKEoasdiRZYLAtA3p/W5TdLyOjeCnsFgj2M9B+fz/1FI2yRX3Xhy1XUgn SrY3Grn+AHRk5+lLLXQ1FJ0p5rS4rMSdw7ZlPaDAa5/gwJbyZ89iNebI/WpHMrR9rw 5FmgNySVn+xjePRk5RwCoIhGL3rNlYrkBoeq4TJ6K5+bv2EaTBvEXL3gHQGy/fFPn7 Gp6lLVEoDFO1S7Q1lQe6L/5ojU0Gug/9M5QLIViSJJ1yd7h5vM5+/jbZor4zFHBrU+ cqFJZ0CBJZfqlhJnpHCmGLGvv2hAqIOuzZdD7tFqzurw3Qd+L2z4LFHAmBGk9QXlKl PJcul75F7D8oQ== From: Michael Walle Date: Wed, 12 Jul 2023 17:07:05 +0200 Subject: [PATCH net-next v3 05/11] net: phy: print an info if a broken C45 bus is found MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230620-feature-c45-over-c22-v3-5-9eb37edf7be0@kernel.org> References: <20230620-feature-c45-over-c22-v3-0-9eb37edf7be0@kernel.org> In-Reply-To: <20230620-feature-c45-over-c22-v3-0-9eb37edf7be0@kernel.org> To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yisen Zhuang , Salil Mehta , Florian Fainelli , Broadcom internal kernel review list , =?utf-8?q?Marek_Beh=C3=BAn?= , Xu Liang Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Simon Horman , Michael Walle X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If there is an PHY which gets confused by C45 transactions on the MDIO bus, print an info together with the PHY identifier of the offending one. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn --- v3: - make it a dev_dbg() - check is phydev is not null --- drivers/net/phy/mdio_bus.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 29ad9302fe11..bdc178671234 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -617,10 +617,10 @@ static int mdiobus_scan_bus_c45(struct mii_bus *bus) */ void mdiobus_scan_for_broken_c45_access(struct mii_bus *bus) { + struct phy_device *phydev; int i; =20 for (i =3D 0; i < PHY_MAX_ADDR; i++) { - struct phy_device *phydev; u32 oui; =20 phydev =3D mdiobus_get_phy(bus, i); @@ -633,6 +633,11 @@ void mdiobus_scan_for_broken_c45_access(struct mii_bus= *bus) break; } } + + if (phydev && bus->prevent_c45_access) + dev_dbg(&bus->dev, + "Detected broken PHY (ID %08lx). Disabling C45 bus transactions.\n", + (unsigned long)phydev->phy_id); } EXPORT_SYMBOL_GPL(mdiobus_scan_for_broken_c45_access); =20 --=20 2.39.2