crypto: cavium: Fix inverted logic on timeout end check
Subsystems (3)
PATCH 1/1 crypto: cavium: Fix inverted logic on timeout end check
Currently the timeout check will immediately break out of the while loop because timeout-- is always true on the first iteration because timeout was initialized to 100. The check is inverted, it should exit when timeout is zero. Fix this by adding the missing ! operator.
Fixes 9e2c7d99941d ("crypto: cavium - Add Support for Octeon-tx CPT Engine")
Signed-off-by Colin Ian King <[email protected]>
--- drivers/crypto/cavium/cpt/cptpf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/cavium/cpt/cptpf_main.c +1 -1
@@ -44,7 +44,7 @@ static void cpt_disable_cores(struct cpt_device *cpt, u64 coremask,dev_err (dev,"Cores still busy %llx" , coremask); grp =cpt_read_csr64 (cpt->reg_base,CPTX_PF_EXEC_BUSY (0 )); -if (timeout--) +if (!timeout--)break ;udelay (CSR_DELAY );
Signature · 1 line
2.39.5
Quoted 27 lines · Colin Ian King
Currently the timeout check will immediately break out of the while loop because timeout-- is always true on the first iteration because timeout was initialized to 100. The check is inverted, it should exit when timeout is zero. Fix this by adding the missing ! operator.
Fixes 9e2c7d99941d ("crypto: cavium - Add Support for Octeon-tx CPT Engine")Signed-off-by Colin Ian King <[email protected]>--- drivers/crypto/cavium/cpt/cptpf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/crypto/cavium/cpt/cptpf_main.c +1
-2@@ -44,7 +44,7 @@ static void cpt_disable_cores(struct cpt_device *cpt, u64 coremask,dev_err (dev,"Cores still busy %llx" , coremask); grp =cpt_read_csr64 (cpt->reg_base,CPTX_PF_EXEC_BUSY (0 )); -if (timeout--) +if (!timeout--)break ;udelay (CSR_DELAY ); --
Quoted 3 lines
2.39.5
This bug was recently fixed by my patch:
https://lore.kernel.org/all/[email protected]/
Thanks,
Everest K.C.