From: Corentin LABBE <clabbe.montjoie@gmail.com>
To: Andrew Bresticker <abrestic@chromium.org>,
James Hartley <james.hartley@imgtec.com>,
Herbert Xu <herbert@gondor.apana.org.au>
Cc: davem@davemloft.net, Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
joe@perches.com, mchehab@osg.samsung.com,
Antti Palosaari <crope@iki.fi>,
jg1.han@samsung.com, linux-crypto@vger.kernel.org,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
Ezequiel Garcia <ezequiel.garcia@imgtec.com>,
linux-crypto@vger.kernel.org
Subject: Re: [PATCH 1/2] crypto: Add Imagination Technologies hw hash accelerator
Date: Sat, 15 Nov 2014 08:55:58 +0100 [thread overview]
Message-ID: <5467070E.5040104@gmail.com> (raw)
In-Reply-To: <CAL1qeaGN9q_WHP2YJ3fY3r11v0pitcmwbjam5dRzeZhHCp7c8g@mail.gmail.com>
Le 15/11/2014 00:59, Andrew Bresticker a écrit :
> Hi James,
>
>> +
>> +struct img_hash_drv {
>> + struct list_head dev_list;
>> + spinlock_t lock;
>> +};
>> +
>> +static struct img_hash_drv img_hash = {
>> + .dev_list = LIST_HEAD_INIT(img_hash.dev_list),
>> + .lock = __SPIN_LOCK_UNLOCKED(img_hash.lock),
>> +};
>
> It looks like the only purpose of this list is to get the
> corresponding struct img_hash_dev in img_hash_init(). If there's
> never going to be multiple instances within an SoC, perhaps you could
> just use a global? Otherwise, you could do something like the
> qualcomm driver, see drivers/crypto/qce/sha.c. It looks like there is
> some precedent for this device list though...
>
I don't understand, you propose to use a global, something that lots of people want to be removed in my driver.
It is not better than this global list.
I have the fealing that there no good way to get a pointer to a driver structure inside the cryptoAPI.
What to you think about adding a void *data in struct crypto_alg
Before registering an alg you could do:
mv_aes_alg_ecb.data = myprivatedriverdata;
ret = crypto_register_alg(&mv_aes_alg_ecb);
and then get it via
struct crypto_priv *cp = req->base.tfm->__crt_alg->data;
(a function will be better than that)
So what is the recommended way to get driver structure inside the cryptoAPI function (init/udpate/final)?
Regards
WARNING: multiple messages have this Message-ID (diff)
From: Corentin LABBE <clabbe.montjoie@gmail.com>
To: Andrew Bresticker <abrestic@chromium.org>,
James Hartley <james.hartley@imgtec.com>,
Herbert Xu <herbert@gondor.apana.org.au>
Cc: davem@davemloft.net, Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
joe@perches.com, mchehab@osg.samsung.com,
Antti Palosaari <crope@iki.fi>,
jg1.han@samsung.com, linux-crypto@vger.kernel.org,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
Ezequiel Garcia
<ezequiel.garcia@imgtec.com>linux-crypto@vger.kernel.org
Subject: Re: [PATCH 1/2] crypto: Add Imagination Technologies hw hash accelerator
Date: Sat, 15 Nov 2014 08:55:58 +0100 [thread overview]
Message-ID: <5467070E.5040104@gmail.com> (raw)
In-Reply-To: <CAL1qeaGN9q_WHP2YJ3fY3r11v0pitcmwbjam5dRzeZhHCp7c8g@mail.gmail.com>
Le 15/11/2014 00:59, Andrew Bresticker a écrit :
> Hi James,
>
>> +
>> +struct img_hash_drv {
>> + struct list_head dev_list;
>> + spinlock_t lock;
>> +};
>> +
>> +static struct img_hash_drv img_hash = {
>> + .dev_list = LIST_HEAD_INIT(img_hash.dev_list),
>> + .lock = __SPIN_LOCK_UNLOCKED(img_hash.lock),
>> +};
>
> It looks like the only purpose of this list is to get the
> corresponding struct img_hash_dev in img_hash_init(). If there's
> never going to be multiple instances within an SoC, perhaps you could
> just use a global? Otherwise, you could do something like the
> qualcomm driver, see drivers/crypto/qce/sha.c. It looks like there is
> some precedent for this device list though...
>
I don't understand, you propose to use a global, something that lots of people want to be removed in my driver.
It is not better than this global list.
I have the fealing that there no good way to get a pointer to a driver structure inside the cryptoAPI.
What to you think about adding a void *data in struct crypto_alg
Before registering an alg you could do:
mv_aes_alg_ecb.data = myprivatedriverdata;
ret = crypto_register_alg(&mv_aes_alg_ecb);
and then get it via
struct crypto_priv *cp = req->base.tfm->__crt_alg->data;
(a function will be better than that)
So what is the recommended way to get driver structure inside the cryptoAPI function (init/udpate/final)?
Regards
next prev parent reply other threads:[~2014-11-15 7:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-10 12:10 [PATCH 0/2] crypto: Add support for the IMG hash accelerator James Hartley
2014-11-10 12:10 ` James Hartley
[not found] ` <1415621455-10468-1-git-send-email-james.hartley-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-11-10 12:10 ` [PATCH 1/2] crypto: Add Imagination Technologies hw " James Hartley
2014-11-10 12:10 ` James Hartley
2014-11-10 15:09 ` Vladimir Zapolskiy
2014-11-10 15:09 ` Vladimir Zapolskiy
2014-11-11 14:59 ` James Hartley
2014-11-11 15:12 ` Vladimir Zapolskiy
2014-11-11 15:28 ` James Hartley
2014-11-14 23:59 ` Andrew Bresticker
2014-11-15 7:55 ` Corentin LABBE [this message]
2014-11-15 7:55 ` Corentin LABBE
2014-11-17 17:11 ` Andrew Bresticker
2014-11-24 14:39 ` Herbert Xu
2014-11-15 11:08 ` Arnd Bergmann
2014-11-18 18:16 ` James Hartley
2014-11-10 12:10 ` [PATCH 2/2] Documentation: crypto: Add DT binding info for the img " James Hartley
2014-11-10 12:10 ` James Hartley
2014-11-10 17:30 ` Andrew Bresticker
2014-11-18 18:33 ` James Hartley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5467070E.5040104@gmail.com \
--to=clabbe.montjoie@gmail.com \
--cc=abrestic@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=crope@iki.fi \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=ezequiel.garcia@imgtec.com \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=ijc+devicetree@hellion.org.uk \
--cc=james.hartley@imgtec.com \
--cc=jg1.han@samsung.com \
--cc=joe@perches.com \
--cc=linux-crypto@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab@osg.samsung.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.