From patchwork Sun Aug 13 04:41:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 13351987 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 E4699A23 for ; Sun, 13 Aug 2023 04:42:04 +0000 (UTC) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 639EE1709 for ; Sat, 12 Aug 2023 21:42:03 -0700 (PDT) Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-76ca7b4782cso228909085a.0 for ; Sat, 12 Aug 2023 21:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1691901722; x=1692506522; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vThqxdtrFyXZNH64bCTnIB8AdRfkix31zkG4fq7FEWI=; b=EuokeROOrGibIIJ6pl3/RKwqQEajlQqC1+9FNqTeiXLNTVZd9amOC8Fuz66HpN1rQ/ hcujkeCO4xToCQQY/fgtNxVgIeCv4AvKW/qXGTcTBE8wBI4sGeYdauDu1jLk2nWVPZzK uvDivwVPKrlq1Mp3vjUoUgDtfp5o8/OewSMDk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691901722; x=1692506522; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vThqxdtrFyXZNH64bCTnIB8AdRfkix31zkG4fq7FEWI=; b=Wl5ljOAHApnOvygCuWn5q8oT07L+wlEHqL8YN1vm9RCotKV92T18SwpPeU0QN4FTR8 aXJa4E8eTCJ0kpxIsG2qu+fNLznU++ZwORDBpy/y1r0xeIzDWmUejlf9ZhJW0BW6uEej JhVhgSuR3P8x/E/bDNBjTWuX9v+uTUE61AP6qP3bolht2GNECcLusBw2tASfQaeYSwLY 23OPwwASsojoYhCGbZ+HL8HhJUZLQFs3tB9fYqfc7gd+8ZkX6ueQEUTJWPz1UZZOqrUK 1juN0kFNFSrjw7leIAuW3iw0myVxw4EKAfJAphsZrp6r8GdssvruHi5oEgzAcz22v+Z0 4QNg== X-Gm-Message-State: AOJu0YyZXxtX8IoHIBg3Aj//Bhks4jxaCvwy/to8XhSExhJFDbjxFzCB 1UygRo8oPkhDDl5h3/dSj1zgyIK88Jo/bU/CE08X+69zQA2nbHf9mO5ZlPpFu8ubsD3LBg3NLD8 MWtL4CGgyYiWDiSM6RSP1X2QFxBAZSHDxYeoBzEe5d8TSakCRYXKzbF3XmJxvH7aA15bKx4aO1j 9hYnc= X-Google-Smtp-Source: AGHT+IHJNeSy+sWDRu82QajioXgXacKcRXtdab5UViijkp74okr5b9B0OfqVjv3ddfYvaW/h5V8S0w== X-Received: by 2002:a05:620a:1aa5:b0:76c:caa5:4c1d with SMTP id bl37-20020a05620a1aa500b0076ccaa54c1dmr7931584qkb.26.1691901722173; Sat, 12 Aug 2023 21:42:02 -0700 (PDT) Received: from stbirv-lnx-2.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id ou8-20020a05620a620800b00767dc4c539bsm2190661qkn.44.2023.08.12.21.41.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Aug 2023 21:42:01 -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 , Jon Mason , linux-kernel@vger.kernel.org (open list) Subject: [PATCH net v2] net: phy: broadcom: stub c45 read/write for 54810 Date: Sat, 12 Aug 2023 21:41:47 -0700 Message-Id: <1691901708-28650-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 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. Fixes: b14995ac2527 ("net: phy: broadcom: Add BCM54810 PHY entry") Signed-off-by: Justin Chen Reviewed-by: Florian Fainelli --- v2 - Change EINVAL to EOPNOTSUPP 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..04b2e6eeb195 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 -EOPNOTSUPP; +} + +static int bcm54810_write_mmd(struct phy_device *phydev, int devnum, u16 regnum, + u16 val) +{ + return -EOPNOTSUPP; +} + 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,