From 790ad9fe07a1ba2b55293238e21872ea6d8c740a Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Thu, 9 Mar 2017 11:45:36 +1100 Subject: xive: Fix setting of OPAL_XIVE_IRQ_EOI_VIA_FW 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 Signed-off-by: Stewart Smith --- hw/xive.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'hw') diff --git a/hw/xive.c b/hw/xive.c index 51e39d6b..d18bc464 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; -- cgit v1.2.1