From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Woojung Huh <woojung.huh@microchip.com>,
Arun.Ramadoss@microchip.com,
Florian Fainelli <f.fainelli@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Vivien Didelot <vivien.didelot@gmail.com>,
UNGLinuxDriver@microchip.com, Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
kernel@pengutronix.de, Jakub Kicinski <kuba@kernel.org>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH net-next v1 2/4] net: phy: micrel: add EEE configuration support for KSZ9477 variants of PHYs
Date: Fri, 20 Jan 2023 06:50:40 +0100 [thread overview]
Message-ID: <20230120055040.GH6162@pengutronix.de> (raw)
In-Reply-To: <Y8lO+2JojN8zOkkY@lunn.ch>
On Thu, Jan 19, 2023 at 03:08:59PM +0100, Andrew Lunn wrote:
> > +static int ksz9477_get_eee_caps(struct phy_device *phydev,
> > + struct ethtool_eee *data)
> > +{
> > + int val;
> > +
> > + /* At least on KSZ8563 (which has same PHY_ID as KSZ9477), the
> > + * MDIO_PCS_EEE_ABLE register is a mirror of MDIO_AN_EEE_ADV register.
> > + * So, we need to provide this information by driver.
> > + */
> > + data->supported = SUPPORTED_100baseT_Full;
> > +
> > + /* KSZ8563 is able to advertise not supported MDIO_EEE_1000T.
> > + * We need to test if the PHY is 1Gbit capable.
> > + */
> > + val = phy_read(phydev, MII_BMSR);
> > + if (val < 0)
> > + return val;
> > +
> > + if (val & BMSR_ERCAP)
> > + data->supported |= SUPPORTED_1000baseT_Full;
>
> This works, but you could also look at phydev->supported and see if
> one of the 1G modes is listed. That should be faster, since there is
> no MDIO transaction involved. Not that this is on any sort of hot
> path.
ack. Sounds good.
Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2023-01-20 5:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-19 13:18 [PATCH net-next v1 0/4] net: add EEE support for KSZ9477 switch series Oleksij Rempel
2023-01-19 13:18 ` [PATCH net-next v1 1/4] net: phy: add driver specific get/set_eee support Oleksij Rempel
2023-01-20 3:53 ` Jakub Kicinski
2023-01-19 13:18 ` [PATCH net-next v1 2/4] net: phy: micrel: add EEE configuration support for KSZ9477 variants of PHYs Oleksij Rempel
2023-01-19 14:08 ` Andrew Lunn
2023-01-20 5:50 ` Oleksij Rempel [this message]
2023-01-19 19:25 ` Florian Fainelli
2023-01-20 5:55 ` Oleksij Rempel
2023-01-20 17:58 ` Florian Fainelli
2023-01-21 6:34 ` Oleksij Rempel
2023-01-19 13:18 ` [PATCH net-next v1 3/4] net: phy: micrel: disable 1000Mbit EEE support if 1000Mbit is not supported Oleksij Rempel
2023-01-19 13:18 ` [PATCH net-next v1 4/4] net: dsa: microchip: enable EEE support Oleksij Rempel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230120055040.GH6162@pengutronix.de \
--to=o.rempel@pengutronix.de \
--cc=Arun.Ramadoss@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=vivien.didelot@gmail.com \
--cc=woojung.huh@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).