phy: brcm-sata: fix a timeout test in init
Subsystems (2)
PATCH 1/1 phy: brcm-sata: fix a timeout test in init
We want to timeout with try set to zero so this should be a pre-op instead of post-op.
drivers/phy/broadcom/phy-brcm-sata.c +1 -1
@@ -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 )
Quoted 10 lines · Dan Carpenter
We want to timeout with try set to zero so this should be a pre-op instead of post-op.
Signed-off-by Dan Carpenter <[email protected]>drivers/phy/broadcom/phy-brcm-sata.c +0
-0
drivers/phy/broadcom/phy-brcm-sata.c static int brcm_nsp_sata_init(struct brcm_sata_port *port) · line 332
Quoted 5 lines
drivers/phy/broadcom/phy-brcm-sata.c +1
-1@@ -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) {
Do we want to try reading the status 50 times? If yes, won't your change break that? It will rather run the loop 49 times.
Thanks
Vivek
Quoted 3 lines
drivers/phy/broadcom/phy-brcm-sata.c +0
-0val =brcm_sata_phy_rd (base,BLOCK0_REG_BANK ,BLOCK0_XGXSSTATUS );if (val &BLOCK0_XGXSSTATUS_PLL_LOCK )
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Quoted 8 lines · Vivek Gautam
Quoted 5 lines · Dan Carpenter
We want to timeout with try set to zero so this should be a pre-op instead of post-op.
Signed-off-by Dan Carpenter <[email protected]>
Quoted 13 lines
drivers/phy/broadcom/phy-brcm-sata.c static int brcm_nsp_sata_init(struct brcm_sata_port *port) · line 331
Quoted 9 lines
drivers/phy/broadcom/phy-brcm-sata.c +1
-1@@ -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) {Do we want to try reading the status 50 times? If yes, won't your change break that? It will rather run the loop 49 times.
Yeah. I know. I'm pretty sure that 50 is a rough number, and not an exact thing.
regards,
dan carpenter
Quoted 20 lines · Dan Carpenter
Quoted 7 lines · Vivek Gautam
Quoted 5 lines · Dan Carpenter
We want to timeout with try set to zero so this should be a pre-op instead of post-op.
Signed-off-by Dan Carpenter <[email protected]>Quoted 12 lines
drivers/phy/broadcom/phy-brcm-sata.c static int brcm_nsp_sata_init(struct brcm_sata_port *port) · line 331
Quoted 9 lines
drivers/phy/broadcom/phy-brcm-sata.c +1
-1@@ -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) {Do we want to try reading the status 50 times? If yes, won't your change break that? It will rather run the loop 49 times.
Quoted 2 lines
Yeah. I know. I'm pretty sure that 50 is a rough number, and not an exact thing.
Right, I agree that this must be rough count.
nice catch btw.
Best regards
Vivek
Quoted 4 lines
regards,
dan carpenter
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project