Message ID | 20230620-feature-c45-over-c22-v3-5-9eb37edf7be0@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1224310vqm; Wed, 12 Jul 2023 08:19:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlF9aJqGQm+y6EZaqy/D3r2g95GcNe15M3dW9YMWGJ/wdR7xStBLMttMGx/4nQ+Ker9YhXF2 X-Received: by 2002:a05:6402:d0:b0:51e:65d:1f6c with SMTP id i16-20020a05640200d000b0051e065d1f6cmr18230885edu.9.1689175187446; Wed, 12 Jul 2023 08:19:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689175187; cv=none; d=google.com; s=arc-20160816; b=GNWoPKODCRT5PeqJNW/o+RMqiJKaxVipsaBKAxgBgVBWSqFaSOYK+1hWfnDpcSxwMp 8r+MxsC3B+NOMXLlh33Ub3rJjfExK30lVIl4/c183JXF+AdxUyQ5eSZLYwRG3HTZS1/W KpiAAsunOt8YPA623FQ9Rx4dfcOvVEo+ETS+N5+7uromUu67NUj7BirTnoXWjfXgY0rp Z2Dwf8/K9QcKfMTb6dTcShtsoWl9SqaNWD5Si0jhWBQbyw2XejNjlReKr610Ic55oKKs rGufEwhRT5ryYj8c8g6Ybgk0KddszjjHVJ2+Gp/OfMWHLNCLUYE76veWX8ezPk3cU09d pYJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=xLiolo3hK9CaN81pgyzdqPsyj0Wk+L/RdY96o/jSCCw=; fh=iCOcDVYygcUt3nx67Q2pFMpkgstG/nFvtDYAC1AAD60=; b=ZpGJD9J1f19SLstfFYRwYFWvGdnjruUQuLIrFrVhLru9y7dFF71+7PVq8gq2PX13D/ ZZSJ0U8VMBURx1W8bRWD097mNnTlz/8lBbIxX1/Dom4iiuhFFm7OmYfPqR6RIaa34OTU kL5V2bkYq2eNO55N7kwoH+/qPjTVuTiBizACyDStQEkkfCuw40DzSVLn+cvdcRp8Gdkx BnbWc/gs/eb6jmD7Z5tq+ow/fNKXMUS1/wRijKM8Ji96Jf9G96nM2+Qop2QFLjSMf2wF 9IvmJoD9vgDhQxIt6fWLNbzJgKeGozzN++CwewzaG/ep0TOt+U8chZWno+G8MaO59Rc4 lIoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DitXThW4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k23-20020aa7d8d7000000b0051debcd957esi5106464eds.351.2023.07.12.08.19.23; Wed, 12 Jul 2023 08:19:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DitXThW4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233346AbjGLPIc (ORCPT <rfc822;gnulinuxfreebsd@gmail.com> + 99 others); Wed, 12 Jul 2023 11:08:32 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <linux-kernel@vger.kernel.org>; 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 <mwalle@kernel.org> 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: 7bit 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 <andrew@lunn.ch>, 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>, Yisen Zhuang <yisen.zhuang@huawei.com>, Salil Mehta <salil.mehta@huawei.com>, Florian Fainelli <florian.fainelli@broadcom.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, =?utf-8?q?Marek_Beh=C3=BAn?= <kabel@kernel.org>, Xu Liang <lxu@maxlinear.com> Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Simon Horman <simon.horman@corigine.com>, Michael Walle <mwalle@kernel.org> X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771228561167536031 X-GMAIL-MSGID: 1771228561167536031 |
Series |
net: phy: C45-over-C22 access
|
|
Commit Message
Michael Walle
July 12, 2023, 3:07 p.m. UTC
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 <mwalle@kernel.org>
---
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(-)
Comments
On Wed, Jul 12, 2023 at 05:07:05PM +0200, Michael Walle wrote: > 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 <mwalle@kernel.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
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; for (i = 0; i < PHY_MAX_ADDR; i++) { - struct phy_device *phydev; u32 oui; phydev = 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);