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]
Date:   Wed, 12 Jun 2019 13:53:57 +0000
From:   Leonard Crestez <leonard.crestez@....com>
To:     Andrey Smirnov <andrew.smirnov@...il.com>,
        Chris Spencer <christopher.spencer@....co.uk>,
        Horia Geanta <horia.geanta@....com>
CC:     "linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
        Aymen Sghaier <aymen.sghaier@....com>,
        Cory Tusar <cory.tusar@....aero>,
        Chris Healy <cphealy@...il.com>,
        Lucas Stach <l.stach@...gutronix.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Iuliana Prodan <iuliana.prodan@....com>
Subject: Re: [PATCH v2 1/4] crypto: caam - do not initialise clocks on the
 i.MX8

On 07.06.2019 23:03, Andrey Smirnov wrote:

> There are no clocks that the CAAM driver needs to initialise on the
> i.MX8.

The clk handling inside CAAM is very convoluted and this patch doesn't 
help. All the driver actually does is "enable all required clocks", this 
shouldn't be complicated.

I propose adding a const caam_soc_data struct which has a bool flag 
marking if each clock is required or not, the replace all the 
of_machine_is_compatible() logic with statements of the form:

if (ctrlpriv->soc_data->need_ipg_clk)
     ctrlpriv->caam_ipg = devm_clk_get("ipg");

You could even make all clks optional and claim that if a clk is not 
listed in DT then it's assumed to be always on. However that means that 
on some SOCs if DT is incorrect you can get a hang (due to missing clk) 
instead of a probe error.

> +	clk_disable_unprepare(ctrlpriv->caam_ipg);
> +	if (ctrlpriv->caam_mem)
> +		clk_disable_unprepare(ctrlpriv->caam_mem);
> +	clk_disable_unprepare(ctrlpriv->caam_aclk);
> +	if (ctrlpriv->caam_emi_slow)
> +		clk_disable_unprepare(ctrlpriv->caam_emi_slow);

Clock APIs have no effect if clk argument is NULL, please just drop 
these if statements.

--
Regards,
Leonard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ