[PATCH] crypto: xilinx: prevent probing on non-xilinx hardware

Herbert Xu herbert at gondor.apana.org.au
Tue Mar 8 19:22:37 PST 2022


On Fri, Mar 04, 2022 at 07:36:48AM +0000, Corentin Labbe wrote:
> The zynqmp-sha driver is always loaded and register its algorithm even on
> platform which do not have the proper hardware.
> This lead to a stacktrace due to zynqmp-sha3-384 failing its crypto
> self tests.
> So check if hardware is present via the firmware API call get_version.
> 
> While at it, simplify the platform_driver by using module_platform_driver()
> 
> Furthermore the driver should depend on ZYNQMP_FIRMWARE since it cannot
> work without it.
> 
> Fixes: 7ecc3e34474b ("crypto: xilinx - Add Xilinx SHA3 driver")
> Signed-off-by: Corentin Labbe <clabbe at baylibre.com>
> ---
>  drivers/crypto/Kconfig             |  2 +-
>  drivers/crypto/xilinx/zynqmp-sha.c | 35 +++++++-----------------------
>  2 files changed, 9 insertions(+), 28 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



More information about the linux-arm-kernel mailing list