Commit ad857d47 authored by Frederic Barrat's avatar Frederic Barrat Committed by Michael Ellerman

ocxl: Access interrupt trigger page from xive directly

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: default avatarFrederic Barrat <fbarrat@linux.ibm.com>
Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
Acked-by: default avatarAndrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200403153838.29224-3-fbarrat@linux.ibm.com
parent 1e89da5e
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Copyright 2017 IBM Corp. // Copyright 2017 IBM Corp.
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <asm/pnv-ocxl.h> #include <asm/pnv-ocxl.h>
#include <asm/xive.h>
#include "ocxl_internal.h" #include "ocxl_internal.h"
#include "trace.h" #include "trace.h"
...@@ -196,13 +197,16 @@ void ocxl_afu_irq_free_all(struct ocxl_context *ctx) ...@@ -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) u64 ocxl_afu_irq_get_addr(struct ocxl_context *ctx, int irq_id)
{ {
struct xive_irq_data *xd;
struct afu_irq *irq; struct afu_irq *irq;
u64 addr = 0; u64 addr = 0;
mutex_lock(&ctx->irq_lock); mutex_lock(&ctx->irq_lock);
irq = idr_find(&ctx->irq_idr, irq_id); irq = idr_find(&ctx->irq_idr, irq_id);
if (irq) if (irq) {
addr = irq->trigger_page; xd = irq_get_handler_data(irq->virq);
addr = xd ? xd->trig_page : 0;
}
mutex_unlock(&ctx->irq_lock); mutex_unlock(&ctx->irq_lock);
return addr; return addr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment