Commit 87623531 authored by Matthew R. Ochs's avatar Matthew R. Ochs Committed by Martin K. Petersen

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: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent af2047ec
...@@ -204,7 +204,6 @@ struct hwq { ...@@ -204,7 +204,6 @@ struct hwq {
*/ */
struct afu *afu; struct afu *afu;
void *ctx_cookie; void *ctx_cookie;
struct cxl_ioctl_start_work work;
struct sisl_host_map __iomem *host_map; /* MC host map */ struct sisl_host_map __iomem *host_map; /* MC host map */
struct sisl_ctrl_map __iomem *ctrl_map; /* MC control map */ struct sisl_ctrl_map __iomem *ctrl_map; /* MC control map */
ctx_hndl_t ctx_hndl; /* master's context handle */ ctx_hndl_t ctx_hndl; /* master's context handle */
......
...@@ -1611,9 +1611,7 @@ static int start_context(struct cxlflash_cfg *cfg, u32 index) ...@@ -1611,9 +1611,7 @@ static int start_context(struct cxlflash_cfg *cfg, u32 index)
struct hwq *hwq = get_hwq(cfg->afu, index); struct hwq *hwq = get_hwq(cfg->afu, index);
int rc = 0; int rc = 0;
rc = cxl_start_context(hwq->ctx_cookie, rc = cxl_start_context(hwq->ctx_cookie, 0, NULL);
hwq->work.work_element_descriptor,
NULL);
dev_dbg(dev, "%s: returning rc=%d\n", __func__, rc); dev_dbg(dev, "%s: returning rc=%d\n", __func__, rc);
return rc; return rc;
......
...@@ -1309,7 +1309,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev, ...@@ -1309,7 +1309,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev,
struct afu *afu = cfg->afu; struct afu *afu = cfg->afu;
struct llun_info *lli = sdev->hostdata; struct llun_info *lli = sdev->hostdata;
struct glun_info *gli = lli->parent; 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 ctx_info *ctxi = NULL;
struct lun_access *lun_access = NULL; struct lun_access *lun_access = NULL;
int rc = 0; int rc = 0;
...@@ -1405,11 +1405,10 @@ static int cxlflash_disk_attach(struct scsi_device *sdev, ...@@ -1405,11 +1405,10 @@ static int cxlflash_disk_attach(struct scsi_device *sdev,
goto err; goto err;
} }
work = &ctxi->work; work.num_interrupts = irqs;
work->num_interrupts = irqs; work.flags = CXL_START_WORK_NUM_IRQS;
work->flags = CXL_START_WORK_NUM_IRQS;
rc = cxl_start_work(ctx, work); rc = cxl_start_work(ctx, &work);
if (unlikely(rc)) { if (unlikely(rc)) {
dev_dbg(dev, "%s: Could not start context rc=%d\n", dev_dbg(dev, "%s: Could not start context rc=%d\n",
__func__, rc); __func__, rc);
...@@ -1534,6 +1533,7 @@ static int recover_context(struct cxlflash_cfg *cfg, ...@@ -1534,6 +1533,7 @@ static int recover_context(struct cxlflash_cfg *cfg,
struct file *file; struct file *file;
void *ctx; void *ctx;
struct afu *afu = cfg->afu; struct afu *afu = cfg->afu;
struct cxl_ioctl_start_work work = { 0 };
ctx = cxl_dev_context_init(cfg->dev); ctx = cxl_dev_context_init(cfg->dev);
if (IS_ERR_OR_NULL(ctx)) { if (IS_ERR_OR_NULL(ctx)) {
...@@ -1543,7 +1543,10 @@ static int recover_context(struct cxlflash_cfg *cfg, ...@@ -1543,7 +1543,10 @@ static int recover_context(struct cxlflash_cfg *cfg,
goto out; 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)) { if (unlikely(rc)) {
dev_dbg(dev, "%s: Could not start context rc=%d\n", dev_dbg(dev, "%s: Could not start context rc=%d\n",
__func__, rc); __func__, rc);
......
...@@ -96,7 +96,6 @@ struct ctx_info { ...@@ -96,7 +96,6 @@ struct ctx_info {
struct llun_info **rht_lun; /* Mapping of RHT entries to LUNs */ struct llun_info **rht_lun; /* Mapping of RHT entries to LUNs */
u8 *rht_needs_ws; /* User-desired write-same function per RHTE */ u8 *rht_needs_ws; /* User-desired write-same function per RHTE */
struct cxl_ioctl_start_work work;
u64 ctxid; u64 ctxid;
u64 irqs; /* Number of interrupts requested for context */ u64 irqs; /* Number of interrupts requested for context */
pid_t pid; pid_t pid;
......
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