Skip to contentSkip to conversation

liquidio: CN23XX: fix a loop timeout

PATCH Applied Dan Carpenter 2 participants 2 messages Oct 13, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 liquidio: CN23XX: fix a loop timeout

This is supposed to loop 1000 times and then give up. The problem is it's a post-op and after the loop we test if "loop" is zero when really it would be -1. Fix this by making it a pre-op.

Fixes 1b7c55c4538b ("liquidio: CN23XX queue manipulation")
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c +1 -1
index bddb198..380a641 100644
@@ -693,7 +693,7 @@ static int cn23xx_enable_io_queues(struct octeon_device *oct)
 				while ((reg_val & CN23XX_PKT_INPUT_CTL_RST) &&
 				       !(reg_val &
 					 CN23XX_PKT_INPUT_CTL_QUIET) &&
-				       loop--) {
+				       --loop) {
 					reg_val = octeon_read_csr64(
 					    oct,
 					    CN23XX_SLI_IQ_PKT_CONTROL64(q_no));
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Thu, 13 Oct 2016 11:56:57 +0300

Quoted 6 lines

This is supposed to loop 1000 times and then give up. The problem is it's a post-op and after the loop we test if "loop" is zero when really it would be -1. Fix this by making it a pre-op.

Fixes 1b7c55c4538b ("liquidio: CN23XX queue manipulation")

Applied, thanks Dan.