Re: [PATCH v2] crypto: stm32 - remove crc32 and crc32c support
From: Arnd Bergmann
Date: Wed Jun 04 2025 - 04:39:13 EST
On Sun, Jun 1, 2025, at 21:34, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@xxxxxxxxxx>
>
> Remove the crc32 and crc32c support from the stm32 driver. Since it's
> not wired up to the CRC library, almost no CRC user in the kernel can
> actually be taking advantage of it, so it's effectively dead code.
>
> Support for this hardware could be migrated to the CRC library, but
> there doesn't seem to be much point. This CRC engine is present only on
> a couple older SoCs that lacked CRC instructions.
>
> Even on those SoCs, it's probably not worthwhile. This driver has to
> deal with things like locking and runtime power management that do not
> exist in software CRC code and are a source of bugs (as is clear from
> the commit log) and add significant overhead to the processing of short
> messages, which are common. The patch that originally added this driver
> seemed to justify it based purely on a microbenchmark on Cortex-M7 on
> long messages, not a real use case. These days, if this driver were to
> be used at all it would likely be on Cortex-A7 instead. This CRC engine
> is also not supported by QEMU, making the driver not easily testable.
>
> Acked-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
Acked-by: Arnd Bergmann <arnd@xxxxxxxx>
As far as I can tell, the CRC unit was present on the original
24 MHz STM32F1 (Cortex-M3), where it probably had some merit, and
later chips including the STM32MP1 (Cortex-A7) just incorporated
the block for compatibility.
Arnd