From: Hari Bathini Date: Fri, 9 Jun 2023 07:14:04 +0000 (+0530) Subject: powerpc/fadump: invoke ibm,os-term with rtas_call_unlocked() X-Git-Tag: v6.6.17~4052^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b949ee6801f4a47ae0e02845242c99af351c4d26;p=platform%2Fkernel%2Flinux-rpi.git powerpc/fadump: invoke ibm,os-term with rtas_call_unlocked() Invoke ibm,os-term call with rtas_call_unlocked(), without using the RTAS spinlock, to avoid deadlock in the unlikely event of a machine crash while making an RTAS call. Signed-off-by: Hari Bathini Reviewed-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman Link: https://msgid.link/20230609071404.425529-1-hbathini@linux.ibm.com --- diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index c087eee..a8192e5 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c @@ -1587,6 +1587,7 @@ static bool ibm_extended_os_term; void rtas_os_term(char *str) { s32 token = rtas_function_token(RTAS_FN_IBM_OS_TERM); + static struct rtas_args args; int status; /* @@ -1607,7 +1608,8 @@ void rtas_os_term(char *str) * schedules. */ do { - status = rtas_call(token, 1, 1, NULL, __pa(rtas_os_term_buf)); + rtas_call_unlocked(&args, token, 1, 1, NULL, __pa(rtas_os_term_buf)); + status = be32_to_cpu(args.rets[0]); } while (rtas_busy_delay_time(status)); if (status != 0)