Re: [PATCH V4 1/2] crypto: Add Imagination Technologies hw hash accelerator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi James,

On Wed, Mar 11, 2015 at 7:06 PM, James Hartley <james.hartley@xxxxxxxxxx> 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.hartley@xxxxxxxxxx>

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?

Thanks,
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux