lkml.org 
[lkml]   [2019]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 1/4] crypto: caam - do not initialise clocks on the i.MX8
Date
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

\
 
 \ /
  Last update: 2019-06-12 15:55    [W:0.057 / U:24.416 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site