On Tue, May 20, 2025 at 9:53 AM Olaf Baehring <olaf.baehr...@draeger.com> wrote: > > In rare cases U-Boot returns an error message when intantiating the RNG > of the CAAM device: > “SEC0: RNG4 SH0 instantiation failed with error 0xffffffff” > This means, that even when the CAAM device reports a finished > descriptor, none is found in the output ring. > This might be caused by a missing cache invalidation before > reading the memory of the output ring > This patch moves the cache invalidation of the output ring from start of > the job to immediately after the notification from hardware where the > output ring will be read. > > Signed-off-by: Olaf Baehring <olaf.baehr...@draeger.com> > ---
This patch still has issues and does not apply: ~/denx/u-boot$ ./scripts/checkpatch.pl ~/Downloads/v2-caam-bugfix-CAAM-error-on-startup.patch WARNING: please, no spaces at the start of a line #231: FILE: drivers/crypto/fsl/jr.c:239: + unsigned long start, end;$ ERROR: code indent should use tabs where possible #240: FILE: drivers/crypto/fsl/jr.c:248: + /* Invalidate output ring */$ ERROR: code indent should use tabs where possible #241: FILE: drivers/crypto/fsl/jr.c:249: + start = (unsigned long)jr->output_ring &$ WARNING: please, no spaces at the start of a line #241: FILE: drivers/crypto/fsl/jr.c:249: + start = (unsigned long)jr->output_ring &$ ERROR: code indent should use tabs where possible #242: FILE: drivers/crypto/fsl/jr.c:250: + ~(ARCH_DMA_MINALIGN - 1);$ WARNING: please, no spaces at the start of a line #242: FILE: drivers/crypto/fsl/jr.c:250: + ~(ARCH_DMA_MINALIGN - 1);$ ERROR: code indent should use tabs where possible #243: FILE: drivers/crypto/fsl/jr.c:251: + end = ALIGN((unsigned long)jr->output_ring$ WARNING: please, no spaces at the start of a line #243: FILE: drivers/crypto/fsl/jr.c:251: + end = ALIGN((unsigned long)jr->output_ring$ ERROR: code indent should use tabs where possible #244: FILE: drivers/crypto/fsl/jr.c:252: + + jr->op_size, ARCH_DMA_MINALIGN);$ WARNING: please, no spaces at the start of a line #244: FILE: drivers/crypto/fsl/jr.c:252: + + jr->op_size, ARCH_DMA_MINALIGN);$ ERROR: code indent should use tabs where possible #245: FILE: drivers/crypto/fsl/jr.c:253: + invalidate_dcache_range(start, end);$ WARNING: please, no spaces at the start of a line #245: FILE: drivers/crypto/fsl/jr.c:253: + invalidate_dcache_range(start, end);$ ERROR: code indent should use tabs where possible #255: FILE: drivers/crypto/fsl/jr.c:288: + if (!found) {$ WARNING: please, no spaces at the start of a line #255: FILE: drivers/crypto/fsl/jr.c:288: + if (!found) {$ WARNING: suspect code indent for conditional statements (15, 23) #255: FILE: drivers/crypto/fsl/jr.c:288: + if (!found) { + int slots_full = sec_in32(®s->orsf); ERROR: code indent should use tabs where possible #256: FILE: drivers/crypto/fsl/jr.c:289: + int slots_full = sec_in32(®s->orsf);$ WARNING: please, no spaces at the start of a line #256: FILE: drivers/crypto/fsl/jr.c:289: + int slots_full = sec_in32(®s->orsf);$ ERROR: code indent should use tabs where possible #258: FILE: drivers/crypto/fsl/jr.c:291: + jr->tail = (jr->tail + slots_full) & (jr->size - 1);$ WARNING: please, no spaces at the start of a line #258: FILE: drivers/crypto/fsl/jr.c:291: + jr->tail = (jr->tail + slots_full) & (jr->size - 1);$ ERROR: code indent should use tabs where possible #259: FILE: drivers/crypto/fsl/jr.c:292: + sec_out32(®s->orjr, slots_full);$ WARNING: please, no spaces at the start of a line #259: FILE: drivers/crypto/fsl/jr.c:292: + sec_out32(®s->orjr, slots_full);$ ERROR: code indent should use tabs where possible #261: FILE: drivers/crypto/fsl/jr.c:294: + }$ WARNING: please, no spaces at the start of a line #261: FILE: drivers/crypto/fsl/jr.c:294: + }$ ERROR: code indent should use tabs where possible #269: FILE: drivers/crypto/fsl/jr.c:301: + * tail till the point where job completed out of order has$ WARNING: suspect code indent for conditional statements (23, 31) #273: FILE: drivers/crypto/fsl/jr.c:305: do { + jr->info[tail].op_done = 0; ERROR: code indent should use tabs where possible #274: FILE: drivers/crypto/fsl/jr.c:306: + jr->info[tail].op_done = 0;$ WARNING: please, no spaces at the start of a line #274: FILE: drivers/crypto/fsl/jr.c:306: + jr->info[tail].op_done = 0;$ total: 13 errors, 14 warnings, 0 checks, 87 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. NOTE: Whitespace errors detected. You may wish to use scripts/cleanpatch or scripts/cleanfile /home/fabio/Downloads/v2-caam-bugfix-CAAM-error-on-startup.patch has style problems, please review. NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO ENOSYS MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE PREFER_ETHER_ADDR_COPY USLEEP_RANGE NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. ~/denx/u-boot$ git am ~/Downloads/v2-caam-bugfix-CAAM-error-on-startup.patch fatal: previous rebase directory .git/rebase-apply still exists but mbox given. ~/denx/u-boot$ rm -rf .git/rebase-apply/ ~/denx/u-boot$ git am ~/Downloads/v2-caam-bugfix-CAAM-error-on-startup.patch Applying: caam: bugfix CAAM error on startup error: patch failed: drivers/crypto/fsl/jr.c:217 error: drivers/crypto/fsl/jr.c: patch does not apply error: patch failed: drivers/crypto/fsl/jr.h:83 error: drivers/crypto/fsl/jr.h: patch does not apply Patch failed at 0001 caam: bugfix CAAM error on startup hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". > This communication contains confidential information. If you are not the > intended recipient please return this email to the sender and delete it from > your records. > > Diese Nachricht enthaelt vertrauliche Informationen. Sollten Sie nicht der > beabsichtigte Empfaenger dieser E-mail sein, senden Sie bitte diese an den > Absender zurueck und loeschen Sie die E-mail aus Ihrem System. Please remove this part. For v3, make sure you can apply the patch without error.