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: 112064 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5689736vqr; Fri, 23 Jun 2023 04:12:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7REi89xdjbDtX570jcLrhKGkfdZU1so8ByY91XTNOwEVcV+A64wR7HSNFqiWLCNJL1R29T X-Received: by 2002:a05:6a20:8f0b:b0:107:1805:feea with SMTP id b11-20020a056a208f0b00b001071805feeamr28004356pzk.37.1687518726697; Fri, 23 Jun 2023 04:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687518726; cv=none; d=google.com; s=arc-20160816; b=0MpeyamzbVWncpVboBs/oCpFr0ydKE8r/NHLLpyv64LBSq02XTO9D0NgwYDrDUUrv7 a2Gv81zbS0dlfqvjq9LcgVyFBi0dUlvtnaGsYfSlpIMzhxkdl6jJ5Wdn+PP2blsUOKR+ NZ25jMeWY40IL80iMT1i5JlKdIzL3xbVnXsasIwt9c/4wq705x/a/K9uNrp4lsjmvCcx uY0rUj0WUqkkq4nbpDdbfNQ0fLmpU6hLZrSByA5aMStJs8y1wjf7UTpZ8+Jfhek4TWkJ YbEayFwpJogKMEcpiFiQPnOCRNR2hNhm3ttWTtHsGNtB+g+iWP+ZeUv7MlbFz1MW3OWc qtjA== 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=aKdR3QPmyq7+6EljlQ451QSp3/scHw5pWGCh06IzL+Q=; b=I8sGbjrP2+Snxt/IgZHhPQx0u2xsca0HdT55Q4dLV66VEJ6tRiwVPp3sNKZKxjCz8o Fp1Fi2poWuSM8kzxMbCdNSDGsjKNwmDvQRXoqX8JkluEWftD6tP3I6HjySW8kxpQWHJo RPrgwoUHu4nA8lKG6GoWo+p9DodgUzsi4bl1Bpf0hlb0Dx0TAIGn5KSUP+F/k7LYF74J q/IZvH3nsDx9BUIeVGxGLx52Ue1TTR8KZM6pZrIzOq6rG7vWqK86hvvA5bSepe71R3kS poJOhloL4camq+Xgh9wL1ZJhlVvoWHGrJ7rvzWjJbJ88pCdpWr5ULYvjfH8/exOFNAJe 1gaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fg6wduN5; 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 17-20020a630011000000b0053eef60f940si8360409pga.765.2023.06.23.04.11.45; Fri, 23 Jun 2023 04:12:06 -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=Fg6wduN5; 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 S232266AbjFWKaX (ORCPT + 99 others); Fri, 23 Jun 2023 06:30:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232276AbjFWK34 (ORCPT ); Fri, 23 Jun 2023 06:29:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E7BF1BCA for ; Fri, 23 Jun 2023 03:29:43 -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 1351F61A18 for ; Fri, 23 Jun 2023 10:29:43 +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 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-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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769491636843657104?= X-GMAIL-MSGID: =?utf-8?q?1769491636843657104?= 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); } /**