[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e39a20a2-c01e-343a-15e8-e917e9451dbe@gmail.com>
Date: Fri, 24 Mar 2023 12:10:29 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Heiner Kallweit <hkallweit1@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Russell King - ARM Linux <linux@...linux.org.uk>,
Jakub Kicinski <kuba@...nel.org>,
David Miller <davem@...emloft.net>,
Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
Florian Fainelli <f.fainelli@...il.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 1/4] net: phylib: add getting reference clock
On 3/24/23 11:03, Heiner Kallweit wrote:
> Few PHY drivers (smsc, bcm7xxx, micrel) get and enable the (R)MII
> reference clock in their probe() callback. Move this common
> functionality to phylib, this allows to remove it from the drivers
> in a follow-up.
>
> Note that we now enable the reference clock before deasserting the
> PHY reset signal. Maybe this even allows us to get rid of
> phy_reset_after_clk_enable().
>
> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
> ---
> drivers/net/phy/phy_device.c | 6 ++++++
> include/linux/phy.h | 5 +++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index c0760cbf5..6668487e2 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -3096,6 +3096,12 @@ static int phy_probe(struct device *dev)
> if (phydrv->flags & PHY_IS_INTERNAL)
> phydev->is_internal = true;
>
> + phydev->refclk = devm_clk_get_optional_enabled(dev, NULL);
> + if (IS_ERR(phydev->refclk)) {
> + err = PTR_ERR(phydev->refclk);
> + goto out;
> + }
My comment in patch 2 should have been there, I would add a flag that
the PHY driver can set that tells the core that it is OK to fetch the
clock. In the case of bcm7xxx.c is it not the reference clock, so while
we can use phydev->refclk for the same purpose, it could be a tad confusing.
--
Florian
Powered by blists - more mailing lists