From 8f0e7799d8212a0318329d1ab46d4f63477d3a30 Mon Sep 17 00:00:00 2001 From: Gaurav Kashyap Date: Fri, 16 Jun 2023 10:13:05 -0700 Subject: [PATCH] qcedev: check correct status for no error No error status is reflected in multiple ways in the status register. Check both values or else, there might be timing issues. Change-Id: I82ecdb77d8127b076e12495fea104cb0fffe65bc Signed-off-by: Gaurav Kashyap --- crypto-qti/qce50.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto-qti/qce50.c b/crypto-qti/qce50.c index 46e2f85122..f2a8de58f2 100644 --- a/crypto-qti/qce50.c +++ b/crypto-qti/qce50.c @@ -86,7 +86,8 @@ static LIST_HEAD(qce50_bam_list); #define AES_CTR_IV_CTR_SIZE 64 -#define QCE_STATUS1_NO_ERROR 0x2000006 +#define QCE_NO_ERROR_VAL1 0x2000006 +#define QCE_NO_ERROR_VAL2 0x2000004 // Crypto Engines 5.7 and below // Key timer expiry for pipes 1-15 (Status3) @@ -247,7 +248,7 @@ void qce_get_crypto_status(void *handle, struct qce_error *error) dump_status_regs(status); #endif - if (status[0] != QCE_STATUS1_NO_ERROR || status[1]) { + if (status[0] != QCE_NO_ERROR_VAL1 && status[0] != QCE_NO_ERROR_VAL2) { if (pce_dev->ce_bam_info.minor_version >= 8) { if (status[2] & CRYPTO58_TIMER_EXPIRED) { error->timer_error = true;