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: <e703abb1-e92e-5ad3-f3d9-5c4d22c8125c@gmail.com>
Date:   Fri, 24 Mar 2023 12:09:43 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Florian Fainelli <f.fainelli@...il.com>,
        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>,
        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 12:07, Florian Fainelli wrote:
> 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.

Which is implied by the devm_clk_get_optional_enabled().
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ