Commit 98a6ffadeade0e42ac70cfc57b810382b961b7d0

Authored by Breno Lima
Committed by Ye Li
1 parent d1515ca9cd

MLK-21420 crypto: fsl: blob: Flush dcache range for destination address

The blob command is not working on i.MX7D, i.MX8MQ and i.MX8MM
devices.

Due to different cache management it's necessary to flush dcache
range for destination address so data can be available in memory.

Add necessary operations in blob_encap() and blob_decap() functions.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 639e5c15816c3eea0d4904a72ad175627be043d8)

Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff

drivers/crypto/fsl/fsl_blob.c
... ... @@ -63,6 +63,9 @@
63 63 flush_dcache_range((unsigned long)desc,
64 64 (unsigned long)desc + size);
65 65  
  66 + flush_dcache_range((unsigned long)dst,
  67 + (unsigned long)dst + size);
  68 +
66 69 ret = run_descriptor_jr(desc);
67 70  
68 71 if (ret) {
... ... @@ -127,6 +130,9 @@
127 130 size = ALIGN(sizeof(int) * MAX_CAAM_DESCSIZE, ARCH_DMA_MINALIGN);
128 131 flush_dcache_range((unsigned long)desc,
129 132 (unsigned long)desc + size);
  133 +
  134 + flush_dcache_range((unsigned long)dst,
  135 + (unsigned long)dst + size);
130 136  
131 137 ret = run_descriptor_jr(desc);
132 138