All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini via U-Boot <u-boot@lists.u-boot-project.org>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Svyatoslav Ryhel <clamor95@gmail.com>,
	Ion Agorria <ion@agorria.com>,
	u-boot@lists.denx.de, Aspeed BMC SW team <BMC-SW@aspeedtech.com>,
	Joel Stanley <joel@jms.id.au>, Chen-Yu Tsai <wens@kernel.org>,
	Samuel Holland <samuel@sholland.org>,
	Simon Glass <sjg@chromium.org>,
	Thierry Reding <treding@nvidia.com>,
	Quentin Schulz <quentin.schulz@cherry.de>,
	Quentin Schulz <u-boot@0leil.net>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Marek Vasut <marek.vasut@mailbox.org>,
	Rasmus Villemoes <ravi@prevas.dk>,
	Rasmus Villemoes <rv@rasmusvillemoes.dk>,
	Aristo Chen <aristo.chen@canonical.com>,
	Anton Ivanov <anton@binarly.io>,
	Daniel Golle <daniel@makrotopia.org>,
	Francois Berder <fberder@outlook.fr>, Peng Fan <peng.fan@nxp.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Randolph Sapp <rs@ti.com>, Jonas Karlman <jonas@kwiboo.se>,
	Wolfgang Wallner <wolfgang.wallner@at.abb.com>,
	Alexey Charkov <alchark@gmail.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Heiko Schocher <hs@nabladev.com>,
	"Kory Maincent (TI.com)" <kory.maincent@bootlin.com>,
	Anshul Dalal <anshuld@ti.com>, Johan Jonker <jbx6244@gmail.com>,
	Francesco Valla <francesco@valla.it>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Michael Walle <mwalle@kernel.org>,
	Andre Przywara <andre.przywara@arm.com>,
	Lukasz Majewski <lukma@denx.de>,
	Richard Genoud <richard.genoud@bootlin.com>,
	Michael Trimarchi <michael@amarulasolutions.com>,
	E Shattow <e@freeshell.de>,
	Enric Balletbo i Serra <eballetbo@kernel.org>,
	Mattijs Korpershoek <mkorpershoek@kernel.org>,
	Lucas Dietrich <ld.adecy@gmail.com>,
	David Lechner <dlechner@baylibre.com>,
	Julien Stephan <jstephan@baylibre.com>,
	Kuan-Wei Chiu <visitorckw@gmail.com>,
	Bastien Curutchet <bastien.curutchet@bootlin.com>,
	Raymond Mao <raymond.mao@riscstar.com>,
	Ryan Chen <ryan_chen@aspeedtech.com>,
	Chia-Wei Wang <chiawei_wang@aspeedtech.com>,
	"Lucien.Jheng" <lucienzx159@gmail.com>,
	Mateusz Furdyna <mateusz.furdyna@nokia.com>,
	Dinesh Maniyam <dinesh.maniyam@altera.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Vincent Jardin <vjardin@free.fr>
Subject: Re: [PATCH v5 02/14] crypto: hash: use DM providers from hash command
Date: Mon, 20 Jul 2026 17:24:09 -0600	[thread overview]
Message-ID: <20260720232409.GN749385@bill-the-cat> (raw)
In-Reply-To: <20260719-submit-ce-series-v2-v5-2-3c41f66d4522@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2722 bytes --]

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 <james.hilliard1@gmail.com>
> ---
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-07-20 23:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20  4:13 [PATCH v5 00/14] crypto: allwinner: enable sun8i-ce FIT crypto James Hilliard
2026-07-20  4:13 ` [PATCH v5 01/14] cmd: aes: fix DM operation handling James Hilliard
2026-07-20  4:13 ` [PATCH v5 02/14] crypto: hash: use DM providers from hash command James Hilliard
2026-07-20 23:24   ` Tom Rini via U-Boot [this message]
2026-07-22 14:20     ` James Hilliard
2026-07-28 19:41     ` James Hilliard
2026-07-28 23:54       ` Tom Rini
2026-07-20  4:13 ` [PATCH v5 03/14] crypto: aes: allow DM AES in SPL James Hilliard
2026-07-20 23:26   ` Tom Rini via U-Boot
2026-07-20  4:13 ` [PATCH v5 04/14] crypto: hash: allow DM hash " James Hilliard
2026-07-20 23:30   ` Tom Rini via U-Boot
2026-07-22 14:21     ` James Hilliard
2026-07-22 16:25       ` Tom Rini
2026-07-20  4:13 ` [PATCH v5 05/14] boot: image: try all DM hash providers James Hilliard
2026-07-28 11:21   ` Simon Glass
2026-07-20  4:13 ` [PATCH v5 06/14] crypto: aes: fix software key-size handling James Hilliard
2026-07-28 11:22   ` Simon Glass
2026-07-20  4:13 ` [PATCH v5 07/14] crypto: aes: add software-key provider dispatch James Hilliard
2026-07-28 11:23   ` Simon Glass
2026-07-20  4:13 ` [PATCH v5 08/14] boot: image: add FIT decrypt-to-buffer helper James Hilliard
2026-07-28 11:25   ` Simon Glass
2026-07-20  4:13 ` [PATCH v5 09/14] spl: fit: support encrypted payloads James Hilliard
2026-07-20  4:13 ` [PATCH v5 10/14] clk: sunxi: add H6/H616 CE gates and reset James Hilliard
2026-07-20  4:13 ` [PATCH v5 11/14] lib: ecdsa: support additional curve sizes James Hilliard
2026-07-20  4:13 ` [PATCH v5 12/14] crypto: allwinner: add sun8i-ce AES driver James Hilliard
2026-07-20  4:13 ` [PATCH v5 13/14] crypto: allwinner: add sun8i-ce ECDSA verifier James Hilliard
2026-07-28 11:25   ` Simon Glass
2026-07-20  4:13 ` [PATCH v5 14/14] crypto: allwinner: add sun8i-ce hash driver James Hilliard
2026-07-28 11:25   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260720232409.GN749385@bill-the-cat \
    --to=u-boot@lists.u-boot-project.org \
    --cc=BMC-SW@aspeedtech.com \
    --cc=alchark@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=anshuld@ti.com \
    --cc=anton@binarly.io \
    --cc=aristo.chen@canonical.com \
    --cc=bastien.curutchet@bootlin.com \
    --cc=chiawei_wang@aspeedtech.com \
    --cc=clamor95@gmail.com \
    --cc=daniel@makrotopia.org \
    --cc=dinesh.maniyam@altera.com \
    --cc=dlechner@baylibre.com \
    --cc=e@freeshell.de \
    --cc=eballetbo@kernel.org \
    --cc=fberder@outlook.fr \
    --cc=francesco@valla.it \
    --cc=heiko@sntech.de \
    --cc=hs@nabladev.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=ion@agorria.com \
    --cc=james.hilliard1@gmail.com \
    --cc=jbx6244@gmail.com \
    --cc=joel@jms.id.au \
    --cc=jonas@kwiboo.se \
    --cc=jstephan@baylibre.com \
    --cc=kory.maincent@bootlin.com \
    --cc=ld.adecy@gmail.com \
    --cc=lucienzx159@gmail.com \
    --cc=lukma@denx.de \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=marek.vasut@mailbox.org \
    --cc=mateusz.furdyna@nokia.com \
    --cc=michael@amarulasolutions.com \
    --cc=mkorpershoek@kernel.org \
    --cc=mwalle@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=peng.fan@nxp.com \
    --cc=quentin.schulz@cherry.de \
    --cc=ravi@prevas.dk \
    --cc=raymond.mao@riscstar.com \
    --cc=richard.genoud@bootlin.com \
    --cc=rs@ti.com \
    --cc=rv@rasmusvillemoes.dk \
    --cc=ryan_chen@aspeedtech.com \
    --cc=samuel@sholland.org \
    --cc=sjg@chromium.org \
    --cc=treding@nvidia.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@0leil.net \
    --cc=u-boot@lists.denx.de \
    --cc=visitorckw@gmail.com \
    --cc=vjardin@free.fr \
    --cc=wens@kernel.org \
    --cc=wolfgang.wallner@at.abb.com \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.