linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Barrat <fbarrat@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, clg@kaod.org,
	christophe_lombard@fr.ibm.com, ajd@linux.ibm.com,
	ukrishn@linux.ibm.com, mrochs@linux.ibm.com
Cc: haren@linux.ibm.com, groug@kaod.org
Subject: [PATCH 2/4] ocxl: Access interrupt trigger page from xive directly
Date: Thu,  2 Apr 2020 17:43:50 +0200	[thread overview]
Message-ID: <20200402154352.586166-3-fbarrat@linux.ibm.com> (raw)
In-Reply-To: <20200402154352.586166-1-fbarrat@linux.ibm.com>

We can access the trigger page through standard APIs so let's use it
and avoid saving it when allocating the interrupt. It will also allow
to simplify allocation in a later patch.

Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
---
 drivers/misc/ocxl/afu_irq.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/ocxl/afu_irq.c b/drivers/misc/ocxl/afu_irq.c
index 70f8f1c3929d..b30ec0ef7be7 100644
--- a/drivers/misc/ocxl/afu_irq.c
+++ b/drivers/misc/ocxl/afu_irq.c
@@ -2,6 +2,7 @@
 // Copyright 2017 IBM Corp.
 #include <linux/interrupt.h>
 #include <asm/pnv-ocxl.h>
+#include <asm/xive.h>
 #include "ocxl_internal.h"
 #include "trace.h"
 
@@ -196,13 +197,16 @@ void ocxl_afu_irq_free_all(struct ocxl_context *ctx)
 
 u64 ocxl_afu_irq_get_addr(struct ocxl_context *ctx, int irq_id)
 {
+	struct xive_irq_data *xd;
 	struct afu_irq *irq;
 	u64 addr = 0;
 
 	mutex_lock(&ctx->irq_lock);
 	irq = idr_find(&ctx->irq_idr, irq_id);
-	if (irq)
-		addr = irq->trigger_page;
+	if (irq) {
+		xd = irq_get_handler_data(irq->virq);
+		addr = xd ? xd->trig_page : 0;
+	}
 	mutex_unlock(&ctx->irq_lock);
 	return addr;
 }
-- 
2.25.1


  parent reply	other threads:[~2020-04-02 15:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 15:43 [PATCH 0/4] ocxl: Cleanup AFU interrupt allocation Frederic Barrat
2020-04-02 15:43 ` [PATCH 1/4] scsi: cxlflash: Access interrupt trigger page from xive directly Frederic Barrat
2020-04-02 23:19   ` Matthew R. Ochs
2020-04-03 11:19     ` Cédric Le Goater
2020-04-02 15:43 ` Frederic Barrat [this message]
2020-04-03  5:55   ` [PATCH 2/4] ocxl: " Cédric Le Goater
2020-04-03  6:36   ` Andrew Donnellan
2020-04-03  9:17   ` Greg Kurz
2020-04-02 15:43 ` [PATCH 3/4] ocxl: Don't return trigger page when allocating an interrupt Frederic Barrat
2020-04-03  5:56   ` Cédric Le Goater
2020-04-03  9:25   ` Greg Kurz
2020-04-02 15:43 ` [PATCH 4/4] ocxl: Remove custom service to allocate interrupts Frederic Barrat
2020-04-03  5:56   ` Cédric Le Goater
2020-04-03  9:27   ` Greg Kurz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200402154352.586166-3-fbarrat@linux.ibm.com \
    --to=fbarrat@linux.ibm.com \
    --cc=ajd@linux.ibm.com \
    --cc=christophe_lombard@fr.ibm.com \
    --cc=clg@kaod.org \
    --cc=groug@kaod.org \
    --cc=haren@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mrochs@linux.ibm.com \
    --cc=ukrishn@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).