diff options
author | Alastair D'Silva <alastair@d-silva.org> | 2019-03-27 08:31:34 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-05-02 19:55:02 +0300 |
commit | 2ec3b7ed2ab8e07fdb5f800ff420e94dec75435f (patch) | |
tree | acdfb4e33f79649bfdf85da299e3e33c6437a532 /drivers/misc/ocxl/context.c | |
parent | b9721d275cc2c5e6c07371239c827e0faf05a6b9 (diff) | |
download | linux-2ec3b7ed2ab8e07fdb5f800ff420e94dec75435f.tar.xz |
ocxl: afu_irq only deals with IRQ IDs, not offsets
The use of offsets is required only in the frontend, so alter
the IRQ API to only work with IRQ IDs in the backend.
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc/ocxl/context.c')
-rw-r--r-- | drivers/misc/ocxl/context.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/misc/ocxl/context.c b/drivers/misc/ocxl/context.c index b60e674ac019..bab9c9364184 100644 --- a/drivers/misc/ocxl/context.c +++ b/drivers/misc/ocxl/context.c @@ -94,8 +94,9 @@ static vm_fault_t map_afu_irq(struct vm_area_struct *vma, unsigned long address, u64 offset, struct ocxl_context *ctx) { u64 trigger_addr; + int irq_id = ocxl_irq_offset_to_id(ctx, offset); - trigger_addr = ocxl_afu_irq_get_addr(ctx, offset); + trigger_addr = ocxl_afu_irq_get_addr(ctx, irq_id); if (!trigger_addr) return VM_FAULT_SIGBUS; @@ -155,12 +156,14 @@ static const struct vm_operations_struct ocxl_vmops = { static int check_mmap_afu_irq(struct ocxl_context *ctx, struct vm_area_struct *vma) { + int irq_id = ocxl_irq_offset_to_id(ctx, vma->vm_pgoff << PAGE_SHIFT); + /* only one page */ if (vma_pages(vma) != 1) return -EINVAL; /* check offset validty */ - if (!ocxl_afu_irq_get_addr(ctx, vma->vm_pgoff << PAGE_SHIFT)) + if (!ocxl_afu_irq_get_addr(ctx, irq_id)) return -EINVAL; /* |