On Sun, Jul 19, 2026 at 10:13:46PM -0600, James Hilliard wrote: > The hash command currently always uses the software implementation for > the selected algorithm, even when driver-model hash providers are > available. > > Add a hash_digest_wd_lookup() helper which probes UCLASS_HASH devices in > order and uses the first provider supporting the requested algorithm. > Continue past unavailable providers and unsupported operations, but > propagate a hard digest failure once a provider accepts the operation. > Remember probe failures so they are not silently hidden by software > fallback when no later provider succeeds. > > Use the helper from the hash command and retain its software fallback > when no usable provider is present. Add sandbox tests covering provider > fallback and hard-error propagation. > > Signed-off-by: James Hilliard <[email protected]> > --- > Changes v3 -> v4: > - New patch > - Try all registered hash providers instead of only device zero > - Add provider-selection and error-propagation tests > - Reserve -EINVAL for hard errors > - Use -EOPNOTSUPP for unsupported algorithms
Putting new features in an unrelated patch series makes things harder to
merge. I don't know that Andre will be comfortable taking some generic
changes + sunxi support, but he might be. But it's even easier when
something like this is standalone and can be reviewed and picked up on
its own (I'm going to have some size questions about this, once I review
it globally..).
[snip]
> diff --git a/drivers/crypto/hash/hash-uclass.c
> b/drivers/crypto/hash/hash-uclass.c
> index 5d9f1e0d59b..30929412856 100644
> --- a/drivers/crypto/hash/hash-uclass.c
> +++ b/drivers/crypto/hash/hash-uclass.c
> @@ -73,8 +73,8 @@ int hash_digest(struct udevice *dev, enum HASH_ALGO algo,
> }
>
> int hash_digest_wd(struct udevice *dev, enum HASH_ALGO algo,
> - const void *ibuf, const uint32_t ilen,
> - void *obuf, uint32_t chunk_sz)
> + const void *ibuf, const uint32_t ilen,
> + void *obuf, uint32_t chunk_sz)
> {
> struct hash_ops *ops = (struct hash_ops *)device_get_ops(dev);
>
This isn't correct spacing before, or after? So as part of sending this
standlone this part should just be dropped I believe.
[snip]
> @@ -29,8 +31,26 @@ int hash_digest(struct udevice *dev, enum HASH_ALGO algo,
> const void *ibuf, const uint32_t ilen,
> void *obuf);
> int hash_digest_wd(struct udevice *dev, enum HASH_ALGO algo,
> - const void *ibuf, const uint32_t ilen,
> - void *obuf, uint32_t chunk_sz);
> + const void *ibuf, const uint32_t ilen,
> + void *obuf, uint32_t chunk_sz);
Same here.
--
Tom
signature.asc
Description: PGP signature
