From patchwork Mon Aug 21 21:53:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 13359859 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 46A52F9C1 for ; Mon, 21 Aug 2023 21:53:28 +0000 (UTC) Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B76212C for ; Mon, 21 Aug 2023 14:53:28 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-34ca63f6a27so5776425ab.1 for ; Mon, 21 Aug 2023 14:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1692654807; x=1693259607; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=qXVAQIvrv30RDvcKRMC1mntnxC3x7WkkRQee31MFYmI=; b=YwEM4S0Z/u6bVgnZSrjk77UE39pT36BCtRw/C+aEKIOsHHE0ma9aGa7usdiVDNBset 4DVIghB7U9oQfjQF6FDzj48nR3GJBq4C3h3iw6rYeh8vO46KbGg/qwOLCKMlrZqrY9e8 VmrFVsl3DWJ9A3HsaxzRxwhBqEXUh0xx36Y1s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692654807; x=1693259607; 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=qXVAQIvrv30RDvcKRMC1mntnxC3x7WkkRQee31MFYmI=; b=BTm28SJB643KQkd+r/KPadaHu6KTtWrTVXdVzrCjGxrdxFmqc+6mt513GgFNrDdRQ6 Nw6Z7o00PYTjP3Cg2UlujVzEMMQ3wS4blvHYWSiD2V3syhW/2bHy/eBgLp04g3KWVHdp apl/A5SXAFMDkm7gsQce0Vzr/pN2FSfCTvZaC1nsNQU1dQF6tZIP7JHH2WryX7Vq6luA u6AgPGVvX7aAY9bxAmMBBIvPxPGDpIN6OFYw0x2gcpY/Dwd0NEwp184DGAFZ8w8WL97a Goh3zFkZ7NA6Jzu1eG4/AxOgPdOGWYiPK13n02JrcmUIyB+jyB7NPlGkIOBWtO0BxqZa fMpQ== X-Gm-Message-State: AOJu0YwUGaxfioy1al15QnABAOjZsyGlA3ks6LWfjXB7xQVhDimE9M7E YmiOR0s+mnEkjPDNVS0Vfzuf5A== X-Google-Smtp-Source: AGHT+IGiGz7KVWEg1gJBb/4veXGzvQeHA4fqyh3mVZDiGDeVSQRusmru50bBxp+OQMgHiXBk9jKzcA== X-Received: by 2002:a05:6e02:190d:b0:346:1185:31d0 with SMTP id w13-20020a056e02190d00b00346118531d0mr10905783ilu.9.1692654807388; Mon, 21 Aug 2023 14:53:27 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d2-20020a639902000000b00564b313d526sm6744406pge.54.2023.08.21.14.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 14:53:26 -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 5.4] net: phy: broadcom: stub c45 read/write for 54810 Date: Mon, 21 Aug 2023 14:53:18 -0700 Message-Id: <20230821215318.3123426-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <2023082132-jaundice-applaud-eb72@gregkh> References: <2023082132-jaundice-applaud-eb72@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 5.4] 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 7be75a611e9e..0e0bcc304d6c 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -425,6 +425,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; @@ -696,6 +707,8 @@ static struct phy_driver broadcom_drivers[] = { .phy_id_mask = 0xfffffff0, .name = "Broadcom BCM54810", /* PHY_GBIT_FEATURES */ + .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,