lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3d00d8de-b47e-c44a-fffa-542a0d9d5796@gmail.com>
Date:   Fri, 24 Mar 2023 12:07:22 -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 2/4] net: phy: smsc: remove getting reference
 clock

On 3/24/23 11:03, Heiner Kallweit wrote:
> Now that getting the reference clock has been moved to phylib,
> we can remove it here.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
> ---
>   drivers/net/phy/smsc.c | 9 +--------
>   1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
> index 730964b85..48654c684 100644
> --- a/drivers/net/phy/smsc.c
> +++ b/drivers/net/phy/smsc.c
> @@ -278,7 +278,6 @@ int smsc_phy_probe(struct phy_device *phydev)
>   {
>   	struct device *dev = &phydev->mdio.dev;
>   	struct smsc_phy_priv *priv;
> -	struct clk *refclk;
>   
>   	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>   	if (!priv)
> @@ -291,13 +290,7 @@ int smsc_phy_probe(struct phy_device *phydev)
>   
>   	phydev->priv = priv;
>   
> -	/* Make clk optional to keep DTB backward compatibility. */
> -	refclk = devm_clk_get_optional_enabled(dev, NULL);
> -	if (IS_ERR(refclk))
> -		return dev_err_probe(dev, PTR_ERR(refclk),
> -				     "Failed to request clock\n");
> -
> -	return clk_set_rate(refclk, 50 * 1000 * 1000);
> +	return clk_set_rate(phydev->refclk, 50 * 1000 * 1000);

AFAIR one should be calling clk_prepare_enable() before clk_set_rate(), 
which neither smsc.c nor micrel.c do.

If we insist on moving this code to the PHY library which I have no 
strong objections against, we might provide a PHY_REQUIRES_REFCLK flag 
that the generic code can key off, or in the same of bcm7xx.c: 
PHY_LET_ME_MANAGED_MY_CLOCK?
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ