aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShuai Xue <xueshuai@linux.alibaba.com>2022-08-30 19:32:23 +0800
committerShuai Xue <xueshuai@linux.alibaba.com>2022-08-30 19:50:58 +0800
commitcb000779db6e81845e3b19f24eea9ba53378bccb (patch)
treef04e06d707daf7b3119cea9a7b55f1cecbd98ba5
parent00fac3288314f698d561a95d291b1f5c21bf72ed (diff)
downloadras-tools-cb000779db6e81845e3b19f24eea9ba53378bccb.tar.gz
einj_mem_uc: Wait for injection to take effect before triggering
Einj interrupt may be a SPI on arm64 and could be dispatched to any core, so the current process could run trigger action before the injection takes effect. Add a sleep to wait for injection completion, and then trigger. Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
-rw-r--r--einj_mem_uc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/einj_mem_uc.c b/einj_mem_uc.c
index c653a59..9be39a2 100644
--- a/einj_mem_uc.c
+++ b/einj_mem_uc.c
@@ -1006,6 +1006,7 @@ int main(int argc, char **argv)
}
} else {
t->inject(paddr, vaddr, t->notrigger);
+ sleep(3);
t->trigger(vaddr);
if (t->flags & F_SIGBUS) {
printf("Expected SIGBUS, didn't get one\n");