Skip to content

Commit

Permalink
capp: Fix the capp recovery timeout comparison
Browse files Browse the repository at this point in the history
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: 09b853c("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: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
vaibhav92 authored and stewartsmith committed Aug 16, 2018
1 parent b660566 commit ec954f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/phb4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ec954f7

Please sign in to comment.