From: Andrew Lunn <andrew@lunn.ch>
To: Liang Xu <lxu@maxlinear.com>
Cc: "hkallweit1@gmail.com" <hkallweit1@gmail.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>,
"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
Hauke Mehrtens <hmehrtens@maxlinear.com>,
Thomas Mohren <tmohren@maxlinear.com>
Subject: Re: [PATCH] phy: maxlinear: add Maxlinear GPY115/21x/24x driver
Date: Tue, 1 Jun 2021 18:55:03 +0200 [thread overview]
Message-ID: <YLZmZ0pa4vULonsZ@lunn.ch> (raw)
In-Reply-To: <050c9cd2-ba6e-332d-d235-4fa9364b461b@maxlinear.com>
> >> + linkmode_mod_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
> >> + phydev->supported,
> >> + ret & MDIO_PMA_NG_EXTABLE_5GBT);
> >> +
> > Does genphy_c45_pma_read_abilities() do the wrong thing here? What
> > does it get wrong?
>
> The problem comes from condition "phydev->c45_ids.mmds_present &
> MDIO_DEVS_AN".
>
> Our product supports both C22 and C45.
>
> In the real system, we found C22 was used by customers (with indirect
> access to C45 registers when necessary).
>
> Then during probe, in API "get_phy_device", it skips reading C45 IDs.
>
> So that genphy_c45_pma_read_abilities skip the supported flag
> ETHTOOL_LINK_MODE_Autoneg_BIT.
This sounds like a generic problem, which will affect any PHY which
has both C22 and C45. I wounder if it makes sense to add a helper
function which a PHY driver can call to get the
phydev->c45_ids.mmds_present populated?
> >> +static int gpy_read_status(struct phy_device *phydev)
> >> +{
> >> + int ret;
> >> +
> >> + ret = genphy_update_link(phydev);
> >> + if (ret)
> >> + return ret;
> >> +
> >> + phydev->speed = SPEED_UNKNOWN;
> >> + phydev->duplex = DUPLEX_UNKNOWN;
> >> + phydev->pause = 0;
> >> + phydev->asym_pause = 0;
> >> +
> >> + if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) {
> >> + ret = genphy_c45_read_lpa(phydev);
> >> + if (ret < 0)
> >> + return ret;
> >> +
> >> + /* Read the link partner's 1G advertisement */
> >> + ret = phy_read(phydev, MII_STAT1000);
> >> + if (ret < 0)
> >> + return ret;
> >> + mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising, ret);
> > can genphy_read_lpa() be used here?
>
> 2.5G is not covered in genphy_read_lpa.
>
> If I use genphy_c45_read_lpa first then genphy_read_lpa after, it seems
> a bit redundant.
I'm just trying to avoid repeating code which is in helpers. I think
this is the first PHY driver which uses a mixture of C22 and C45 like
this. So it could be the helpers need small modifications to make them
work. We should make those modifications, since your PHY is not likely
to be the only mixed C22 and C45 device.
Andrew
next prev parent reply other threads:[~2021-06-01 16:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 7:44 [PATCH] phy: maxlinear: add Maxlinear GPY115/21x/24x driver Xu Liang
2021-06-01 11:41 ` Wong Vee Khee
2021-06-01 14:46 ` Liang Xu
2021-06-01 12:25 ` Russell King (Oracle)
2021-06-01 12:41 ` Andrew Lunn
2021-06-01 15:53 ` Liang Xu
2021-06-01 16:55 ` Andrew Lunn [this message]
2021-06-01 17:14 ` Liang Xu
2021-06-01 19:13 ` Andrew Lunn
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=YLZmZ0pa4vULonsZ@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=hmehrtens@maxlinear.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lxu@maxlinear.com \
--cc=netdev@vger.kernel.org \
--cc=tmohren@maxlinear.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.