Hi Andrew, 

> -----Original Message-----
> From: abres...@google.com [mailto:abres...@google.com] On Behalf Of
> Andrew Bresticker
> Sent: 12 March 2015 18:57
> To: James Hartley
> Cc: Herbert Xu; smuel...@chronox.de; devicet...@vger.kernel.org; Ezequiel
> Garcia; linux-crypto@vger.kernel.org
> Subject: Re: [PATCH V4 1/2] crypto: Add Imagination Technologies hw hash
> accelerator
> 
> Hi James,
> 
> On Wed, Mar 11, 2015 at 7:06 PM, James Hartley
> <james.hart...@imgtec.com> wrote:
> > This adds support for the Imagination Technologies hash accelerator
> > which provides hardware acceleration for SHA1 SHA224 SHA256 and MD5
> hashes.
> >
> > Signed-off-by: James Hartley <james.hart...@imgtec.com>
> 
> One comment below, otherwise this looks fine to me.
> 
> > --- /dev/null
> > +++ b/drivers/crypto/img-hash.c
> 
> > +static int img_hash_hw_init(struct img_hash_dev *hdev) {
> > +       unsigned long long nbits;
> > +       u32 u, l;
> > +       int ret;
> > +
> > +       ret = clk_prepare_enable(hdev->hash_clk);
> > +       if (ret)
> > +               return ret;
> > +
> > +       ret = clk_prepare_enable(hdev->sys_clk);
> > +       if (ret) {
> > +               clk_disable_unprepare(hdev->hash_clk);
> > +               return ret;
> > +       }
> 
> I think you'll still end up with inflated prepare/enable counts for these 
> clocks
> since this function may get called multiple times and the only
> clk_disable_unprepare() calls are in the remove() path.  Perhaps it's best to
> just enable the clocks in probe() until runtime PM support is added?

Yes, I'll do that and upload a V5 set.

> 
> Thanks,
> Andrew

Thanks
James.

Reply via email to