* [PATCH] phy: brcm-sata: fix a timeout test in init
@ 2017-06-19 10:56 ` Dan Carpenter
0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2017-06-19 10:56 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: Vivek Gautam, Yendapally Reddy Dhananjaya Reddy, Heiko Stuebner,
Florian Fainelli, Axel Lin, linux-kernel, kernel-janitors
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 <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)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] phy: brcm-sata: fix a timeout test in init
@ 2017-06-19 10:56 ` Dan Carpenter
0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2017-06-19 10:56 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: Vivek Gautam, Yendapally Reddy Dhananjaya Reddy, Heiko Stuebner,
Florian Fainelli, Axel Lin, linux-kernel, kernel-janitors
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 <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)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: brcm-sata: fix a timeout test in init
2017-06-19 10:56 ` Dan Carpenter
@ 2017-06-20 8:38 ` Vivek Gautam
-1 siblings, 0 replies; 8+ messages in thread
From: Vivek Gautam @ 2017-06-20 8:26 UTC (permalink / raw)
To: Dan Carpenter, Kishon Vijay Abraham I
Cc: Yendapally Reddy Dhananjaya Reddy, Heiko Stuebner,
Florian Fainelli, Axel Lin, linux-kernel, kernel-janitors
On 06/19/2017 04:26 PM, Dan Carpenter wrote:
> 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 <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) {
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
> val = brcm_sata_phy_rd(base, BLOCK0_REG_BANK,
> BLOCK0_XGXSSTATUS);
> if (val & BLOCK0_XGXSSTATUS_PLL_LOCK)
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: brcm-sata: fix a timeout test in init
@ 2017-06-20 8:38 ` Vivek Gautam
0 siblings, 0 replies; 8+ messages in thread
From: Vivek Gautam @ 2017-06-20 8:38 UTC (permalink / raw)
To: Dan Carpenter, Kishon Vijay Abraham I
Cc: Yendapally Reddy Dhananjaya Reddy, Heiko Stuebner,
Florian Fainelli, Axel Lin, linux-kernel, kernel-janitors
On 06/19/2017 04:26 PM, Dan Carpenter wrote:
> 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 <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) {
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
> val = brcm_sata_phy_rd(base, BLOCK0_REG_BANK,
> BLOCK0_XGXSSTATUS);
> if (val & BLOCK0_XGXSSTATUS_PLL_LOCK)
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: brcm-sata: fix a timeout test in init
2017-06-20 8:38 ` Vivek Gautam
@ 2017-06-20 8:42 ` Dan Carpenter
-1 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2017-06-20 8:42 UTC (permalink / raw)
To: Vivek Gautam
Cc: Kishon Vijay Abraham I, Yendapally Reddy Dhananjaya Reddy,
Heiko Stuebner, Florian Fainelli, Axel Lin, linux-kernel,
kernel-janitors
On Tue, Jun 20, 2017 at 01:56:35PM +0530, Vivek Gautam wrote:
>
>
> On 06/19/2017 04:26 PM, Dan Carpenter wrote:
> > 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 <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) {
>
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: brcm-sata: fix a timeout test in init
@ 2017-06-20 8:42 ` Dan Carpenter
0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2017-06-20 8:42 UTC (permalink / raw)
To: Vivek Gautam
Cc: Kishon Vijay Abraham I, Yendapally Reddy Dhananjaya Reddy,
Heiko Stuebner, Florian Fainelli, Axel Lin, linux-kernel,
kernel-janitors
On Tue, Jun 20, 2017 at 01:56:35PM +0530, Vivek Gautam wrote:
>
>
> On 06/19/2017 04:26 PM, Dan Carpenter wrote:
> > 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 <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) {
>
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: brcm-sata: fix a timeout test in init
2017-06-20 8:42 ` Dan Carpenter
@ 2017-06-20 8:57 ` Vivek Gautam
-1 siblings, 0 replies; 8+ messages in thread
From: Vivek Gautam @ 2017-06-20 8:56 UTC (permalink / raw)
To: Dan Carpenter
Cc: Kishon Vijay Abraham I, Yendapally Reddy Dhananjaya Reddy,
Heiko Stuebner, Florian Fainelli, Axel Lin, linux-kernel,
kernel-janitors
On 06/20/2017 02:12 PM, Dan Carpenter wrote:
> On Tue, Jun 20, 2017 at 01:56:35PM +0530, Vivek Gautam wrote:
>>
>> On 06/19/2017 04:26 PM, Dan Carpenter wrote:
>>> 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 <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) {
>> 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.
Right, I agree that this must be rough count.
nice catch btw.
Best regards
Vivek
>
> regards,
> dan carpenter
>
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] phy: brcm-sata: fix a timeout test in init
@ 2017-06-20 8:57 ` Vivek Gautam
0 siblings, 0 replies; 8+ messages in thread
From: Vivek Gautam @ 2017-06-20 8:57 UTC (permalink / raw)
To: Dan Carpenter
Cc: Kishon Vijay Abraham I, Yendapally Reddy Dhananjaya Reddy,
Heiko Stuebner, Florian Fainelli, Axel Lin, linux-kernel,
kernel-janitors
On 06/20/2017 02:12 PM, Dan Carpenter wrote:
> On Tue, Jun 20, 2017 at 01:56:35PM +0530, Vivek Gautam wrote:
>>
>> On 06/19/2017 04:26 PM, Dan Carpenter wrote:
>>> 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 <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) {
>> 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.
Right, I agree that this must be rough count.
nice catch btw.
Best regards
Vivek
>
> regards,
> dan carpenter
>
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-06-20 8:57 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-19 10:56 [PATCH] phy: brcm-sata: fix a timeout test in init Dan Carpenter
2017-06-19 10:56 ` Dan Carpenter
2017-06-20 8:26 ` Vivek Gautam
2017-06-20 8:38 ` Vivek Gautam
2017-06-20 8:42 ` Dan Carpenter
2017-06-20 8:42 ` Dan Carpenter
2017-06-20 8:56 ` Vivek Gautam
2017-06-20 8:57 ` Vivek Gautam
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.