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: 135013 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2073015vqi; Sun, 13 Aug 2023 00:27:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUv9IcEJmAxv0iy6QtKM0vKL7yQRBNQqufRrJixIAvF7UDZ6mBRgeCtRDTWV6cHCglWC2U X-Received: by 2002:a17:906:53cd:b0:99b:dca9:5b8f with SMTP id p13-20020a17090653cd00b0099bdca95b8fmr5414446ejo.56.1691911642417; Sun, 13 Aug 2023 00:27:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691911642; cv=none; d=google.com; s=arc-20160816; b=pNFGrSuEDRpKaShHBSYIXxxnvJ62ddttwF/qjRE85EyxBMZl33hivQeA2OFzwvl6NR uhcg7RScGYfPhS70sqNtM5kz3jww+JlMBXP9fl42regrYjAgH5aybvmSQlunZfPk+9Mn WztXu5UopIycevRIMPA54Phy2VqzPXG+DUmaukfq2FutvcUeS0oqghtruFYpg2GvVImS yJsfFTnbVCo67/bMoiE2R8ZkYTFIuzNVQ9+ZFRkVRlwTO6+hjavk7AfSE/40yrfC7QbR PKwK7xxsyTuZvsSlN4YZ/0F9spsYXbBgNWkIi+HXSuqjIuILuiZR9dv4mafPcrYnPnAD uryQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=YbjC+3FrOazwaRftF4CmnAfhxmwPya3F3H22BEeCg/I=; fh=LK2+fLRsW1V//RGwwHIrlpcKala0G7gwihxbuNytZVg=; b=ehWDcNS6D18SbtDu7xRkGqzcK9ZVzTCoGhehlUzSmM/7yXIyiaJ2RUWK2oRbOh4UTS E3rBlBCNZLk7Pgn23kXUoy0bmyowsCOGxuH+rqXoAX2DbXsaajYK74hfQLsGli/NacYd A2VxlmB1zXgMwt32waLnTmTEBBUJzuQhQdjawASr7tyHabhf0SLAKYnTAhxSRHIZidDR oHiWju9M2IL7g/kBYEJMMQESmEQhMEESrLm/vL8DnidcTvITCw4sc2e7Av+YtZRFLpDz ni79+3Ep0GUrqLft+2K0dCOR8EuV1V3dAmZvuX26a3AitqbXJ+mrsN/A2EpoRGNjSrZ0 JY2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=aq3PpKUp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e21-20020a170906249500b0098df1cbe2acsi5734884ejb.997.2023.08.13.00.26.58; Sun, 13 Aug 2023 00:27:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=aq3PpKUp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229688AbjHMEmB (ORCPT + 99 others); Sun, 13 Aug 2023 00:42:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjHMEmA (ORCPT ); Sun, 13 Aug 2023 00:42:00 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14094ED for ; Sat, 12 Aug 2023 21:42:03 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-76ca7b4782cso228908985a.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=YbjC+3FrOazwaRftF4CmnAfhxmwPya3F3H22BEeCg/I=; b=aq3PpKUpcvd15Whwq7svmw9glJwtc5CNr7CuISX0Tmn7BCq/NqHC41iQWeq4NlC7nm l+FRrA5CVksoyaDnY9XZFHHXvCYatT9KDmAacPyTZxXU1zgSpA903yI7qWM6EAsbaZ7W F4CtTzOySFgOIKkw00VsLcSxg04jAAyBsRHuM= 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=YbjC+3FrOazwaRftF4CmnAfhxmwPya3F3H22BEeCg/I=; b=HwhuXQXgHWEotLXyM/oe/4PmQus/Jn0Mrbj3LPzkSyqri56Z9M9YAIdYXvxNIXaCvO izxpg//xKnzDgTkvEd65G+mGCddX3bsGcRGiBygwmTDtt7iobX6SIYj4ojs8j8jzQuDz sJFbt6NyrkHeMOQZdJDL6kAGYxNxlJXdiW6eF+LJot6aqOIOaxtxtaXTVPQnrV6w8cY6 JtOPMgDYGZMwBcnXQmvKIZNpG9K1kqM9OSuFVKwALh6mUugWWZbXJrZ9i3v5AblKBFCm KlHG5oU+U56nXD9r/PkSFJmOQcwBpfuF6/bbkrFXZsoDCDgr5NAheAw9JTgWoz9wcNMh A1Ww== X-Gm-Message-State: AOJu0Yw8PW0wiuW89Yj45WVUCFD4QO+zthpJo2AMHyYYNm80/UEFtnYI WXvLgV4ERwhoDPg9GzexKuyKVA== 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774097942324152313 X-GMAIL-MSGID: 1774097942324152313 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,