* [PATCH] crypto: cavium/zip - fix collision with generic cra_driver_name
@ 2019-02-23 8:23 Eric Biggers
2019-02-26 7:55 ` Jan Glauber
2019-02-28 6:39 ` Herbert Xu
0 siblings, 2 replies; 4+ messages in thread
From: Eric Biggers @ 2019-02-23 8:23 UTC (permalink / raw)
To: linux-crypto, Herbert Xu; +Cc: Mahipal Challa, Jan Glauber
From: Eric Biggers <ebiggers@google.com>
The cavium/zip implementation of the deflate compression algorithm is
incorrectly being registered under the generic driver name, which
prevents the generic implementation from being registered with the
crypto API when CONFIG_CRYPTO_DEV_CAVIUM_ZIP=y. Similarly the lzs
algorithm (which does not currently have a generic implementation...)
is incorrectly being registered as lzs-generic.
Fix the naming collision by adding a suffix "-cavium" to the
cra_driver_name of the cavium/zip algorithms.
Fixes: 640035a2dc55 ("crypto: zip - Add ThunderX ZIP driver core")
Cc: Mahipal Challa <mahipalreddy2006@gmail.com>
Cc: Jan Glauber <jglauber@cavium.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
drivers/crypto/cavium/zip/zip_main.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/cavium/zip/zip_main.c b/drivers/crypto/cavium/zip/zip_main.c
index e6b09e784e666..a8447a3cf3665 100644
--- a/drivers/crypto/cavium/zip/zip_main.c
+++ b/drivers/crypto/cavium/zip/zip_main.c
@@ -351,6 +351,7 @@ static struct pci_driver zip_driver = {
static struct crypto_alg zip_comp_deflate = {
.cra_name = "deflate",
+ .cra_driver_name = "deflate-cavium",
.cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
.cra_ctxsize = sizeof(struct zip_kernel_ctx),
.cra_priority = 300,
@@ -365,6 +366,7 @@ static struct crypto_alg zip_comp_deflate = {
static struct crypto_alg zip_comp_lzs = {
.cra_name = "lzs",
+ .cra_driver_name = "lzs-cavium",
.cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
.cra_ctxsize = sizeof(struct zip_kernel_ctx),
.cra_priority = 300,
@@ -384,7 +386,7 @@ static struct scomp_alg zip_scomp_deflate = {
.decompress = zip_scomp_decompress,
.base = {
.cra_name = "deflate",
- .cra_driver_name = "deflate-scomp",
+ .cra_driver_name = "deflate-scomp-cavium",
.cra_module = THIS_MODULE,
.cra_priority = 300,
}
@@ -397,7 +399,7 @@ static struct scomp_alg zip_scomp_lzs = {
.decompress = zip_scomp_decompress,
.base = {
.cra_name = "lzs",
- .cra_driver_name = "lzs-scomp",
+ .cra_driver_name = "lzs-scomp-cavium",
.cra_module = THIS_MODULE,
.cra_priority = 300,
}
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: cavium/zip - fix collision with generic cra_driver_name
2019-02-23 8:23 [PATCH] crypto: cavium/zip - fix collision with generic cra_driver_name Eric Biggers
@ 2019-02-26 7:55 ` Jan Glauber
2019-02-26 22:28 ` Eric Biggers
2019-02-28 6:39 ` Herbert Xu
1 sibling, 1 reply; 4+ messages in thread
From: Jan Glauber @ 2019-02-26 7:55 UTC (permalink / raw)
To: Eric Biggers; +Cc: linux-crypto, Herbert Xu, Mahipal Challa
On Sat, Feb 23, 2019 at 12:23:23AM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> The cavium/zip implementation of the deflate compression algorithm is
> incorrectly being registered under the generic driver name, which
> prevents the generic implementation from being registered with the
> crypto API when CONFIG_CRYPTO_DEV_CAVIUM_ZIP=y. Similarly the lzs
> algorithm (which does not currently have a generic implementation...)
> is incorrectly being registered as lzs-generic.
>
> Fix the naming collision by adding a suffix "-cavium" to the
> cra_driver_name of the cavium/zip algorithms.
The patch is fine, basically the same as:
https://marc.info/?l=linux-crypto-vger&m=152968599829763&w=2
Shouldn't we also rename deflate to deflate generic?
--Jan
> Fixes: 640035a2dc55 ("crypto: zip - Add ThunderX ZIP driver core")
> Cc: Mahipal Challa <mahipalreddy2006@gmail.com>
> Cc: Jan Glauber <jglauber@cavium.com>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
> drivers/crypto/cavium/zip/zip_main.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/cavium/zip/zip_main.c b/drivers/crypto/cavium/zip/zip_main.c
> index e6b09e784e666..a8447a3cf3665 100644
> --- a/drivers/crypto/cavium/zip/zip_main.c
> +++ b/drivers/crypto/cavium/zip/zip_main.c
> @@ -351,6 +351,7 @@ static struct pci_driver zip_driver = {
>
> static struct crypto_alg zip_comp_deflate = {
> .cra_name = "deflate",
> + .cra_driver_name = "deflate-cavium",
> .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
> .cra_ctxsize = sizeof(struct zip_kernel_ctx),
> .cra_priority = 300,
> @@ -365,6 +366,7 @@ static struct crypto_alg zip_comp_deflate = {
>
> static struct crypto_alg zip_comp_lzs = {
> .cra_name = "lzs",
> + .cra_driver_name = "lzs-cavium",
> .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
> .cra_ctxsize = sizeof(struct zip_kernel_ctx),
> .cra_priority = 300,
> @@ -384,7 +386,7 @@ static struct scomp_alg zip_scomp_deflate = {
> .decompress = zip_scomp_decompress,
> .base = {
> .cra_name = "deflate",
> - .cra_driver_name = "deflate-scomp",
> + .cra_driver_name = "deflate-scomp-cavium",
> .cra_module = THIS_MODULE,
> .cra_priority = 300,
> }
> @@ -397,7 +399,7 @@ static struct scomp_alg zip_scomp_lzs = {
> .decompress = zip_scomp_decompress,
> .base = {
> .cra_name = "lzs",
> - .cra_driver_name = "lzs-scomp",
> + .cra_driver_name = "lzs-scomp-cavium",
> .cra_module = THIS_MODULE,
> .cra_priority = 300,
> }
> --
> 2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: cavium/zip - fix collision with generic cra_driver_name
2019-02-26 7:55 ` Jan Glauber
@ 2019-02-26 22:28 ` Eric Biggers
0 siblings, 0 replies; 4+ messages in thread
From: Eric Biggers @ 2019-02-26 22:28 UTC (permalink / raw)
To: Jan Glauber; +Cc: linux-crypto, Herbert Xu, Mahipal Challa
On Tue, Feb 26, 2019 at 07:55:54AM +0000, Jan Glauber wrote:
> On Sat, Feb 23, 2019 at 12:23:23AM -0800, Eric Biggers wrote:
> > From: Eric Biggers <ebiggers@google.com>
> >
> > The cavium/zip implementation of the deflate compression algorithm is
> > incorrectly being registered under the generic driver name, which
> > prevents the generic implementation from being registered with the
> > crypto API when CONFIG_CRYPTO_DEV_CAVIUM_ZIP=y. Similarly the lzs
> > algorithm (which does not currently have a generic implementation...)
> > is incorrectly being registered as lzs-generic.
> >
> > Fix the naming collision by adding a suffix "-cavium" to the
> > cra_driver_name of the cavium/zip algorithms.
>
> The patch is fine, basically the same as:
> https://marc.info/?l=linux-crypto-vger&m=152968599829763&w=2
>
> Shouldn't we also rename deflate to deflate generic?
>
> --Jan
>
It is already deflate-generic. Since cra_driver_name is unset,
crypto_set_driver_name() in crypto/algapi.c appends "-generic" to
cra_name = "deflate", forming cra_driver_name = "deflate-generic".
Personally I think that should be gotten rid of and the crypto API should
require that cra_driver_name always be set, but that's what it does now.
> > Fixes: 640035a2dc55 ("crypto: zip - Add ThunderX ZIP driver core")
> > Cc: Mahipal Challa <mahipalreddy2006@gmail.com>
> > Cc: Jan Glauber <jglauber@cavium.com>
> > Signed-off-by: Eric Biggers <ebiggers@google.com>
> > ---
> > drivers/crypto/cavium/zip/zip_main.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/crypto/cavium/zip/zip_main.c b/drivers/crypto/cavium/zip/zip_main.c
> > index e6b09e784e666..a8447a3cf3665 100644
> > --- a/drivers/crypto/cavium/zip/zip_main.c
> > +++ b/drivers/crypto/cavium/zip/zip_main.c
> > @@ -351,6 +351,7 @@ static struct pci_driver zip_driver = {
> >
> > static struct crypto_alg zip_comp_deflate = {
> > .cra_name = "deflate",
> > + .cra_driver_name = "deflate-cavium",
> > .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
> > .cra_ctxsize = sizeof(struct zip_kernel_ctx),
> > .cra_priority = 300,
> > @@ -365,6 +366,7 @@ static struct crypto_alg zip_comp_deflate = {
> >
> > static struct crypto_alg zip_comp_lzs = {
> > .cra_name = "lzs",
> > + .cra_driver_name = "lzs-cavium",
> > .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
> > .cra_ctxsize = sizeof(struct zip_kernel_ctx),
> > .cra_priority = 300,
> > @@ -384,7 +386,7 @@ static struct scomp_alg zip_scomp_deflate = {
> > .decompress = zip_scomp_decompress,
> > .base = {
> > .cra_name = "deflate",
> > - .cra_driver_name = "deflate-scomp",
> > + .cra_driver_name = "deflate-scomp-cavium",
> > .cra_module = THIS_MODULE,
> > .cra_priority = 300,
> > }
> > @@ -397,7 +399,7 @@ static struct scomp_alg zip_scomp_lzs = {
> > .decompress = zip_scomp_decompress,
> > .base = {
> > .cra_name = "lzs",
> > - .cra_driver_name = "lzs-scomp",
> > + .cra_driver_name = "lzs-scomp-cavium",
> > .cra_module = THIS_MODULE,
> > .cra_priority = 300,
> > }
> > --
> > 2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: cavium/zip - fix collision with generic cra_driver_name
2019-02-23 8:23 [PATCH] crypto: cavium/zip - fix collision with generic cra_driver_name Eric Biggers
2019-02-26 7:55 ` Jan Glauber
@ 2019-02-28 6:39 ` Herbert Xu
1 sibling, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2019-02-28 6:39 UTC (permalink / raw)
To: Eric Biggers; +Cc: linux-crypto, Mahipal Challa, Jan Glauber
On Sat, Feb 23, 2019 at 12:23:23AM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> The cavium/zip implementation of the deflate compression algorithm is
> incorrectly being registered under the generic driver name, which
> prevents the generic implementation from being registered with the
> crypto API when CONFIG_CRYPTO_DEV_CAVIUM_ZIP=y. Similarly the lzs
> algorithm (which does not currently have a generic implementation...)
> is incorrectly being registered as lzs-generic.
>
> Fix the naming collision by adding a suffix "-cavium" to the
> cra_driver_name of the cavium/zip algorithms.
>
> Fixes: 640035a2dc55 ("crypto: zip - Add ThunderX ZIP driver core")
> Cc: Mahipal Challa <mahipalreddy2006@gmail.com>
> Cc: Jan Glauber <jglauber@cavium.com>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
> drivers/crypto/cavium/zip/zip_main.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-28 6:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-23 8:23 [PATCH] crypto: cavium/zip - fix collision with generic cra_driver_name Eric Biggers
2019-02-26 7:55 ` Jan Glauber
2019-02-26 22:28 ` Eric Biggers
2019-02-28 6:39 ` Herbert Xu
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.