[Skiboot] [PATCH 10/10] xive: Cleanup calls to set_xive backends

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Mar 9 11:45:43 AEDT 2017


When interrupt sources provide a set_xive backend on P9 that
means they have to do additional work to mask/unmask interrupts
(typically due to issues in their ESB HW implementations).

However, this never involves server targetting. Additionally
there is confusion on what a "server number" means to a set_xive
call due to the pre-P9 encoding, so let's not pass it at all,
pass 0 instead.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 hw/xive.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/hw/xive.c b/hw/xive.c
index 217ec6a..43eda30 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -2407,12 +2407,16 @@ static int64_t xive_source_set_xive(struct irq_source *is, uint32_t isn,
 
 	/* The source has special variants of masking/unmasking */
 	if (old_prio != prio && (old_prio == 0xff || prio == 0xff)) {
-		if (s->orig_ops && s->orig_ops->set_xive)
-			rc = s->orig_ops->set_xive(is, isn, server, prio);
-		else
+		if (s->orig_ops && s->orig_ops->set_xive) {
+			/* We don't pass as server on source ops ! Targetting
+			 * is handled by the XIVE
+			 */
+			rc = s->orig_ops->set_xive(is, isn, 0, prio);
+		} else {
 			/* Ensure it's enabled/disabled in the source controller */
 			xive_update_irq_mask(s, isn - s->esb_base,
 					     prio == 0xff);
+		}
 	}
 
 	/*
@@ -3418,11 +3422,15 @@ static int64_t opal_xive_set_irq_config(uint32_t girq,
 		return rc;
 
 	/* The source has special variants of masking/unmasking */
-	if (s->orig_ops && s->orig_ops->set_xive)
-		rc = s->orig_ops->set_xive(is, girq, vp >> 2, prio);
-	else
+	if (s->orig_ops && s->orig_ops->set_xive) {
+		/* We don't pass as server on source ops ! Targetting
+		 * is handled by the XIVE
+		 */
+		rc = s->orig_ops->set_xive(is, girq, 0, prio);
+	} else {
 		/* Ensure it's enabled/disabled in the source controller */
 		xive_update_irq_mask(s, girq - s->esb_base, prio == 0xff);
+	}
 
 	/*
 	 * Synchronize the source and old target XIVEs to ensure that
-- 
2.9.3



More information about the Skiboot mailing list