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

From: Herbert Xu
Date: Tue Mar 08 2022 - 22:22:57 EST


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@xxxxxxxxxxxx>
> ---
> 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@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt