From 531bdefda91102cb3240e4e3289900af0a50e78b Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Fri, 24 Oct 2014 10:06:49 +1100 Subject: irq/occ/opal: Add self-sent dummy interrupt This makes OPAL use the OCC interrupt facility to send itself an interrupt whenever the OPAL event bit is set as a result of an OPAL call that wasn't itself opal_handle_interrupt() or opal_handle_hmi() (both of which we know the OS will already deal with appropriately). This ensures that OPAL event changes are notified to Linux via its interrupt path which is necessary for it to properly broadcast the state change to its various clients. Signed-off-by: Benjamin Herrenschmidt --- asm/asm-offsets.c | 1 + asm/head.S | 3 +++ 2 files changed, 4 insertions(+) (limited to 'asm') diff --git a/asm/asm-offsets.c b/asm/asm-offsets.c index 3440054..e33c181 100644 --- a/asm/asm-offsets.c +++ b/asm/asm-offsets.c @@ -35,6 +35,7 @@ int main(void) OFFSET(CPUTHREAD_PIR, cpu_thread, pir); OFFSET(CPUTHREAD_SAVE_R1, cpu_thread, save_r1); OFFSET(CPUTHREAD_STATE, cpu_thread, state); + OFFSET(CPUTHREAD_CUR_TOKEN, cpu_thread, current_token); OFFSET(STACK_TYPE, stack_frame, type); OFFSET(STACK_LOCALS, stack_frame, locals); diff --git a/asm/head.S b/asm/head.S index 37a059d..a56f2bb 100644 --- a/asm/head.S +++ b/asm/head.S @@ -777,6 +777,9 @@ opal_entry: /* Get the CPU thread */ GET_CPU() + /* Store token in CPU thread */ + std %r0,CPUTHREAD_CUR_TOKEN(%r13) + /* Mark the stack frame */ li %r12,STACK_ENTRY_OPAL_API std %r12,STACK_TYPE(%r1) -- cgit v1.1