From patchwork Mon Aug 21 21:53:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 13359860 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 A3D75174C0 for ; Mon, 21 Aug 2023 21:53:53 +0000 (UTC) Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EB60136 for ; Mon, 21 Aug 2023 14:53:52 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-68a410316a2so1031122b3a.0 for ; Mon, 21 Aug 2023 14:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1692654831; x=1693259631; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=wjysI6PxHMvWH5P121rifh6grlowoLDnzauJVWhPpM0=; b=XpU9y8wZ0yChFbJmQSkwmLP0L+kz5druhRg38YdN34E+0Y0vT/ASXl/Mkig4UdRiUI AirbLs/eC6vFOWSYlNSOofJBNy2uYlCsKwSQR0UQnN8zp+rhgIZoq6SQcorXevFANQ9s lI2vAN6Zhi/7Rq0zPzuFB7kjYcyiFWOSHYQy8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692654831; x=1693259631; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wjysI6PxHMvWH5P121rifh6grlowoLDnzauJVWhPpM0=; b=kxGnMCO+eAnodhJJh4JfxKCdtRgMBCF8QucKAuhnjBDO7IPcxZ6AHN1d+Lqg/jAcVH zW/0CVvzebqL62sK8kKwvzJ44sP4fIe65z4qyRaTgr0jUdwTZSQ5JISP9DXM2U9tvl9V eIqmjOnqg6TJculKvpIo7b/zgGuDa3AwRH2pcVxXXDWOwrVVfw8trvZCk5pjoGhCQc9E GApHEe04d+ncpB0X/WJYmypI65404MrziQk8YiPpDhuUkgLn4CCUReadzF2JLFKRp7RL sxTg/Ezudv/YaaWV+6vENDNgG8ycVkXA4rXpAPtY9fiaocJyhqzvFJvdBDRrWLsJwTm1 35AA== X-Gm-Message-State: AOJu0YxwJm/K4lZgP9y0yCcO8jbJmyz6vZBnnQE7LzEpxH5PinNt7zTp 5eefC84VwdXbTwkdEkzOWaJ9UQ== X-Google-Smtp-Source: AGHT+IFF9NQu4s+2wsWcjkY9usJ/s1YOa8+RxH/KvQiBxc/agIr/sKP5Kxc0TbplCHnaWFiECp54Lg== X-Received: by 2002:a05:6a00:234a:b0:689:eed5:609b with SMTP id j10-20020a056a00234a00b00689eed5609bmr6584215pfj.27.1692654831582; Mon, 21 Aug 2023 14:53:51 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d5-20020aa78685000000b00689f8dc26c2sm1698956pfo.133.2023.08.21.14.53.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 14:53:51 -0700 (PDT) From: Florian Fainelli To: stable@vger.kernel.org Cc: Justin Chen , Florian Fainelli , Jakub Kicinski , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org (open list:BROADCOM ETHERNET PHY DRIVERS), linux-kernel@vger.kernel.org (open list), Greg Kroah-Hartman , Sasha Levin Subject: [PATCH stable 4.19] net: phy: broadcom: stub c45 read/write for 54810 Date: Mon, 21 Aug 2023 14:53:47 -0700 Message-Id: <20230821215348.3123487-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <2023082133-mashing-flick-3a50@gregkh> References: <2023082133-mashing-flick-3a50@gregkh> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Justin Chen commit 096516d092d54604d590827d05b1022c8f326639 upstream 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. Fixes: b14995ac2527 ("net: phy: broadcom: Add BCM54810 PHY entry") Signed-off-by: Justin Chen Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/1691901708-28650-1-git-send-email-justin.chen@broadcom.com Signed-off-by: Jakub Kicinski [florian: resolved conflicts in 4.19] Signed-off-by: Florian Fainelli --- 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 94622d119abc..49fb62d02a76 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -421,6 +421,17 @@ static int bcm5482_read_status(struct phy_device *phydev) return err; } +static int bcm54810_read_mmd(struct phy_device *phydev, int devnum, u16 regnum) +{ + return -EOPNOTSUPP; +} + +static int bcm54810_write_mmd(struct phy_device *phydev, int devnum, u16 regnum, + u16 val) +{ + return -EOPNOTSUPP; +} + static int bcm5481_config_aneg(struct phy_device *phydev) { struct device_node *np = phydev->mdio.dev.of_node; @@ -684,6 +695,8 @@ static struct phy_driver broadcom_drivers[] = { .name = "Broadcom BCM54810", .features = PHY_GBIT_FEATURES, .flags = PHY_HAS_INTERRUPT, + .read_mmd = bcm54810_read_mmd, + .write_mmd = bcm54810_write_mmd, .config_init = bcm54xx_config_init, .config_aneg = bcm5481_config_aneg, .ack_interrupt = bcm_phy_ack_intr,