Skip to content

Commit b8c5d88

Browse files
Pascal van Leeuwenherbertx
authored andcommitted
crypto: inside-secure - Fix stability issue with Macchiatobin
This patch corrects an error in the Transform Record Cache initialization code that was causing intermittent stability problems on the Macchiatobin board. Unfortunately, due to HW platform specifics, the problem could not happen on the main development platform, being the VCU118 Xilinx development board. And since it was a problem with hash table access, it was very dependent on the actual physical context record DMA buffers being used, i.e. with some (bad) luck it could seemingly work quit stable for a while. Signed-off-by: Pascal van Leeuwen <pvanleeuwen@verimatrix.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent ced0a17 commit b8c5d88

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/crypto/inside-secure/safexcel.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ static void eip197_trc_cache_init(struct safexcel_crypto_priv *priv)
221221
/* Step #3: Determine log2 of hash table size */
222222
cs_ht_sz = __fls(asize - cs_rc_max) - 2;
223223
/* Step #4: determine current size of hash table in dwords */
224-
cs_ht_wc = 16<<cs_ht_sz; /* dwords, not admin words */
224+
cs_ht_wc = 16 << cs_ht_sz; /* dwords, not admin words */
225225
/* Step #5: add back excess words and see if we can fit more records */
226-
cs_rc_max = min_t(uint, cs_rc_abs_max, asize - (cs_ht_wc >> 4));
226+
cs_rc_max = min_t(uint, cs_rc_abs_max, asize - (cs_ht_wc >> 2));
227227

228228
/* Clear the cache RAMs */
229229
eip197_trc_cache_clear(priv, cs_rc_max, cs_ht_wc);

0 commit comments

Comments
 (0)