From: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
To: linux-scsi@vger.kernel.org,
James Bottomley <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>,
"Manoj N. Kumar" <manoj@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org,
Andrew Donnellan <andrew.donnellan@au1.ibm.com>,
Frederic Barrat <fbarrat@linux.vnet.ibm.com>,
Christophe Lombard <clombard@linux.vnet.ibm.com>
Subject: [PATCH 4/6] cxlflash: Remove embedded CXL work structures
Date: Wed, 3 Jan 2018 16:54:50 -0600 [thread overview]
Message-ID: <1515020090-43721-1-git-send-email-ukrishn@linux.vnet.ibm.com> (raw)
In-Reply-To: <1515020002-43551-1-git-send-email-ukrishn@linux.vnet.ibm.com>
From: "Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>
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>
---
drivers/scsi/cxlflash/common.h | 1 -
drivers/scsi/cxlflash/main.c | 4 +---
drivers/scsi/cxlflash/superpipe.c | 15 +++++++++------
drivers/scsi/cxlflash/superpipe.h | 1 -
4 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h
index d2a180d..48df89f 100644
--- a/drivers/scsi/cxlflash/common.h
+++ b/drivers/scsi/cxlflash/common.h
@@ -204,7 +204,6 @@ struct hwq {
*/
struct afu *afu;
void *ctx_cookie;
- struct cxl_ioctl_start_work work;
struct sisl_host_map __iomem *host_map; /* MC host map */
struct sisl_ctrl_map __iomem *ctrl_map; /* MC control map */
ctx_hndl_t ctx_hndl; /* master's context handle */
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 3880d52..b6cadeb 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -1611,9 +1611,7 @@ static int start_context(struct cxlflash_cfg *cfg, u32 index)
struct hwq *hwq = get_hwq(cfg->afu, index);
int rc = 0;
- rc = cxl_start_context(hwq->ctx_cookie,
- hwq->work.work_element_descriptor,
- NULL);
+ rc = cxl_start_context(hwq->ctx_cookie, 0, NULL);
dev_dbg(dev, "%s: returning rc=%d\n", __func__, rc);
return rc;
diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c
index ecfa553..51f67dc 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);
diff --git a/drivers/scsi/cxlflash/superpipe.h b/drivers/scsi/cxlflash/superpipe.h
index b761293..35c3cbf 100644
--- a/drivers/scsi/cxlflash/superpipe.h
+++ b/drivers/scsi/cxlflash/superpipe.h
@@ -96,7 +96,6 @@ struct ctx_info {
struct llun_info **rht_lun; /* Mapping of RHT entries to LUNs */
u8 *rht_needs_ws; /* User-desired write-same function per RHTE */
- struct cxl_ioctl_start_work work;
u64 ctxid;
u64 irqs; /* Number of interrupts requested for context */
pid_t pid;
--
2.1.0
next prev parent reply other threads:[~2018-01-03 22:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 22:53 [PATCH 0/6] cxlflash: Miscellaneous patches Uma Krishnan
2018-01-03 22:54 ` [PATCH 1/6] cxlflash: Reset command ioasc Uma Krishnan
2018-01-04 6:33 ` Andrew Donnellan
2018-01-07 19:36 ` Matthew R. Ochs
2018-01-08 16:43 ` Uma Krishnan
2018-01-08 16:59 ` Uma Krishnan
2018-01-07 19:27 ` Matthew R. Ochs
2018-01-03 22:54 ` [PATCH 2/6] cxlflash: Update cxl-specific arguments to generic cookie Uma Krishnan
2018-01-07 19:40 ` Matthew R. Ochs
2018-01-03 22:54 ` [PATCH 3/6] cxlflash: Explicitly cache number of interrupts per context Uma Krishnan
2018-01-03 22:54 ` Uma Krishnan [this message]
2018-01-03 22:55 ` [PATCH 5/6] cxlflash: Adapter context init can return error Uma Krishnan
2018-01-07 19:42 ` Matthew R. Ochs
2018-01-03 22:55 ` [PATCH 6/6] cxlflash: Staging to support future accelerators Uma Krishnan
2018-01-09 3:07 ` [PATCH 0/6] cxlflash: Miscellaneous patches Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1515020090-43721-1-git-send-email-ukrishn@linux.vnet.ibm.com \
--to=ukrishn@linux.vnet.ibm.com \
--cc=andrew.donnellan@au1.ibm.com \
--cc=clombard@linux.vnet.ibm.com \
--cc=fbarrat@linux.vnet.ibm.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=manoj@linux.vnet.ibm.com \
--cc=martin.petersen@oracle.com \
--cc=mrochs@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).