summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxlflash/ocxl_hw.c
diff options
context:
space:
mode:
authorUma Krishnan2018-03-26 18:34:35 +0200
committerMartin K. Petersen2018-04-19 01:32:50 +0200
commit402a55ea473a37b06eeae9abda00886bfd3bfe6d (patch)
treecec70dfe37a352d5dd279e90e69813ab14a26e41 /drivers/scsi/cxlflash/ocxl_hw.c
parentscsi: cxlflash: Support file descriptor mapping (diff)
downloadkernel-qcow2-linux-402a55ea473a37b06eeae9abda00886bfd3bfe6d.tar.gz
kernel-qcow2-linux-402a55ea473a37b06eeae9abda00886bfd3bfe6d.tar.xz
kernel-qcow2-linux-402a55ea473a37b06eeae9abda00886bfd3bfe6d.zip
scsi: cxlflash: Introduce object handle fop
OCXL requires that AFUs use an opaque object handle to represent an AFU interrupt. The specification does not provide a common means to communicate the object handle to the AFU - each AFU must define this within the AFU specification. To support this model, the object handle must be passed back to the core driver as it manages the AFU specification (SISLite) for cxlflash. Note that for Power systems, the object handle is the effective address of the trigger page. Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com> Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/cxlflash/ocxl_hw.c')
-rw-r--r--drivers/scsi/cxlflash/ocxl_hw.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/scsi/cxlflash/ocxl_hw.c b/drivers/scsi/cxlflash/ocxl_hw.c
index 4bbc1d197a62..f77f4d7f6a34 100644
--- a/drivers/scsi/cxlflash/ocxl_hw.c
+++ b/drivers/scsi/cxlflash/ocxl_hw.c
@@ -308,6 +308,23 @@ static void ocxlflash_unmap_afu_irq(void *ctx_cookie, int num, void *cookie)
}
/**
+ * ocxlflash_get_irq_objhndl() - get the object handle for an interrupt
+ * @ctx_cookie: Context associated with the interrupt.
+ * @irq: Interrupt number.
+ *
+ * Return: effective address of the mapped region
+ */
+static u64 ocxlflash_get_irq_objhndl(void *ctx_cookie, int irq)
+{
+ struct ocxlflash_context *ctx = ctx_cookie;
+
+ if (irq < 0 || irq >= ctx->num_irqs)
+ return 0;
+
+ return (__force u64)ctx->irqs[irq].vtrig;
+}
+
+/**
* start_context() - local routine to start a context
* @ctx: Adapter context to be started.
*
@@ -1301,6 +1318,7 @@ const struct cxlflash_backend_ops cxlflash_ocxl_ops = {
.process_element = ocxlflash_process_element,
.map_afu_irq = ocxlflash_map_afu_irq,
.unmap_afu_irq = ocxlflash_unmap_afu_irq,
+ .get_irq_objhndl = ocxlflash_get_irq_objhndl,
.start_context = ocxlflash_start_context,
.stop_context = ocxlflash_stop_context,
.set_master = ocxlflash_set_master,