[PATCH 01/11] crypto: ccp - fix LSB region mask calculation
From: Depei Yang
Date: Wed Nov 25 2026 - 02:46:46 EST
ccp_find_lsb_regions() tests the queue bit of status before shifting the
register by the region width, so region 0 is examined for region 1 and
the last region is never checked. Shift the status before the loop so
that each iteration tests the region it records.
Fixes: 4b394a232df7 ("crypto: ccp - Let a v5 CCP provide the same function as v3")
Cc: stable@xxxxxxxxxxxxxxx
Reviewed-by: Shan Chen <chenshan@xxxxxxxx>
Tested-by: Yongwei Xu <xuyongwei@xxxxxxxx>
Signed-off-by: Depei Yang <yangdepei@xxxxxxxx>
---
drivers/crypto/ccp/ccp-dev-v5.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c
index dacde9614e8a..4a546224af79 100644
--- a/drivers/crypto/ccp/ccp-dev-v5.c
+++ b/drivers/crypto/ccp/ccp-dev-v5.c
@@ -593,6 +593,7 @@ static int ccp_find_lsb_regions(struct ccp_cmd_queue *cmd_q, u64 status)
/* Build a bit mask to know which LSBs this queue has access to.
* Don't bother with segment 0 as it has special privileges.
*/
+ status >>= LSB_REGION_WIDTH;
for (j = 1; j < MAX_LSB_CNT; j++) {
if (status & q_mask)
bitmap_set(cmd_q->lsbmask, j, 1);
--
2.34.1