[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHQ1cqHw4whpq9Q0hNOrh4Q-72dxQVoNqJ-VEk9g7ZMimNTCkg@mail.gmail.com>
Date: Wed, 12 Jun 2019 09:28:45 -0700
From: Andrey Smirnov <andrew.smirnov@...il.com>
To: Leonard Crestez <leonard.crestez@....com>
Cc: Chris Spencer <christopher.spencer@....co.uk>,
Horia Geanta <horia.geanta@....com>,
"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 Wed, Jun 12, 2019 at 6:53 AM Leonard Crestez <leonard.crestez@....com> wrote:
>
> 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.
>
As I mentioned before, this patch is now dropped. It is replaced with
a one-liner to avoid requesting "emi_slow" clock on i.mx8mq.
> 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.
>
I agree with this approach in principle, but I'd rather focus this
series on adding i.MX8MQ support with least amount changes needed. I
have a separate series doing a bunch of devres related cleanup on this
driver, which I plan to submit once i.MX8MQ is supported and we can
(and I'd rather) address the problem there.
> > + 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.
As a part of my refactoring changes I replaced all of that code with
devres, so it should already be addressed there.
Thanks,
Andrey Smirnov
Powered by blists - more mailing lists