* [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function
@ 2017-04-01 16:59 Haren Myneni
2017-04-04 11:11 ` Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: Haren Myneni @ 2017-04-01 16:59 UTC (permalink / raw)
To: herbert, mpe, ddstreet
Cc: linuxppc-dev, linux-crypto, benh, mikey, suka, hbabu
[PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function
nx842_powernv_function is points to nx842_icswx_function and
will be point to VAS function which will be added later for
P9 NX support.
Signed-off-by: Haren Myneni <haren@us.ibm.com>
---
drivers/crypto/nx/nx-842-powernv.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c
index 3abb045..125f1dc 100644
--- a/drivers/crypto/nx/nx-842-powernv.c
+++ b/drivers/crypto/nx/nx-842-powernv.c
@@ -47,14 +47,22 @@ struct nx842_workmem {
struct nx842_coproc {
unsigned int chip_id;
- unsigned int ct;
- unsigned int ci;
+ union {
+ struct {
+ unsigned int ct;
+ unsigned int ci;
+ } icswx;
+ };
struct list_head list;
};
/* no cpu hotplug on powernv, so this list never changes after init */
static LIST_HEAD(nx842_coprocs);
-static unsigned int nx842_ct;
+static unsigned int nx842_ct; /* use with icswx function */
+
+static int (*nx842_powernv_function)(const unsigned char *in,
+ unsigned int inlen, unsigned char *out,
+ unsigned int *outlenp, void *workmem, int fc);
/**
* setup_indirect_dde - Setup an indirect DDE
@@ -355,7 +363,7 @@ static int wait_for_csb(struct nx842_workmem *wmem,
}
/**
- * nx842_powernv_function - compress/decompress data using the 842 algorithm
+ * nx842_icswx_function - compress/decompress data using the 842 algorithm
*
* (De)compression provided by the NX842 coprocessor on IBM PowerNV systems.
* This compresses or decompresses the provided input buffer into the provided
@@ -385,7 +393,7 @@ static int wait_for_csb(struct nx842_workmem *wmem,
* -ETIMEDOUT hardware did not complete operation in reasonable time
* -EINTR operation was aborted
*/
-static int nx842_powernv_function(const unsigned char *in, unsigned int inlen,
+static int nx842_icswx_function(const unsigned char *in, unsigned int inlen,
unsigned char *out, unsigned int *outlenp,
void *workmem, int fc)
{
@@ -554,8 +562,8 @@ static int __init nx842_powernv_probe(struct device_node *dn)
return -ENOMEM;
coproc->chip_id = chip_id;
- coproc->ct = ct;
- coproc->ci = ci;
+ coproc->icswx.ct = ct;
+ coproc->icswx.ci = ci;
INIT_LIST_HEAD(&coproc->list);
list_add(&coproc->list, &nx842_coprocs);
@@ -625,6 +633,8 @@ static __init int nx842_powernv_init(void)
if (!nx842_ct)
return -ENODEV;
+ nx842_powernv_function = nx842_icswx_function;
+
ret = crypto_register_alg(&nx842_powernv_alg);
if (ret) {
struct nx842_coproc *coproc, *n;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function
2017-04-01 16:59 [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function Haren Myneni
@ 2017-04-04 11:11 ` Michael Ellerman
2017-04-05 3:32 ` Haren Myneni
0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2017-04-04 11:11 UTC (permalink / raw)
To: Haren Myneni, herbert, ddstreet
Cc: linuxppc-dev, linux-crypto, benh, mikey, suka, hbabu
Haren Myneni <haren@linux.vnet.ibm.com> writes:
> [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function
>
> nx842_powernv_function is points to nx842_icswx_function and
> will be point to VAS function which will be added later for
> P9 NX support.
I know it's nit-picking but can you give it a better name while you're
there.
I was thinking it should be called "send" or something, but it actually
synchronously sends and waits for a request.
So perhaps just nx842_exec(), for "execute a request", and then you can
have nx842_exec_icswx() and nx842_exec_vas().
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function
2017-04-04 11:11 ` Michael Ellerman
@ 2017-04-05 3:32 ` Haren Myneni
0 siblings, 0 replies; 3+ messages in thread
From: Haren Myneni @ 2017-04-05 3:32 UTC (permalink / raw)
To: Michael Ellerman
Cc: herbert, ddstreet, linuxppc-dev, linux-crypto, benh, mikey, suka, hbabu
On 04/04/2017 04:11 AM, Michael Ellerman wrote:
> Haren Myneni <haren@linux.vnet.ibm.com> writes:
>
>> [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function
>>
>> nx842_powernv_function is points to nx842_icswx_function and
>> will be point to VAS function which will be added later for
>> P9 NX support.
>
> I know it's nit-picking but can you give it a better name while you're
> there.
>
> I was thinking it should be called "send" or something, but it actually
> synchronously sends and waits for a request.
>
> So perhaps just nx842_exec(), for "execute a request", and then you can
> have nx842_exec_icswx() and nx842_exec_vas().
>
> cheers
>
Michael,
Thanks for review,
nx842_powernv_function() was used before, So just renamed similar to this name. But I will make changes in the next version.
Haren
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-05 3:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-01 16:59 [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function Haren Myneni
2017-04-04 11:11 ` Michael Ellerman
2017-04-05 3:32 ` Haren Myneni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).