From patchwork Mon Aug 21 21:54:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 13359861 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 E5B1312B6D for ; Mon, 21 Aug 2023 21:54:17 +0000 (UTC) Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAEF9132 for ; Mon, 21 Aug 2023 14:54:14 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1bf55a81eeaso13009195ad.0 for ; Mon, 21 Aug 2023 14:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1692654854; x=1693259654; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=6DTVIyEHZe6SD1UimK8k8D0JPmC/pZgkgR0AvAu/7+0=; b=M8p+98CFhqF+zD3mxd4Ui1R8CgKQcmtcSqviUjEhBLad3fx3a00zoCObqQo9PSEvhe w0GeQaATB5yizzr6LJxEXCclogd9hev+GhmHEf4TwEV/v/YvXZUSuX9AatFIi2UqDMdl 9LoB9M3ubEmr98NRbhkqrDLB49LMPt5Lkbgs8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692654854; x=1693259654; 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=6DTVIyEHZe6SD1UimK8k8D0JPmC/pZgkgR0AvAu/7+0=; b=XFAc8EoBVPD6EH7TLaKZK8aPGD0TKjGGT+9y0kFMqAVir943IkOzmb6n2sKjQv5oGG F5vvoTX9zgEuITQffNn/xoHQfA0GBKgVAzYTbTOGa2yJH77e6DJzk+FSzDGwMtLyNBpP kOTUQJuWcqWbh+Mr0hBEdKOk1Eyx4p5wPuZeuV+5lAkRL1qQ0ybE4tShQP58tDsxl85Q qMg6hkuqy3TfGgkfmy3Ii6q2Q7fNgZ1Y0JzwLRGjru8PnrwQeWoAjmJyYZTzzICkWcBN IjT5F1SpeJIedw/HkTG0Nl/xF8c+7de5Okfs3cLd7TjxwCnrWCiYa3/95+oicHMO48dj OyNw== X-Gm-Message-State: AOJu0YyrxIwRgRB8hTpznQQ5POEwb/L2C0BD7oQNm2lqe9oUKB48sEso EeYtKpOcIoUCzuccbfoGMS5AKw== X-Google-Smtp-Source: AGHT+IHh9ty2CycuUXpwEMLBU6aXGOZVQkATtihtpRrC5tv87ckbu2bHDsjEx/325B+xJRlVLd7iRw== X-Received: by 2002:a17:903:278f:b0:1b8:c1f:fcfc with SMTP id jw15-20020a170903278f00b001b80c1ffcfcmr4911565plb.11.1692654854316; Mon, 21 Aug 2023 14:54:14 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id t24-20020a1709028c9800b001bb1f0605b2sm7487455plo.214.2023.08.21.14.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 14:54:13 -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.14] net: phy: broadcom: stub c45 read/write for 54810 Date: Mon, 21 Aug 2023 14:54:10 -0700 Message-Id: <20230821215410.3123513-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <2023082134-chain-tubular-c681@gregkh> References: <2023082134-chain-tubular-c681@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.14] 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 97e017a54eb5..2fbb1277b3a8 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -403,6 +403,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; @@ -650,6 +661,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, .read_status = genphy_read_status,