]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: ccp - Check for CCP before registering crypto algs
authorTom Lendacky <thomas.lendacky@amd.com>
Fri, 5 Sep 2014 15:31:09 +0000 (10:31 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 20:41:09 +0000 (13:41 -0700)
commitde65ff5b13c766494c6a85c679e82377cf1bea9d
tree414a1526709313d8d9ac3a065187c891a24d2d60
parent526d1f369185226566cdc5718650006e8e6fff73
crypto: ccp - Check for CCP before registering crypto algs

commit c9f21cb6388898bfe69886d001316dae7ecc9a4b upstream.

If the ccp is built as a built-in module, then ccp-crypto (whether
built as a module or a built-in module) will be able to load and
it will register its crypto algorithms.  If the system does not have
a CCP this will result in -ENODEV being returned whenever a command
is attempted to be queued by the registered crypto algorithms.

Add an API, ccp_present(), that checks for the presence of a CCP
on the system.  The ccp-crypto module can use this to determine if it
should register it's crypto alogorithms.

Reported-by: Scot Doyle <lkml14@scotdoyle.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Tested-by: Scot Doyle <lkml14@scotdoyle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/ccp/ccp-crypto-main.c
drivers/crypto/ccp/ccp-dev.c
include/linux/ccp.h