diff options
author | Cédric Le Goater <clg@kaod.org> | 2020-11-04 23:20:57 +0100 |
---|---|---|
committer | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2020-11-27 15:37:15 +0530 |
commit | 0723ba37613b5c1882b542a117ee1377f320b6c5 (patch) | |
tree | 63e8ad3d51a603d87aa70a1301798d873b1b2cfc | |
parent | b6be076b1ef1cb4e752b2ca5d6e0c0c8223e801a (diff) | |
download | skiboot-0723ba37613b5c1882b542a117ee1377f320b6c5.zip skiboot-0723ba37613b5c1882b542a117ee1377f320b6c5.tar.gz skiboot-0723ba37613b5c1882b542a117ee1377f320b6c5.tar.bz2 |
xive/p9: Add a retry counter when updating the cache watch
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
-rw-r--r-- | hw/xive.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1222,6 +1222,8 @@ static int64_t xive_eqc_scrub(struct xive *x, uint64_t block, uint64_t idx) return __xive_cache_scrub(x, xive_cache_eqc, block, idx, false, false); } +#define XIVE_CACHE_WATCH_MAX_RETRIES 10 + static int64_t __xive_cache_watch(struct xive *x, enum xive_cache_type ctype, uint64_t block, uint64_t idx, uint32_t start_dword, uint32_t dword_count, @@ -1231,6 +1233,7 @@ static int64_t __xive_cache_watch(struct xive *x, enum xive_cache_type ctype, uint64_t sreg, sregx, dreg0, dreg0x; uint64_t dval0, sval, status; int64_t i; + int retries = 0; #ifdef XIVE_CHECK_LOCKS assert(lock_held_by_me(&x->lock)); @@ -1303,7 +1306,12 @@ static int64_t __xive_cache_watch(struct xive *x, enum xive_cache_type ctype, if (!synchronous) return OPAL_BUSY; - /* XXX Add timeout ? */ + if (++retries == XIVE_CACHE_WATCH_MAX_RETRIES) { + xive_err(x, "Reached maximum retries %d when doing " + "a %s cache update\n", retries, + ctype == xive_cache_eqc ? "EQC" : "VPC"); + return OPAL_BUSY; + } } /* Perform a scrub with "want_invalidate" set to false to push the |