diff options
author | Vipin K Parashar <vipin@linux.vnet.ibm.com> | 2016-06-06 14:56:37 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-07-05 15:14:13 +1000 |
commit | e761222593a1ae932cddbc81239b6a7cd98ddb70 (patch) | |
tree | cdbbcbe70925b552848b7f281bdb1fa4dfd532cd /include | |
parent | 5fc07eaa4ac13fbbf188072c58e0202b34aa7f35 (diff) | |
download | skiboot-e761222593a1ae932cddbc81239b6a7cd98ddb70.zip skiboot-e761222593a1ae932cddbc81239b6a7cd98ddb70.tar.gz skiboot-e761222593a1ae932cddbc81239b6a7cd98ddb70.tar.bz2 |
hw/xscom: Reset XSCOM engine after finite number of retries when busy
OPAL retries XSCOM read/write operations forever till it succeeds.
This can cause XSCOM ops to hang forever when XSCOM engine remains
busy for some reason. Changed it to retry XSCOM operations only
XSCOM_BUSY_MAX_RETRIES number of times instead of retrying forever.
Also added logic to reset XSCOM engine after XSCOM_BUSY_RESET_THRESHOLD
number of retries to unblock it when it remains busy.
Cc: stable # 9c2d82394fd2 ("xscom: Return OPAL_WRONG_STATE on XSCOM ops..")
Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/errorlog.h | 1 | ||||
-rw-r--r-- | include/xscom.h | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/errorlog.h b/include/errorlog.h index b8fca7d..0a4237f 100644 --- a/include/errorlog.h +++ b/include/errorlog.h @@ -276,6 +276,7 @@ enum opal_reasoncode { OPAL_RC_XSCOM_RW = OPAL_XS | 0x10, OPAL_RC_XSCOM_INDIRECT_RW = OPAL_XS | 0x11, OPAL_RC_XSCOM_RESET = OPAL_XS | 0x12, + OPAL_RC_XSCOM_BUSY = OPAL_XS | 0x13, /* PCI */ OPAL_RC_PCI_INIT_SLOT = OPAL_PC | 0x10, OPAL_RC_PCI_ADD_SLOT = OPAL_PC | 0x11, diff --git a/include/xscom.h b/include/xscom.h index 933af6a..1aee40e 100644 --- a/include/xscom.h +++ b/include/xscom.h @@ -167,6 +167,12 @@ /* HB folks say: try 10 time for now */ #define XSCOM_IND_MAX_RETRIES 10 +/* Max number of retries when XSCOM remains busy */ +#define XSCOM_BUSY_MAX_RETRIES 3000 + +/* Retry count after which to reset XSCOM, if still busy */ +#define XSCOM_BUSY_RESET_THRESHOLD 1000 + /* * Error handling: * |