Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643908 > unrolled thread

[PATCH] phy: phy-brcm-sata: Fix a loop timeout

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2017-05-18 09:50 +0200
Last post2017-05-18 09:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] phy: phy-brcm-sata: Fix a loop timeout Dan Carpenter <dan.carpenter@oracle.com> - 2017-05-18 09:50 +0200

#1643908 — [PATCH] phy: phy-brcm-sata: Fix a loop timeout

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-05-18 09:50 +0200
Subject[PATCH] phy: phy-brcm-sata: Fix a loop timeout
Message-ID<tIom5-7a7-1@gated-at.bofh.it>
We expect to timeout with "try" set to zero but it's a post-op so
actually it ends with it set to -1.  I've fixed this by changing it to a
pre-op.

Fixes: 024812889ad1 ("phy: Add SATA3 PHY support for Broadcom NSP SoC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/phy/broadcom/phy-brcm-sata.c b/drivers/phy/broadcom/phy-brcm-sata.c
index ccbc3d994998..48fb016ce689 100644
--- a/drivers/phy/broadcom/phy-brcm-sata.c
+++ b/drivers/phy/broadcom/phy-brcm-sata.c
@@ -329,7 +329,7 @@ static int brcm_nsp_sata_init(struct brcm_sata_port *port)
 
 	/* Wait for pll_seq_done bit */
 	try = 50;
-	while (try--) {
+	while (--try) {
 		val = brcm_sata_phy_rd(base, BLOCK0_REG_BANK,
 					BLOCK0_XGXSSTATUS);
 		if (val & BLOCK0_XGXSSTATUS_PLL_LOCK)

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web