[Skiboot] [PATCH 3/3] xscom: Do not wait indefinitely for xscom operation to complete
Vasant Hegde
hegdevasant at linux.vnet.ibm.com
Wed May 20 21:51:39 AEST 2020
In some corner cases (specially on P8), xscom_wait_done() won't
complete.. resulting in waiting forever.
This patch retries for predefined time and then exits even if xscom
operation did not complete.
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
hw/xscom.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/xscom.c b/hw/xscom.c
index 0eda567fc..500b6c0e9 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -72,10 +72,13 @@ static inline void *xscom_addr(uint32_t gcid, uint32_t pcb_addr)
static uint64_t xscom_wait_done(void)
{
uint64_t hmer;
+ int retry_cnt = 0;
- do
+ do {
hmer = mfspr(SPR_HMER);
- while(!(hmer & SPR_HMER_XSCOM_DONE));
+ if (retry_cnt++ > 5)
+ break;
+ } while(!(hmer & SPR_HMER_XSCOM_DONE));
/*
* HW822317: We need to read a second time as the actual
--
2.21.1
More information about the Skiboot
mailing list