aboutsummaryrefslogtreecommitdiff
path: root/hw/chiptod.c
diff options
context:
space:
mode:
authorMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>2014-07-29 20:21:34 +0530
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-30 10:56:33 +1000
commitb44b7fd70cee05113c45b67523d7348a10b6569c (patch)
treef7a8c4836f01440b1dee0919fb01f1925e13ede9 /hw/chiptod.c
parent9593215029b4b648b8cd07ae5ad2b71290896ab3 (diff)
downloadskiboot-b44b7fd70cee05113c45b67523d7348a10b6569c.zip
skiboot-b44b7fd70cee05113c45b67523d7348a10b6569c.tar.gz
skiboot-b44b7fd70cee05113c45b67523d7348a10b6569c.tar.bz2
chiptod: Improvement to make quicker recovery from TOD errors.
When we get an HMI for TOD errors, chip TOD is generally not in running state. Before we fix TOD state we need to do a quick check whether it is running or not. But in current implementation instead of doing a quick check we do a poll check for TOD running. This delays the process of fixing TOD state and on a system with more cores per chip we may see soft lockup's even after successful recovery. This patch fixes this issue by introducing a quick check for TOD running state and provides quicker/faster recovery from TOD errors. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw/chiptod.c')
-rw-r--r--hw/chiptod.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/hw/chiptod.c b/hw/chiptod.c
index e686e31..1f3fc09 100644
--- a/hw/chiptod.c
+++ b/hw/chiptod.c
@@ -174,6 +174,20 @@ static bool chiptod_interrupt_check(void)
return true;
}
+static bool chiptod_running_check(void)
+{
+ uint64_t tval;
+
+ if (xscom_readme(TOD_CHIPTOD_FSM, &tval) != 0) {
+ prerror("CHIPTOD: XSCOM error polling run\n");
+ return false;
+ }
+ if (tval & 0x0800000000000000UL)
+ return true;
+ else
+ return false;
+}
+
static bool chiptod_poll_running(void)
{
uint64_t timeout = 0;
@@ -659,7 +673,7 @@ int chiptod_recover_tb_errors(void)
* Before we move TOD to core TB check if TOD is running.
* If not, then get TOD in running state.
*/
- if (!chiptod_poll_running())
+ if (!chiptod_running_check())
if (!chiptod_start_tod())
goto error_out;