diff mbox

[03/10] xive: Fix setting of OPAL_XIVE_IRQ_EOI_VIA_FW

Message ID 20170309004543.16745-3-benh@kernel.crashing.org
State Accepted
Headers show

Commit Message

Benjamin Herrenschmidt March 9, 2017, 12:45 a.m. UTC
This flag needs to be set when the original source has an EOI
callback. It indicates that the OS should call back into OPAL
to perform the EOI and is necessary for some LPC interrupts
on DD1. Without this, Linux with XIVE exploitation hangs at
boot with a stuck interrupt.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 hw/xive.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/hw/xive.c b/hw/xive.c
index 51e39d6..d18bc46 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -3268,15 +3268,20 @@  static int64_t opal_xive_get_irq_info(uint32_t girq,
 		return OPAL_PARAMETER;
 	assert(is->ops == &xive_irq_source_ops);
 
-	*out_flags = xive_convert_irq_flags(s->flags);
+	if (out_flags)
+		*out_flags = xive_convert_irq_flags(s->flags);
 
 	/*
 	 * If the orig source has a set_xive callback, then set
 	 * OPAL_XIVE_IRQ_MASK_VIA_FW as masking/unmasking requires
-	 * source specific workarounds.
+	 * source specific workarounds. Same with EOI.
 	 */
-	if (out_flags && s->orig_ops && s->orig_ops->set_xive)
-		*out_flags |= OPAL_XIVE_IRQ_MASK_VIA_FW;
+	if (out_flags && s->orig_ops) {
+		if (s->orig_ops->set_xive)
+			*out_flags |= OPAL_XIVE_IRQ_MASK_VIA_FW;
+		if (s->orig_ops->eoi)
+			*out_flags |= OPAL_XIVE_IRQ_EOI_VIA_FW;
+	}
 
 	idx = girq - s->esb_base;