summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuofei Ma <ruofeim@google.com>2022-04-19 14:37:34 -0700
committerRuofei Ma <ruofeim@google.com>2022-04-19 15:08:34 -0700
commit1aeb0b2be6cb6ba4d05a7ded6e456381286f7f48 (patch)
treee75f5d70d94d0b233bf5eac136fcef6b5c6050ac
parent5036de9318c5ebe18636fc78b1c9103e28024db4 (diff)
downloadgchips-1aeb0b2be6cb6ba4d05a7ded6e456381286f7f48.tar.gz
Read status reg when interrupt timeout
stat_with_irq will have stale value if interrupt timeout. Read status from device register and update stat_with_irq. Bug: 229580907 Signed-off-by: Ruofei Ma <ruofeim@google.com> Change-Id: I17635113091fc006737c859415c0ed0bfc5ab3fb
-rw-r--r--bigo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bigo.c b/bigo.c
index 8895c81..99e9edc 100644
--- a/bigo.c
+++ b/bigo.c
@@ -226,6 +226,7 @@ static int bigo_run_job(struct bigo_core *core, struct bigo_job *job)
long ret = 0;
int rc = 0;
u32 status = 0;
+ unsigned long flags;
bigo_bypass_ssmt_pid(core);
bigo_push_regs(core, job->regs);
@@ -234,6 +235,11 @@ static int bigo_run_job(struct bigo_core *core, struct bigo_job *job)
msecs_to_jiffies(JOB_COMPLETE_TIMEOUT_MS));
if (!ret) {
pr_err("timed out waiting for HW\n");
+
+ spin_lock_irqsave(&core->status_lock, flags);
+ core->stat_with_irq = bigo_core_readl(core, BIGO_REG_STAT);
+ spin_unlock_irqrestore(&core->status_lock, flags);
+
bigo_core_disable(core);
rc = -ETIMEDOUT;
} else {