netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] liquidio: CN23XX: fix a loop timeout
@ 2016-10-13  8:56 Dan Carpenter
  2016-10-13 16:13 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-10-13  8:56 UTC (permalink / raw)
  To: Derek Chickles, Raghu Vatsavayi
  Cc: Satanand Burla, Felix Manlunas, netdev, kernel-janitors

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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
index bddb198..380a641 100644
--- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
+++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
@@ -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));

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] liquidio: CN23XX: fix a loop timeout
  2016-10-13  8:56 [patch] liquidio: CN23XX: fix a loop timeout Dan Carpenter
@ 2016-10-13 16:13 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-10-13 16:13 UTC (permalink / raw)
  To: dan.carpenter
  Cc: derek.chickles, raghu.vatsavayi, satananda.burla, felix.manlunas,
	netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 13 Oct 2016 11:56:57 +0300

> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks Dan.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-13 16:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13  8:56 [patch] liquidio: CN23XX: fix a loop timeout Dan Carpenter
2016-10-13 16:13 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).