aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxlflash/superpipe.c
diff options
context:
space:
mode:
authorMatthew R. Ochs <mrochs@linux.vnet.ibm.com>2018-01-03 16:54:50 -0600
committerMartin K. Petersen <martin.petersen@oracle.com>2018-01-10 23:24:57 -0500
commit8762353106c4376deabd76473e1bd7ba36dd529c (patch)
treeedde4fde1e85c23419f2f41aba9a623cf5617fda /drivers/scsi/cxlflash/superpipe.c
parentscsi: cxlflash: Explicitly cache number of interrupts per context (diff)
downloadlinux-dev-8762353106c4376deabd76473e1bd7ba36dd529c.tar.xz
linux-dev-8762353106c4376deabd76473e1bd7ba36dd529c.zip
scsi: cxlflash: Remove embedded CXL work structures
The CXL-specific work structure used to request the number of interrupts currently resides as a nested member of both the context information and hardware queue structures. It is used to cache values (specifically the number of interrupts) required by the CXL layer when starting a context. To facilitate staging that will ultimately allow the cxlflash core to become agnostic of the underlying accelerator transport, remove these embedded work structures. Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/cxlflash/superpipe.c')
-rw-r--r--drivers/scsi/cxlflash/superpipe.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c
index ecfa5532ef18..51f67dcca90a 100644
--- a/drivers/scsi/cxlflash/superpipe.c
+++ b/drivers/scsi/cxlflash/superpipe.c
@@ -1309,7 +1309,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev,
struct afu *afu = cfg->afu;
struct llun_info *lli = sdev->hostdata;
struct glun_info *gli = lli->parent;
- struct cxl_ioctl_start_work *work;
+ struct cxl_ioctl_start_work work = { 0 };
struct ctx_info *ctxi = NULL;
struct lun_access *lun_access = NULL;
int rc = 0;
@@ -1405,11 +1405,10 @@ static int cxlflash_disk_attach(struct scsi_device *sdev,
goto err;
}
- work = &ctxi->work;
- work->num_interrupts = irqs;
- work->flags = CXL_START_WORK_NUM_IRQS;
+ work.num_interrupts = irqs;
+ work.flags = CXL_START_WORK_NUM_IRQS;
- rc = cxl_start_work(ctx, work);
+ rc = cxl_start_work(ctx, &work);
if (unlikely(rc)) {
dev_dbg(dev, "%s: Could not start context rc=%d\n",
__func__, rc);
@@ -1534,6 +1533,7 @@ static int recover_context(struct cxlflash_cfg *cfg,
struct file *file;
void *ctx;
struct afu *afu = cfg->afu;
+ struct cxl_ioctl_start_work work = { 0 };
ctx = cxl_dev_context_init(cfg->dev);
if (IS_ERR_OR_NULL(ctx)) {
@@ -1543,7 +1543,10 @@ static int recover_context(struct cxlflash_cfg *cfg,
goto out;
}
- rc = cxl_start_work(ctx, &ctxi->work);
+ work.num_interrupts = ctxi->irqs;
+ work.flags = CXL_START_WORK_NUM_IRQS;
+
+ rc = cxl_start_work(ctx, &work);
if (unlikely(rc)) {
dev_dbg(dev, "%s: Could not start context rc=%d\n",
__func__, rc);