From patchwork Fri Jun 23 10:29:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 13290308 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 033D88F62 for ; Fri, 23 Jun 2023 10:29:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46DF5C433CC; Fri, 23 Jun 2023 10:29:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687516182; bh=1muRLOb59+kQ7ZeXLBMZWXmkOisk9F6Bf+D/rqGDwuY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Fg6wduN550kCKQZAgcUK+qaSxIyBJvy3NpfG7LFBjHOeAxveVY2qfyTrz2SYTMYok V9yn8w0v64hHHiyJx+/fThXbsPsHutp/n8hsSi5SMYEIjOGK7w/qZFfzbMtzBX1iTE 29nL8rlcN2obNqdLHbi5OzZRLRIie1wjFJqC7qN6U6kVIaOy/hCRiEk6wu2b0fePP7 D/kwRdTlPoDZ+t4LzMymI/5K5LWgCcR0jpt/8U5pI7RJI2Y89s57LurgxGWmq0bYYx G/weE/QDJSfjzcCEDCxb815JI2ABvpdqcRO+qIXgrxyLIBUbxw8rXN2aqyO4nBjcnF WHOJX1er4qZUg== From: Michael Walle Date: Fri, 23 Jun 2023 12:29:15 +0200 Subject: [PATCH net-next v2 06/10] net: phy: print an info if a broken C45 bus is found Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230620-feature-c45-over-c22-v2-6-def0ab9ccee2@kernel.org> References: <20230620-feature-c45-over-c22-v2-0-def0ab9ccee2@kernel.org> In-Reply-To: <20230620-feature-c45-over-c22-v2-0-def0ab9ccee2@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, Michael Walle X-Mailer: b4 0.12.2 X-Patchwork-Delegate: kuba@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 --- I wasn't sure if this should be phydev_dbg() or phydev_info(). I mainly see this as an info to a user why some PHYs might not be probed (or c45-over-c22 is used later). --- 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 00b25f6803bc..38529add6420 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 (bus->prevent_c45_access) + dev_info(&bus->dev, + "Detected broken PHY (ID %08lx). Disabling C45 bus transactions.\n", + (unsigned long)phydev->phy_id); } /**