Message ID | 20230129022615.379711-1-cphealy@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1580126wrn; Sat, 28 Jan 2023 18:29:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXsesqhvv9euGFCdeybjtl588gfZH6qfwASiipeU7EqeEmO0Pj9JNn3GDaWnlYI6pNY8tr/a X-Received: by 2002:aa7:8c09:0:b0:58d:b8f1:62df with SMTP id c9-20020aa78c09000000b0058db8f162dfmr40804535pfd.16.1674959399497; Sat, 28 Jan 2023 18:29:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674959399; cv=none; d=google.com; s=arc-20160816; b=sVDqinhaqtHF8SH01LIVVTbaf2RB2ntFRYXTSw7Hazv6Fmd9WMe00pyD2VcOML5apr rdnrmeLtixnhQTqcDlZTx9EUJucIipun2C3hus81Px3Ow0heyVhT8yiO8eVSp5KgIzEa 8bigw2Ti1MTRqmsIrLw3k9ZsMJwYDopAZiv5A1ykYEO6v7GEdd0uspsXFw1Pkh5T0yni moO77VXQtG2Cz8NmmzVsHIjwl7JZg6IGYEADrzOBfTPCM3vspv9IQo0/mQL+WV/P4D4Y KXv26iblMu8s0WOLnWhwmo0wiRwxce0Yn8gpmQlT4pdOrdcb7ShHwzp7jHMVY6/TyxIB sbeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Hy9KvguFc2gDUCrzkC+qChu1ABG5IuB/NXRbpfk20C0=; b=QPpwgm6quSKykYI9Ic3IQof3ERtt0PRpTrcfGgTvJx2zxZjpW3QIaAfqPw9pawjpJu iGsmxeavcFSG9yML7e/KjH+dmPuKTODBXnpSPlfBJOr3cAvAlH3bJViRgR5nO8UpOibr X0o83Yz5n+0YG3ZGq44HnKES9cTu+ZSOQcgCjI9z1qfRU8eh15NQNMpzmIyIbARM1rf7 ahO6JFWhdQ8LhFb+L/lYQMzrq3pGSZahL+RjXXAF32DEw/fxBAaF7mkzaN5eLiwHJW/S s5yMyDXEENZcVpOOOuoq07HPCpkMi+8iX2eo/jhdS0lHQ7v8fw+Nh4poPAPJJJoCgMeI OZoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WvbT2tIn; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020aa78ecc000000b005935dae4234si4879728pfr.306.2023.01.28.18.29.46; Sat, 28 Jan 2023 18:29:59 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=WvbT2tIn; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230241AbjA2C1G (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Sat, 28 Jan 2023 21:27:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbjA2C1D (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 28 Jan 2023 21:27:03 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 205A923339; Sat, 28 Jan 2023 18:27:03 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id v6-20020a17090ad58600b00229eec90a7fso11054975pju.0; Sat, 28 Jan 2023 18:27:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Hy9KvguFc2gDUCrzkC+qChu1ABG5IuB/NXRbpfk20C0=; b=WvbT2tInonx13nAi6GfeETQXmxg2vbMEdJEaGo/kXSVJPGaaMvTnEIUqJ567lFGDEt ddbMsrGUybFe7ewIczVzJ16c9uX2DSEbihjh4TWqiVyZjoXO44hpAMWIcuo3HfZAOg7O Sw2F2h4ZDP9dUm3FcQZLUimDNETpb4x2T1/LIS99zdJoJtvMoD93psRbjc1SNyVUtjxK FtoFaFLop+2PeCTwmK43LPCwdvYsHuJzmGpYxWIronqZe+mTx6jWF+hdJbL15qjmfYfo pIfLTEq8x4ahJZQ8DqoFaKdVxCYGo9Y0uf0UDhbma6Zqt+ejV53pZBE3IUkRpbOmbUAr AqIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Hy9KvguFc2gDUCrzkC+qChu1ABG5IuB/NXRbpfk20C0=; b=7RCUp36xYhxjYGGKApcUd498dgDBk2xMpI0Es7TD2kM7p/v38QsS49xndwMVz+s27y TTGJKCD6TYVESwAzCjguUJSrmwM8uzx6snl5YRWKEJxfwJ3MQdcxts4wQYob2TbYcoH7 jbOGGIC7GXcZ2nYZzlWTQTaX/IFFtI23wVz0Rht2Bj3qK1Hg0SWmqWCRUvXDYQaULS4l XYj90L521sAvWtlWTJzDSywEW1bUEFKmHTTRVMlNA4YcE0hd+8Kkdo4My2R1RoXs/Zu3 hSGLdQgFSEBZKgUD6/KthK68sk5pTjSXpq+VfKGlF7Zdc0DKZZ8n7ZztdWXMt+x7DIvJ Hjcg== X-Gm-Message-State: AFqh2kopQTUJWaMuGTCHMJ4xtYcAzLWjmkOJLdjrk6jsZNqtqRvc7u3c lxt35wQFINQKRRg4CiO8gVEWp9+OzvE53Q== X-Received: by 2002:a05:6a21:3294:b0:a4:414c:84c5 with SMTP id yt20-20020a056a21329400b000a4414c84c5mr61940516pzb.12.1674959222534; Sat, 28 Jan 2023 18:27:02 -0800 (PST) Received: from localhost.localdomain.com (2603-8001-4200-6311-92a0-3d53-9224-b276.res6.spectrum.com. [2603:8001:4200:6311:92a0:3d53:9224:b276]) by smtp.gmail.com with ESMTPSA id t1-20020aa79461000000b0058da7e58008sm4904189pfq.36.2023.01.28.18.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jan 2023 18:27:02 -0800 (PST) From: Chris Healy <cphealy@gmail.com> To: cphealy@gmail.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, neil.armstrong@linaro.org, khilman@baylibre.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, jeremy.wang@amlogic.com Cc: Chris Healy <healych@amazon.com> Subject: [PATCH 1/1] net: phy: meson-gxl: Add generic dummy stubs for MMD register access Date: Sat, 28 Jan 2023 18:26:15 -0800 Message-Id: <20230129022615.379711-1-cphealy@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756322227458394008?= X-GMAIL-MSGID: =?utf-8?q?1756322227458394008?= |
Series |
[1/1] net: phy: meson-gxl: Add generic dummy stubs for MMD register access
|
|
Commit Message
Chris Healy
Jan. 29, 2023, 2:26 a.m. UTC
From: Chris Healy <healych@amazon.com> The Meson G12A Internal PHY does not support standard IEEE MMD extended register access, therefore add generic dummy stubs to fail the read and write MMD calls. This is necessary to prevent the core PHY code from erroneously believing that EEE is supported by this PHY even though this PHY does not support EEE, as MMD register access returns all FFFFs. Signed-off-by: Chris Healy <healych@amazon.com> --- drivers/net/phy/meson-gxl.c | 2 ++ 1 file changed, 2 insertions(+)
Comments
On 29.01.2023 03:26, Chris Healy wrote: > From: Chris Healy <healych@amazon.com> > Hi Chris, > The Meson G12A Internal PHY does not support standard IEEE MMD extended > register access, therefore add generic dummy stubs to fail the read and > write MMD calls. This is necessary to prevent the core PHY code from > erroneously believing that EEE is supported by this PHY even though this > PHY does not support EEE, as MMD register access returns all FFFFs. > > Signed-off-by: Chris Healy <healych@amazon.com> > --- > drivers/net/phy/meson-gxl.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c > index c49062ad72c6..5e41658b1e2f 100644 > --- a/drivers/net/phy/meson-gxl.c > +++ b/drivers/net/phy/meson-gxl.c > @@ -271,6 +271,8 @@ static struct phy_driver meson_gxl_phy[] = { > .handle_interrupt = meson_gxl_handle_interrupt, > .suspend = genphy_suspend, > .resume = genphy_resume, > + .read_mmd = genphy_read_mmd_unsupported, > + .write_mmd = genphy_write_mmd_unsupported, > }, > }; > thanks for catching this. The same issue we may have for the GXL-internal PHY. Did you check this? One result of the issue is the invalid ethtool --show-eee output given below. Therefore the patch should go to stable, please annotate it as [PATCH net]. Fixes tag should be: 5c3407abb338 ("net: phy: meson-gxl: add g12a support") EEE settings for eth0: EEE status: enabled - active Tx LPI: 1000000 (us) Supported EEE link modes: 100baseT/Full 1000baseT/Full 10000baseT/Full 1000baseKX/Full 10000baseKX4/Full 10000baseKR/Full Advertised EEE link modes: 100baseT/Full 1000baseT/Full 10000baseT/Full 1000baseKX/Full 10000baseKX4/Full 10000baseKR/Full Link partner advertised EEE link modes: 100baseT/Full 1000baseT/Full 10000baseT/Full 1000baseKX/Full 10000baseKX4/Full 10000baseKR/Full
On Sat, Jan 28, 2023 at 06:26:15PM -0800, Chris Healy wrote: > From: Chris Healy <healych@amazon.com> > > The Meson G12A Internal PHY does not support standard IEEE MMD extended > register access, therefore add generic dummy stubs to fail the read and > write MMD calls. This is necessary to prevent the core PHY code from > erroneously believing that EEE is supported by this PHY even though this > PHY does not support EEE, as MMD register access returns all FFFFs. Hi Chris This change in itself makes sense. But i wounder if we should also change phy_init_eee(). It reads the EEE Ability register. The 2018 version of the standard indicates the top two bits are reserved and should be zero. We also don't have any PHY which supports 100GBase-R through to 100Base-TX. So a read of 0xffff suggests the PHY does not support EEE and returning -EPROTONOSUPPORT would be good. Andrew
On Sun, Jan 29, 2023 at 2:26 AM Heiner Kallweit <hkallweit1@gmail.com> wrote: > > On 29.01.2023 03:26, Chris Healy wrote: > > From: Chris Healy <healych@amazon.com> > > > Hi Chris, > > > The Meson G12A Internal PHY does not support standard IEEE MMD extended > > register access, therefore add generic dummy stubs to fail the read and > > write MMD calls. This is necessary to prevent the core PHY code from > > erroneously believing that EEE is supported by this PHY even though this > > PHY does not support EEE, as MMD register access returns all FFFFs. > > > > Signed-off-by: Chris Healy <healych@amazon.com> > > --- > > drivers/net/phy/meson-gxl.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c > > index c49062ad72c6..5e41658b1e2f 100644 > > --- a/drivers/net/phy/meson-gxl.c > > +++ b/drivers/net/phy/meson-gxl.c > > @@ -271,6 +271,8 @@ static struct phy_driver meson_gxl_phy[] = { > > .handle_interrupt = meson_gxl_handle_interrupt, > > .suspend = genphy_suspend, > > .resume = genphy_resume, > > + .read_mmd = genphy_read_mmd_unsupported, > > + .write_mmd = genphy_write_mmd_unsupported, > > }, > > }; > > > > thanks for catching this. The same issue we may have for the GXL-internal PHY. > Did you check this? I do not have HW with GXL-internal PHY so I cannot test it and don't feel comfortable making the change for that PHY ID without someone providing the necessary feedback. If someone can confirm the same all FFFFs with the MMD registers, I'd be happy to add the read/write MMD callbacks for that PHY in v2. > > One result of the issue is the invalid ethtool --show-eee output given below. > Therefore the patch should go to stable, please annotate it as [PATCH net]. > > Fixes tag should be: > 5c3407abb338 ("net: phy: meson-gxl: add g12a support") Yep, looking at the ethtool --show-eee output is what got me looking at this in the first place. I was hoping to enable EEE... ;-) I'll add the fixes tag in v2. > > > EEE settings for eth0: > EEE status: enabled - active > Tx LPI: 1000000 (us) > Supported EEE link modes: 100baseT/Full > 1000baseT/Full > 10000baseT/Full > 1000baseKX/Full > 10000baseKX4/Full > 10000baseKR/Full > Advertised EEE link modes: 100baseT/Full > 1000baseT/Full > 10000baseT/Full > 1000baseKX/Full > 10000baseKX4/Full > 10000baseKR/Full > Link partner advertised EEE link modes: 100baseT/Full > 1000baseT/Full > 10000baseT/Full > 1000baseKX/Full > 10000baseKX4/Full > 10000baseKR/Full >
On Sun, Jan 29, 2023 at 8:52 AM Andrew Lunn <andrew@lunn.ch> wrote: > > On Sat, Jan 28, 2023 at 06:26:15PM -0800, Chris Healy wrote: > > From: Chris Healy <healych@amazon.com> > > > > The Meson G12A Internal PHY does not support standard IEEE MMD extended > > register access, therefore add generic dummy stubs to fail the read and > > write MMD calls. This is necessary to prevent the core PHY code from > > erroneously believing that EEE is supported by this PHY even though this > > PHY does not support EEE, as MMD register access returns all FFFFs. > > Hi Chris > > This change in itself makes sense. But i wounder if we should also > change phy_init_eee(). It reads the EEE Ability register. The 2018 > version of the standard indicates the top two bits are reserved and > should be zero. We also don't have any PHY which supports 100GBase-R > through to 100Base-TX. So a read of 0xffff suggests the PHY does not > support EEE and returning -EPROTONOSUPPORT would be good. > This seems like a good change to make in phy_init_eee(). I should be able to do this. Can this be done in a subsequent patch or does this need to be present to land this meson specific PHY patch? > Andrew
> > Hi Chris > > > > This change in itself makes sense. But i wounder if we should also > > change phy_init_eee(). It reads the EEE Ability register. The 2018 > > version of the standard indicates the top two bits are reserved and > > should be zero. We also don't have any PHY which supports 100GBase-R > > through to 100Base-TX. So a read of 0xffff suggests the PHY does not > > support EEE and returning -EPROTONOSUPPORT would be good. > > > This seems like a good change to make in phy_init_eee(). I should be > able to do this. Can this be done in a subsequent patch or does this > need to be present to land this meson specific PHY patch? They are independent, submit them in whatever order you want. But doing it first will make it easier to test it actually works. Andrew
diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c index c49062ad72c6..5e41658b1e2f 100644 --- a/drivers/net/phy/meson-gxl.c +++ b/drivers/net/phy/meson-gxl.c @@ -271,6 +271,8 @@ static struct phy_driver meson_gxl_phy[] = { .handle_interrupt = meson_gxl_handle_interrupt, .suspend = genphy_suspend, .resume = genphy_resume, + .read_mmd = genphy_read_mmd_unsupported, + .write_mmd = genphy_write_mmd_unsupported, }, };