summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxlflash
diff options
context:
space:
mode:
authorUma Krishnan <ukrishn@linux.vnet.ibm.com>2018-03-26 12:34:35 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2018-04-18 19:32:50 -0400
commit402a55ea473a37b06eeae9abda00886bfd3bfe6d (patch)
treecec70dfe37a352d5dd279e90e69813ab14a26e41 /drivers/scsi/cxlflash
parente117c3c731c26bae77b16707740876ede6f73a1b (diff)
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')
-rw-r--r--drivers/scsi/cxlflash/backend.h1
-rw-r--r--drivers/scsi/cxlflash/cxl_hw.c7
-rw-r--r--drivers/scsi/cxlflash/ocxl_hw.c18
3 files changed, 26 insertions, 0 deletions
diff --git a/drivers/scsi/cxlflash/backend.h b/drivers/scsi/cxlflash/backend.h
index f675bcb4f153..bcd8a6c588d3 100644
--- a/drivers/scsi/cxlflash/backend.h
+++ b/drivers/scsi/cxlflash/backend.h
@@ -23,6 +23,7 @@ struct cxlflash_backend_ops {
23 int (*map_afu_irq)(void *ctx_cookie, int num, irq_handler_t handler, 23 int (*map_afu_irq)(void *ctx_cookie, int num, irq_handler_t handler,
24 void *cookie, char *name); 24 void *cookie, char *name);
25 void (*unmap_afu_irq)(void *ctx_cookie, int num, void *cookie); 25 void (*unmap_afu_irq)(void *ctx_cookie, int num, void *cookie);
26 u64 (*get_irq_objhndl)(void *ctx_cookie, int irq);
26 int (*start_context)(void *ctx_cookie); 27 int (*start_context)(void *ctx_cookie);
27 int (*stop_context)(void *ctx_cookie); 28 int (*stop_context)(void *ctx_cookie);
28 int (*afu_reset)(void *ctx_cookie); 29 int (*afu_reset)(void *ctx_cookie);
diff --git a/drivers/scsi/cxlflash/cxl_hw.c b/drivers/scsi/cxlflash/cxl_hw.c
index a1d6d12090d3..b42da88386bd 100644
--- a/drivers/scsi/cxlflash/cxl_hw.c
+++ b/drivers/scsi/cxlflash/cxl_hw.c
@@ -49,6 +49,12 @@ static void cxlflash_unmap_afu_irq(void *ctx_cookie, int num, void *cookie)
49 cxl_unmap_afu_irq(ctx_cookie, num, cookie); 49 cxl_unmap_afu_irq(ctx_cookie, num, cookie);
50} 50}
51 51
52static u64 cxlflash_get_irq_objhndl(void *ctx_cookie, int irq)
53{
54 /* Dummy fop for cxl */
55 return 0;
56}
57
52static int cxlflash_start_context(void *ctx_cookie) 58static int cxlflash_start_context(void *ctx_cookie)
53{ 59{
54 return cxl_start_context(ctx_cookie, 0, NULL); 60 return cxl_start_context(ctx_cookie, 0, NULL);
@@ -153,6 +159,7 @@ const struct cxlflash_backend_ops cxlflash_cxl_ops = {
153 .process_element = cxlflash_process_element, 159 .process_element = cxlflash_process_element,
154 .map_afu_irq = cxlflash_map_afu_irq, 160 .map_afu_irq = cxlflash_map_afu_irq,
155 .unmap_afu_irq = cxlflash_unmap_afu_irq, 161 .unmap_afu_irq = cxlflash_unmap_afu_irq,
162 .get_irq_objhndl = cxlflash_get_irq_objhndl,
156 .start_context = cxlflash_start_context, 163 .start_context = cxlflash_start_context,
157 .stop_context = cxlflash_stop_context, 164 .stop_context = cxlflash_stop_context,
158 .afu_reset = cxlflash_afu_reset, 165 .afu_reset = cxlflash_afu_reset,
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)
308} 308}
309 309
310/** 310/**
311 * ocxlflash_get_irq_objhndl() - get the object handle for an interrupt
312 * @ctx_cookie: Context associated with the interrupt.
313 * @irq: Interrupt number.
314 *
315 * Return: effective address of the mapped region
316 */
317static u64 ocxlflash_get_irq_objhndl(void *ctx_cookie, int irq)
318{
319 struct ocxlflash_context *ctx = ctx_cookie;
320
321 if (irq < 0 || irq >= ctx->num_irqs)
322 return 0;
323
324 return (__force u64)ctx->irqs[irq].vtrig;
325}
326
327/**
311 * start_context() - local routine to start a context 328 * start_context() - local routine to start a context
312 * @ctx: Adapter context to be started. 329 * @ctx: Adapter context to be started.
313 * 330 *
@@ -1301,6 +1318,7 @@ const struct cxlflash_backend_ops cxlflash_ocxl_ops = {
1301 .process_element = ocxlflash_process_element, 1318 .process_element = ocxlflash_process_element,
1302 .map_afu_irq = ocxlflash_map_afu_irq, 1319 .map_afu_irq = ocxlflash_map_afu_irq,
1303 .unmap_afu_irq = ocxlflash_unmap_afu_irq, 1320 .unmap_afu_irq = ocxlflash_unmap_afu_irq,
1321 .get_irq_objhndl = ocxlflash_get_irq_objhndl,
1304 .start_context = ocxlflash_start_context, 1322 .start_context = ocxlflash_start_context,
1305 .stop_context = ocxlflash_stop_context, 1323 .stop_context = ocxlflash_stop_context,
1306 .set_master = ocxlflash_set_master, 1324 .set_master = ocxlflash_set_master,