From patchwork Fri Aug 11 23:29:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 13351562 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 9ABC5329D4 for ; Fri, 11 Aug 2023 23:29:46 +0000 (UTC) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8BACE7E for ; Fri, 11 Aug 2023 16:29:45 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-76cd8dab98fso183610185a.3 for ; Fri, 11 Aug 2023 16:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1691796584; x=1692401384; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=14FaDx2lxrVQbK0ePbUxIJ1fwCau/dKesf6StdKURQs=; b=Y6VcCl5ksnFL0l+l8Ty3pt9iguTbHMNJHoJ0TxbqzEoPDKgs6tR46bBT1AkyM6mxDs sA6NNS9hST5JdPTLy6oXmtgBlyEhaLH/2XJHVnaB8nce2B2VQiRIqxhbb1wgAxSJ3zV1 42LGOyWSPQM6xz9tWS0edzXojEPfQy2u0iw1Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691796584; x=1692401384; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=14FaDx2lxrVQbK0ePbUxIJ1fwCau/dKesf6StdKURQs=; b=WvwJxGwLSaQxs9BQTfYVE381ce7BOI5I5PLayg4Teu/aUh/UukNVDhVeQ44pnFaJQO MAatd4BK7zwOVt92YGZfzSEM7uthBl+DGBrM+aU7hkPwiEkCaEBdP870WYusNBs0OV/P Cl/VoPWyV7wuOk3DqtIg9gvodCYcfXvnfFCahITYjXg4DsgPyDBqdIB+EtvKbY2wsTXL c/AsE6am15bwvvLm+dQqgRPl276lFhLitfay2ULOZwCQpLxBB4ZXlOZpR8aPBmbEYQ+z arQ7OjRm0U/VtYNmVgvEJW0PTjgaOiN4SUQ4KT/rJ/+oKClq1u5u9Sywyk3GEAxAUr9P IF2Q== X-Gm-Message-State: AOJu0Yw79SnGAoLWNoSKr5L2FcUZ3m9eF2SYhKiEcQv8QOYNw21MCEE/ XTbBLs//DRcpTtS+LNwNcUm/qHy4Vxv5E0bdU3rR5OTSRcQI9VmfI7owSL2/qM2ZDGfSnlBBTau ZX/qjDrp4Tqcn+vFB/9EEW+UkaLwr8l/LPJLog8IEdpBRzLh3Q9xnhGOO4/w5M/LGGwmrEGr56L zNW08= X-Google-Smtp-Source: AGHT+IH+peg8dwQozEn1WRLdUGodS3Qcc6HfAOxR0ZUFBRrzSH7bSNtMogjRosRrLFgEEDopdqmbOw== X-Received: by 2002:a05:620a:4593:b0:768:f02:532e with SMTP id bp19-20020a05620a459300b007680f02532emr4274907qkb.39.1691796584559; Fri, 11 Aug 2023 16:29:44 -0700 (PDT) Received: from stbirv-lnx-2.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id u2-20020ae9c002000000b00767c961eb47sm1495927qkk.43.2023.08.11.16.29.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Aug 2023 16:29:43 -0700 (PDT) From: Justin Chen To: netdev@vger.kernel.org Cc: Justin Chen , Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] net: phy: broadcom: stub c45 read/write for 54810 Date: Fri, 11 Aug 2023 16:29:37 -0700 Message-Id: <1691796578-846-1-git-send-email-justin.chen@broadcom.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, MIME_HEADER_CTYPE_ONLY,MIME_NO_TEXT,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_TVD_MIME_NO_HEADERS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-Patchwork-Delegate: kuba@kernel.org The 54810 does not support c45. The mmd_phy_indirect accesses return arbirtary values leading to odd behavior like saying it supports EEE when it doesn't. We also see that reading/writing these non-existent MMD registers leads to phy instability in some cases. Signed-off-by: Justin Chen --- drivers/net/phy/broadcom.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 59cae0d808aa..8cc39427ce78 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -542,6 +542,17 @@ static int bcm54xx_resume(struct phy_device *phydev) return bcm54xx_config_init(phydev); } +static int bcm54810_read_mmd(struct phy_device *phydev, int devnum, u16 regnum) +{ + return -EINVAL; +} + +static int bcm54810_write_mmd(struct phy_device *phydev, int devnum, u16 regnum, + u16 val) +{ + return -EINVAL; +} + static int bcm54811_config_init(struct phy_device *phydev) { int err, reg; @@ -1103,6 +1114,8 @@ static struct phy_driver broadcom_drivers[] = { .get_strings = bcm_phy_get_strings, .get_stats = bcm54xx_get_stats, .probe = bcm54xx_phy_probe, + .read_mmd = bcm54810_read_mmd, + .write_mmd = bcm54810_write_mmd, .config_init = bcm54xx_config_init, .config_aneg = bcm5481_config_aneg, .config_intr = bcm_phy_config_intr,