Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9cca703 authored by Christophe Leroy's avatar Christophe Leroy Committed by Herbert Xu
Browse files

crypto: talitos - Align SEC1 accesses to 32 bits boundaries.



The MPC885 reference manual states:

SEC Lite-initiated 8xx writes can occur only on 32-bit-word boundaries, but
reads can occur on any byte boundary. Writing back a header read from a
non-32-bit-word boundary will yield unpredictable results.

In order to ensure that, cra_alignmask is set to 3 for SEC1.

Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Fixes: 9c4a7965 ("crypto: talitos - Freescale integrated security engine (SEC) driver")
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent eae55a58
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3327,6 +3327,9 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
		alg->cra_priority = t_alg->algt.priority;
	else
		alg->cra_priority = TALITOS_CRA_PRIORITY;
	if (has_ftr_sec1(priv))
		alg->cra_alignmask = 3;
	else
		alg->cra_alignmask = 0;
	alg->cra_ctxsize = sizeof(struct talitos_ctx);
	alg->cra_flags |= CRYPTO_ALG_KERN_DRIVER_ONLY;