opal: Fix corruption of OPAL call return value in opal_exit_check()

Message ID 1512580401.2224.126.camel@kernel.crashing.org
State Superseded
Headers show
Series
  • opal: Fix corruption of OPAL call return value in opal_exit_check()
Related show

Commit Message

Benjamin Herrenschmidt Dec. 6, 2017, 5:13 p.m.
The new opal_exit_check needs to return retval otherwise
r3 gets clobbered in debug builds.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 core/opal.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/core/opal.c b/core/opal.c
index 193dc898..d33d527c 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -171,9 +171,9 @@  again:
 	return OPAL_SUCCESS;
 }
 
-void opal_exit_check(int64_t retval, struct stack_frame *eframe);
+int64_t opal_exit_check(int64_t retval, struct stack_frame *eframe);
 
-void opal_exit_check(int64_t retval, struct stack_frame *eframe)
+int64_t opal_exit_check(int64_t retval, struct stack_frame *eframe)
 {
 	struct cpu_thread *cpu = this_cpu();
 	uint64_t token = eframe->gpr[0];
@@ -185,6 +185,7 @@  void opal_exit_check(int64_t retval, struct stack_frame *eframe)
 		sync(); /* release barrier vs quiescing */
 		cpu->in_opal_call--;
 	}
+	return retval;
 }
 
 int64_t opal_quiesce(uint32_t quiesce_type, int32_t cpu_target)