diff mbox series

capp: Fix the capp recovery timeout comparison

Message ID 20180814111911.28440-1-vaibhav@linux.ibm.com
State Accepted
Headers show
Series capp: Fix the capp recovery timeout comparison | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/make_check success Test make_check on branch master

Commit Message

Vaibhav Jain Aug. 14, 2018, 11:19 a.m. UTC
The current capp recovery timeout control loop in
do_capp_recovery_scoms() uses a wrong comparison for return value of
tb_compare(). This may cause do_capp_recovery_scoms() to report an
timeout earlier than the 168ms stipulated time.

The patch fixes this by updating the loop timeout control branch in
do_capp_recovery_scoms() to use the correct enum tb_cmpval.

Cc: Stable #6.0+
Fixes: 09b853cae0aa0("capi: Poll Err/Status register during CAPP
recovery")
Reported-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
---
 hw/phb4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Frederic Barrat Aug. 14, 2018, 12:46 p.m. UTC | #1
Le 14/08/2018 à 13:19, Vaibhav Jain a écrit :
> The current capp recovery timeout control loop in
> do_capp_recovery_scoms() uses a wrong comparison for return value of
> tb_compare(). This may cause do_capp_recovery_scoms() to report an
> timeout earlier than the 168ms stipulated time.
> 
> The patch fixes this by updating the loop timeout control branch in
> do_capp_recovery_scoms() to use the correct enum tb_cmpval.
> 
> Cc: Stable #6.0+
> Fixes: 09b853cae0aa0("capi: Poll Err/Status register during CAPP
> recovery")
> Reported-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---

Thanks!
Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>


>   hw/phb4.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/phb4.c b/hw/phb4.c
> index 707ef2ee..56f89006 100644
> --- a/hw/phb4.c
> +++ b/hw/phb4.c
> @@ -3034,7 +3034,7 @@ static int do_capp_recovery_scoms(struct phb4 *p)
>   		time_wait_ms(5);
>   		xscom_read(p->chip_id, CAPP_ERR_STATUS_CTRL + offset, &reg);
>   
> -		if (end && tb_compare(mftb(), end) != TB_AAFTERB) {
> +		if (tb_compare(mftb(), end) != TB_ABEFOREB) {
>   			PHBERR(p, "CAPP: Capp recovery Timed-out.\n");
>   			end = 0;
>   			break;
>
Christophe Lombard Aug. 14, 2018, 12:52 p.m. UTC | #2
Le 14/08/2018 à 13:19, Vaibhav Jain a écrit :
> The current capp recovery timeout control loop in
> do_capp_recovery_scoms() uses a wrong comparison for return value of
> tb_compare(). This may cause do_capp_recovery_scoms() to report an
> timeout earlier than the 168ms stipulated time.
> 
> The patch fixes this by updating the loop timeout control branch in
> do_capp_recovery_scoms() to use the correct enum tb_cmpval.
> 
> Cc: Stable #6.0+
> Fixes: 09b853cae0aa0("capi: Poll Err/Status register during CAPP
> recovery")
> Reported-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---


Thanks.

Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Andrew Donnellan Aug. 14, 2018, 11:57 p.m. UTC | #3
On 14/08/18 21:19, Vaibhav Jain wrote:
> The current capp recovery timeout control loop in
> do_capp_recovery_scoms() uses a wrong comparison for return value of
> tb_compare(). This may cause do_capp_recovery_scoms() to report an
> timeout earlier than the 168ms stipulated time.
> 
> The patch fixes this by updating the loop timeout control branch in
> do_capp_recovery_scoms() to use the correct enum tb_cmpval.
> 
> Cc: Stable #6.0+
> Fixes: 09b853cae0aa0("capi: Poll Err/Status register during CAPP
> recovery")
> Reported-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

> ---
>   hw/phb4.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/phb4.c b/hw/phb4.c
> index 707ef2ee..56f89006 100644
> --- a/hw/phb4.c
> +++ b/hw/phb4.c
> @@ -3034,7 +3034,7 @@ static int do_capp_recovery_scoms(struct phb4 *p)
>   		time_wait_ms(5);
>   		xscom_read(p->chip_id, CAPP_ERR_STATUS_CTRL + offset, &reg);
>   
> -		if (end && tb_compare(mftb(), end) != TB_AAFTERB) {
> +		if (tb_compare(mftb(), end) != TB_ABEFOREB) {
>   			PHBERR(p, "CAPP: Capp recovery Timed-out.\n");
>   			end = 0;
>   			break;
>
Stewart Smith Aug. 16, 2018, 9:19 a.m. UTC | #4
Vaibhav Jain <vaibhav@linux.ibm.com> writes:
> The current capp recovery timeout control loop in
> do_capp_recovery_scoms() uses a wrong comparison for return value of
> tb_compare(). This may cause do_capp_recovery_scoms() to report an
> timeout earlier than the 168ms stipulated time.
>
> The patch fixes this by updating the loop timeout control branch in
> do_capp_recovery_scoms() to use the correct enum tb_cmpval.
>
> Cc: Stable #6.0+
> Fixes: 09b853cae0aa0("capi: Poll Err/Status register during CAPP
> recovery")
> Reported-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---
>  hw/phb4.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, merged:
master ec954f764efe064d7fc99e8a21a0ebdb7b8a3c91
6.0.x 509d687c96234e95e023d810e02cdadf56d1b24f
diff mbox series

Patch

diff --git a/hw/phb4.c b/hw/phb4.c
index 707ef2ee..56f89006 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -3034,7 +3034,7 @@  static int do_capp_recovery_scoms(struct phb4 *p)
 		time_wait_ms(5);
 		xscom_read(p->chip_id, CAPP_ERR_STATUS_CTRL + offset, &reg);
 
-		if (end && tb_compare(mftb(), end) != TB_AAFTERB) {
+		if (tb_compare(mftb(), end) != TB_ABEFOREB) {
 			PHBERR(p, "CAPP: Capp recovery Timed-out.\n");
 			end = 0;
 			break;