Hi Tim,

On Thu, May 29, 2025 at 6:39 PM Tim Harvey <thar...@gateworks.com> wrote:

> I've found that this patch causes a regression on an imx8mm board
> (imx8mm_venice_defconfig) where the first call to caam_rng_read fails
> here in jr_dequeue but if you call it again it works. With some
> debugging added:
> SEC0:  RNG instantiated
> ...
> Hit any key to stop autoboot:  0
> u-boot=> rng list
> RNG #0 - caam-rng
> u-boot=> rng 0 10
> caam_rng_read caam-rng len=16
> run_descriptor_jr_idx idx=0
> Error in SEC deq: -1
> caam_rng_read_one run_descriptor_jr failed: -1
> caam_rng_read caam-rng caam_rng_read_one failed: -5
> Reading RNG failed
> u-boot=> rng 0 10
> caam_rng_read caam-rng len=16
> run_descriptor_jr_idx idx=0
> 00000000: ad 2e ad c0 2a 12 27 c4 65 82 66 19 be ef f6 07  ....*.'.e.f.....
>
> If I revert your patch caam_rng_read works initially and on subsequent calls.

Thanks for the report.

On an imx8mm_evk board, I see:

u-boot=> rng 0 10
Reading RNG failed
u-boot=> rng 0 10
00000000: 27 42 f0 b8 92 c8 ca 29 6f 6a c3 98 ff 61 2b ae  'B.....)oj...a+.
u-boot=> rng 0 10
00000000: 48 fb 52 44 29 ea 83 f9 a4 1d 68 20 82 c5 af b5  H.RD).....h ....
u-boot=> rng 0 10
00000000: 92 63 76 fc 1c 12 4b cd 68 50 8c fa 2b 51 21 50  .cv...K.hP..+Q!P
u-boot=> rng 0 10

(always hang in the fifth attempt)

With the path reverted, it always works:

u-boot=> rng 0 10
00000000: b4 14 26 f8 1f 78 65 b2 8f 0a a6 c4 6b 47 f5 61  ..&..xe.....kG.a
u-boot=> rng 0 10
00000000: 6e 5f 7c fa 13 d2 b7 b5 cf 5d 3d e6 82 c7 a6 3e  n_|......]=....>
u-boot=> rng 0 10
00000000: 25 84 1b 86 89 ae 20 a8 a2 53 9a 7a 8a a5 6d 45  %..... ..S.z..mE
u-boot=> rng 0 10
00000000: 94 05 b6 7c a4 38 5a 89 0b 5b 38 86 61 ba d0 32  ...|.8Z..[8.a..2
u-boot=> rng 0 10
00000000: 57 c2 36 dc eb 68 3b c3 f5 1b f9 76 3c a6 1b d5  W.6..h;....v<...
u-boot=> rng 0 10
00000000: 2a 34 95 03 27 75 d3 9e 75 1b 99 0d 25 87 78 1a  *4..'u..u...%.x.
u-boot=> rng 0 10
00000000: 4e e4 b8 ca 97 91 c8 53 67 85 28 51 a1 11 39 3d  N......Sg.(Q..9=
u-boot=> rng 0 10
00000000: 30 fb 41 d7 a7 18 63 64 8a 9f 37 84 b3 bd 57 dc  0.A...cd..7...W.
u-boot=> rng 0 10
00000000: 9b 5e 46 89 5c 59 5c 85 30 e4 58 be 56 7b 20 31  .^F.\Y\.0.X.V{ 1
u-boot=> rng 0 10
00000000: c9 41 27 73 f8 8e 33 65 ca bb bb c1 b1 b7 7b a3  .A's..3e......{.
u-boot=> rng 0 10
00000000: f2 9f 8e 26 b6 93 4e 24 71 18 3f 72 2a 19 20 ef  ...&..N$q.?r*. .
u-boot=> rng 0 10
00000000: 1d c2 5e 55 ec 27 d7 5f 2b 65 a1 46 e4 2a 55 a5  ..^U.'._+e.F.*U.
u-boot=>

I will wait for Olaf to submit a fix for this issue.

Otherwise, we will have to revert the patch.

Reply via email to