cxlflash: Miscellaneous patches
cover cxlflash: Miscellaneous patches
This patch series contains miscellaneous fixes. The first patch fixes a bug while the rest improve the code structure and prepare the code for future enhancements.
This series is intended for 4.16 and is bisectable.
Matthew R. Ochs (3):
cxlflash: Explicitly cache number of interrupts per context
cxlflash: Remove embedded CXL work structures
cxlflash: Staging to support future accelerators
Uma Krishnan (3):
cxlflash: Reset command ioasc
cxlflash: Update cxl-specific arguments to generic cookie
cxlflash: Adapter context init can return error
drivers/scsi/cxlflash/Makefile | 2 +- drivers/scsi/cxlflash/backend.h | 41 ++++++++++ drivers/scsi/cxlflash/common.h | 8 +- drivers/scsi/cxlflash/cxl_hw.c | 168 ++++++++++++++++++++++++++++++++++++++ drivers/scsi/cxlflash/main.c | 100 +++++++++-------------- drivers/scsi/cxlflash/superpipe.c | 64 +++++++-------- drivers/scsi/cxlflash/superpipe.h | 4 +- 7 files changed, 288 insertions(+), 99 deletions(-) create mode 100644 drivers/scsi/cxlflash/backend.h create mode 100644 drivers/scsi/cxlflash/cxl_hw.c
Signature · 1 line
2.1.0
PATCH 1/6 cxlflash: Reset command ioasc
In the event of a command failure, cxlflash returns the failure to the upper layers to process. After processing the error, when the command is queued again, the private command structure will not be zeroed and the ioasc could be stale. Per the SISLite specification, the AFU only sets the ioasc in the presence of a failure. Thus, even though the original command succeeds the second time, the command is considered a failure due to stale ioasc. This cycle repeats indefinitely and can cause a hang or IO failure.
To fix the issue, clear the ioasc before queuing any command.
data")
--- drivers/scsi/cxlflash/main.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/cxlflash/main.c +1 -0
@@ -620,6 +620,7 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp) cmd->parent = afu; cmd->hwq_index = hwq_index; + cmd->sa.ioasc =0 ; cmd->rcb.ctx_id = hwq->ctx_hndl; cmd->rcb.msi =SISL_MSI_RRQ_UPDATED ; cmd->rcb.port_sel =CHAN2PORTMASK (scp->device->channel);
Signature · 1 line
2.1.0
PATCH 2/6 cxlflash: Update cxl-specific arguments to generic cookie
In reply to Uma KrishnanConvert cxl-specific pointers to generic cookies to facilitate future enhancements.
--- drivers/scsi/cxlflash/common.h | 4 ++-- drivers/scsi/cxlflash/main.c | 38 +++++++++++++++++++------------------- drivers/scsi/cxlflash/superpipe.c | 15 +++++++-------- drivers/scsi/cxlflash/superpipe.h | 2 +- 4 files changed, 29 insertions(+), 30 deletions(-)
drivers/scsi/cxlflash/common.h +2 -2
@@ -129,7 +129,7 @@ struct cxlflash_cfg {int lr_port;atomic_t scan_host_needed; -struct cxl_afu *cxl_afu; +void *afu_cookie;atomic_t recovery_threads;struct mutex ctx_recovery_mutex;
@@ -203,7 +203,7 @@ struct hwq {* fields after this point */ struct afu *afu; -struct cxl_context *ctx; +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 */
drivers/scsi/cxlflash/main.c +19 -19
@@ -739,7 +739,7 @@ static void term_intr(struct cxlflash_cfg *cfg, enum undo_level level, hwq =get_hwq (afu, index); -if (!hwq->ctx) { +if (!hwq->ctx_cookie) {dev_err (dev,"%s: returning with NULL MC\n" , __func__);return ; }
@@ -748,13 +748,13 @@ static void term_intr(struct cxlflash_cfg *cfg, enum undo_level level,case UNMAP_THREE :/* SISL_MSI_ASYNC_ERROR is setup only for the primary HWQ */ if (index ==PRIMARY_HWQ ) -cxl_unmap_afu_irq (hwq->ctx,3 , hwq); +cxl_unmap_afu_irq (hwq->ctx_cookie,3 , hwq);case UNMAP_TWO : -cxl_unmap_afu_irq (hwq->ctx,2 , hwq); +cxl_unmap_afu_irq (hwq->ctx_cookie,2 , hwq);case UNMAP_ONE : -cxl_unmap_afu_irq (hwq->ctx,1 , hwq); +cxl_unmap_afu_irq (hwq->ctx_cookie,1 , hwq);case FREE_IRQ : -cxl_free_afu_irqs (hwq->ctx); +cxl_free_afu_irqs (hwq->ctx_cookie);/* fall through */ case UNDO_NOOP :/* No action required */
@@ -783,15 +783,15 @@ static void term_mc(struct cxlflash_cfg *cfg, u32 index) hwq =get_hwq (afu, index); -if (!hwq->ctx) { +if (!hwq->ctx_cookie) {dev_err (dev,"%s: returning with NULL MC\n" , __func__);return ; } -WARN_ON (cxl_stop_context (hwq->ctx)); +WARN_ON (cxl_stop_context (hwq->ctx_cookie));if (index !=PRIMARY_HWQ ) -WARN_ON (cxl_release_context (hwq->ctx)); - hwq->ctx =NULL ; +WARN_ON (cxl_release_context (hwq->ctx_cookie)); + hwq->ctx_cookie =NULL ;spin_lock_irqsave (&hwq->hsq_slock, lock_flags);flush_pending_cmds (hwq);
@@ -1611,7 +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, + rc =cxl_start_context (hwq->ctx_cookie, hwq->work.work_element_descriptor,NULL );
@@ -1748,7 +1748,7 @@ static void init_pcr(struct cxlflash_cfg *cfg)for (i =0 ; i < afu->num_hwqs; i++) { hwq =get_hwq (afu, i); - hwq->ctx_hndl = (u16 )cxl_process_element (hwq->ctx); + hwq->ctx_hndl = (u16 )cxl_process_element (hwq->ctx_cookie); hwq->host_map = &afu->afu_map->hosts[hwq->ctx_hndl].host; hwq->ctrl_map = &afu->afu_map->ctrls[hwq->ctx_hndl].ctrl;
@@ -1926,7 +1926,7 @@ static enum undo_level init_intr(struct cxlflash_cfg *cfg, struct hwq *hwq) {struct device *dev = &cfg->dev->dev; -struct cxl_context *ctx = hwq->ctx; +void *ctx = hwq->ctx_cookie;int rc =0 ;enum undo_level level =UNDO_NOOP ;bool is_primary_hwq = (hwq->index ==PRIMARY_HWQ );
@@ -1980,7 +1980,7 @@ static enum undo_level init_intr(struct cxlflash_cfg *cfg,*/ static int init_mc (struct cxlflash_cfg *cfg,u32 index) { -struct cxl_context *ctx; +void *ctx;struct device *dev = &cfg->dev->dev;struct hwq *hwq =get_hwq (cfg->afu, index);int rc =0 ;
@@ -1999,8 +1999,8 @@ static int init_mc(struct cxlflash_cfg *cfg, u32 index) goto err1; } -WARN_ON (hwq->ctx); - hwq->ctx = ctx; +WARN_ON (hwq->ctx_cookie); + hwq->ctx_cookie = ctx;/* Set it up as a master with the CXL */ cxl_set_master (ctx);
@@ -2040,7 +2040,7 @@ static int init_mc(struct cxlflash_cfg *cfg, u32 index)if (index !=PRIMARY_HWQ )cxl_release_context (ctx); err1: - hwq->ctx =NULL ; + hwq->ctx_cookie =NULL ; goto out; }
@@ -2095,7 +2095,7 @@ static int init_afu(struct cxlflash_cfg *cfg)struct hwq *hwq;int i; -cxl_perst_reloads_same_image (cfg->cxl_afu, true); +cxl_perst_reloads_same_image (cfg->afu_cookie, true); afu->num_hwqs = afu->desired_hwqs;for (i =0 ; i < afu->num_hwqs; i++) {
@@ -2109,7 +2109,7 @@ static int init_afu(struct cxlflash_cfg *cfg)/* Map the entire MMIO space of the AFU using the first context */ hwq =get_hwq (afu,PRIMARY_HWQ ); - afu->afu_map =cxl_psa_map (hwq->ctx); + afu->afu_map =cxl_psa_map (hwq->ctx_cookie);if (!afu->afu_map) {dev_err (dev,"%s: cxl_psa_map failed\n" , __func__); rc = -ENOMEM ;
@@ -3702,7 +3702,7 @@ static int cxlflash_probe(struct pci_dev *pdev,pci_set_drvdata (pdev, cfg); - cfg->cxl_afu =cxl_pci_to_afu (pdev); + cfg->afu_cookie =cxl_pci_to_afu (pdev); rc =init_pci (cfg);if (rc) {
drivers/scsi/cxlflash/superpipe.c +7 -8
@@ -810,14 +810,13 @@ static struct ctx_info *create_context(struct cxlflash_cfg *cfg)* init_context() - initializes a previously allocated context * @ctxi: Previously allocated context * @cfg: Internal structure associated with the host. -* @ctx: Previously obtained CXL context reference. +* @ctx: Previously obtained context cookie. * @ctxid: Previously obtained process element associated with CXL context. * @file: Previously obtained file associated with CXL context. * @perms: User-specified permissions. */ static void init_context (struct ctx_info *ctxi,struct cxlflash_cfg *cfg, -struct cxl_context *ctx,int ctxid,struct file *file, -u32 perms) +void *ctx,int ctxid,struct file *file,u32 perms) {struct afu *afu = cfg->afu;
@@ -976,7 +975,7 @@ static int cxlflash_disk_detach(struct scsi_device *sdev,*/ static int cxlflash_cxl_release (struct inode *inode,struct file *file) { -struct cxl_context *ctx =cxl_fops_get_context (file); +void *ctx =cxl_fops_get_context (file); struct cxlflash_cfg *cfg = container_of(file->f_op, struct cxlflash_cfg, cxl_fops);struct device *dev = &cfg->dev->dev;
@@ -1089,7 +1088,7 @@ static int cxlflash_mmap_fault(struct vm_fault *vmf) {struct vm_area_struct *vma = vmf->vma;struct file *file = vma->vm_file; -struct cxl_context *ctx =cxl_fops_get_context (file); +void *ctx =cxl_fops_get_context (file); struct cxlflash_cfg *cfg = container_of(file->f_op, struct cxlflash_cfg, cxl_fops);struct device *dev = &cfg->dev->dev;
@@ -1162,7 +1161,7 @@ static const struct vm_operations_struct cxlflash_mmap_vmops = {*/ static int cxlflash_cxl_mmap (struct file *file,struct vm_area_struct *vma) { -struct cxl_context *ctx =cxl_fops_get_context (file); +void *ctx =cxl_fops_get_context (file); struct cxlflash_cfg *cfg = container_of(file->f_op, struct cxlflash_cfg, cxl_fops);struct device *dev = &cfg->dev->dev;
@@ -1317,7 +1316,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev,u64 rctxid =0UL ;struct file *file =NULL ; -struct cxl_context *ctx =NULL ; +void *ctx =NULL ;int fd =-1 ;
@@ -1529,7 +1528,7 @@ static int recover_context(struct cxlflash_cfg *cfg,int fd =-1 ;int ctxid =-1 ;struct file *file; -struct cxl_context *ctx; +void *ctx;struct afu *afu = cfg->afu; ctx =cxl_dev_context_init (cfg->dev);
drivers/scsi/cxlflash/superpipe.h +1 -1
@@ -104,7 +104,7 @@ struct ctx_info {bool err_recovery_active;struct mutex mutex;/* Context protection */ struct kref kref; -struct cxl_context *ctx; +void *ctx;struct cxlflash_cfg *cfg;struct list_head luns;/* LUNs attached to this context */ const struct vm_operations_struct *cxl_mmap_vmops;
Signature · 1 line
2.1.0
PATCH 3/6 cxlflash: Explicitly cache number of interrupts per context
In reply to Uma KrishnanFrom: "Matthew R. Ochs" <[email protected]>
The number of interrupts a user requests during a context attach is presently stored within the CXL work ioctl structure that is nested alongside the per context metadata. Keeping this data in a structure that is tied to a particular hardware implementation (CXL) will only complicate matters when supporting newer accelerator transports.
Instead of relying upon the number of interrupts being cached within a CXL-specific structure, explicitly cache the value within the context information structure.
--- drivers/scsi/cxlflash/superpipe.c | 14 +++++++++----- drivers/scsi/cxlflash/superpipe.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-)
drivers/scsi/cxlflash/superpipe.c +9 -5
@@ -814,15 +814,18 @@ static struct ctx_info *create_context(struct cxlflash_cfg *cfg)* @ctxid: Previously obtained process element associated with CXL context. * @file: Previously obtained file associated with CXL context. * @perms: User-specified permissions. +* @irqs: User-specified number of interrupts. */ static void init_context (struct ctx_info *ctxi,struct cxlflash_cfg *cfg, -void *ctx,int ctxid,struct file *file,u32 perms) +void *ctx,int ctxid,struct file *file,u32 perms, +u64 irqs) {struct afu *afu = cfg->afu; ctxi->rht_perms = perms; ctxi->ctrl_map = &afu->afu_map->ctrls[ctxid].ctrl; ctxi->ctxid =ENCODE_CTXID (ctxi, ctxid); + ctxi->irqs = irqs; ctxi->pid =task_tgid_nr (current);/* tgid = pid */ ctxi->ctx = ctx; ctxi->cfg = cfg;
@@ -1312,6 +1315,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev,int rc =0 ;u32 perms;int ctxid =-1 ; +u64 irqs = attach->num_interrupts;u64 flags =0UL ;u64 rctxid =0UL ;struct file *file =NULL ;
@@ -1320,9 +1324,9 @@ static int cxlflash_disk_attach(struct scsi_device *sdev,int fd =-1 ; -if (attach->num_interrupts >4 ) { +if (irqs >4 ) {dev_dbg (dev,"%s: Cannot support this many interrupts %llu\n" , - __func__, attach->num_interrupts); + __func__, irqs); rc = -EINVAL ; goto out; }
@@ -1402,7 +1406,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev, } work = &ctxi->work; - work->num_interrupts = attach->num_interrupts; + work->num_interrupts = irqs; work->flags =CXL_START_WORK_NUM_IRQS ; rc =cxl_start_work (ctx, work);
@@ -1430,7 +1434,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev, perms =SISL_RHT_PERM (attach->hdr.flags +1 );/* Context mutex is locked upon return */ -init_context (ctxi, cfg, ctx, ctxid, file, perms); +init_context (ctxi, cfg, ctx, ctxid, file, perms, irqs); rc =afu_attach (cfg, ctxi);if (unlikely (rc)) {
drivers/scsi/cxlflash/superpipe.h +1 -0
@@ -98,6 +98,7 @@ struct ctx_info {struct cxl_ioctl_start_work work;u64 ctxid; +u64 irqs;/* Number of interrupts requested for context */ pid_t pid;bool initialized;bool unavail;
Signature · 1 line
2.1.0
PATCH 4/6 cxlflash: Remove embedded CXL work structures
In reply to Uma KrishnanFrom: "Matthew R. Ochs" <[email protected]>
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.
--- 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(-)
drivers/scsi/cxlflash/common.h +0 -1
@@ -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 */
drivers/scsi/cxlflash/main.c +1 -3
@@ -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;
drivers/scsi/cxlflash/superpipe.c +9 -6
@@ -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);
drivers/scsi/cxlflash/superpipe.h +0 -1
@@ -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;
Signature · 1 line
2.1.0
PATCH 5/6 cxlflash: Adapter context init can return error
In reply to Uma KrishnanAdapter context creation can return either NULL or an error pointer. Updating the check condition to reflect this.
--- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/cxlflash/main.c +1 -1
@@ -1992,7 +1992,7 @@ static int init_mc(struct cxlflash_cfg *cfg, u32 index) ctx =cxl_get_context (cfg->dev); else ctx =cxl_dev_context_init (cfg->dev); -if (unlikely (!ctx)) { +if (IS_ERR_OR_NULL (ctx)) { rc = -ENOMEM ; goto err1; }
Signature · 1 line
2.1.0
PATCH 6/6 cxlflash: Staging to support future accelerators
In reply to Uma KrishnanFrom: "Matthew R. Ochs" <[email protected]>
As staging to support future accelerator transports, add a shim layer such that the underlying services the cxlflash driver requires can be conditional upon the accelerator infrastructure.
--- drivers/scsi/cxlflash/Makefile | 2 +- drivers/scsi/cxlflash/backend.h | 41 ++++++++++ drivers/scsi/cxlflash/common.h | 3 + drivers/scsi/cxlflash/cxl_hw.c | 168 ++++++++++++++++++++++++++++++++++++++ drivers/scsi/cxlflash/main.c | 79 +++++++----------- drivers/scsi/cxlflash/superpipe.c | 48 +++++------ 6 files changed, 263 insertions(+), 78 deletions(-) create mode 100644 drivers/scsi/cxlflash/backend.h create mode 100644 drivers/scsi/cxlflash/cxl_hw.c
drivers/scsi/cxlflash/Makefile +1 -1
@@ -1,2 +1,2 @@ obj-$(CONFIG_CXLFLASH) += cxlflash.o -cxlflash-y += main.o superpipe.o lunmgt.o vlun.o +cxlflash-y += main.o superpipe.o lunmgt.o vlun.o cxl_hw.o
drivers/scsi/cxlflash/backend.h new file +41 -0
41 lines not on this page · raw message
drivers/scsi/cxlflash/common.h +3 -0
@@ -25,6 +25,8 @@#include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> +#include "backend.h" +extern const struct file_operations cxlflash_cxl_fops;#define MAX_CONTEXT CXLFLASH_MAX_CONTEXT/* num contexts per afu */
@@ -114,6 +116,7 @@ enum cxlflash_hwq_mode {struct cxlflash_cfg {struct afu *afu; +const struct cxlflash_backend_ops *ops;struct pci_dev *dev;struct pci_device_id *dev_id;struct Scsi_Host *host;
drivers/scsi/cxlflash/cxl_hw.c new file +168 -0
168 lines not on this page · raw message
drivers/scsi/cxlflash/main.c +30 -49
203 lines not on this page · raw message
drivers/scsi/cxlflash/superpipe.c +20 -28
170 lines not on this page · raw message
Signature · 1 line
2.1.0
Re: [PATCH 1/6] cxlflash: Reset command ioasc
In reply to Uma KrishnanQuoted 8 lines · Uma Krishnan
In the event of a command failure, cxlflash returns the failure to the upper layers to process. After processing the error, when the command is queued again, the private command structure will not be zeroed and the ioasc could be stale. Per the SISLite specification, the AFU only sets the ioasc in the presence of a failure. Thus, even though the original command succeeds the second time, the command is considered a failure due to stale ioasc. This cycle repeats indefinitely and can cause a hang or IO failure.
Quoted 5 lines
To fix the issue, clear the ioasc before queuing any command.
Fixes 479ad8e9d48c ("scsi: cxlflash: Remove zeroing of private commanddata")
Signed-off-by Uma Krishnan <[email protected]>
Should this go to stable?
Quoted 17 lines
--- drivers/scsi/cxlflash/main.c | 1 + 1 file changed, 1 insertion(+)drivers/scsi/cxlflash/main.c +1
-0@@ -620,6 +620,7 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp) cmd->parent = afu; cmd->hwq_index = hwq_index; + cmd->sa.ioasc =0 ; cmd->rcb.ctx_id = hwq->ctx_hndl; cmd->rcb.msi =SISL_MSI_RRQ_UPDATED ; cmd->rcb.port_sel =CHAN2PORTMASK (scp->device->channel);
Signature · 2 lines
Andrew Donnellan OzLabs, ADL Canberra [email protected] IBM Australia Limited
Re: [PATCH 1/6] cxlflash: Reset command ioasc
In reply to Uma KrishnanQuoted 8 lines · Uma Krishnan
In the event of a command failure, cxlflash returns the failure to the upper layers to process. After processing the error, when the command is queued again, the private command structure will not be zeroed and the ioasc could be stale. Per the SISLite specification, the AFU only sets the ioasc in the presence of a failure. Thus, even though the original command succeeds the second time, the command is considered a failure due to stale ioasc. This cycle repeats indefinitely and can cause a hang or IO failure.
Quoted 5 lines
To fix the issue, clear the ioasc before queuing any command.
Fixes 479ad8e9d48c ("scsi: cxlflash: Remove zeroing of private commanddata")
Signed-off-by Uma Krishnan <[email protected]>
Re: [PATCH 1/6] cxlflash: Reset command ioasc
In reply to Andrew DonnellanQuoted 9 lines · Andrew Donnellan
Quoted 8 lines · Uma Krishnan
In the event of a command failure, cxlflash returns the failure to the upper layers to process. After processing the error, when the command is queued again, the private command structure will not be zeroed and the ioasc could be stale. Per the SISLite specification, the AFU only sets the ioasc in the presence of a failure. Thus, even though the original command succeeds the second time, the command is considered a failure due to stale ioasc. This cycle repeats indefinitely and can cause a hang or IO failure.
Quoted 7 lines
Quoted 5 lines
To fix the issue, clear the ioasc before queuing any command.
Fixes 479ad8e9d48c ("scsi: cxlflash: Remove zeroing of private commanddata")
Signed-off-by Uma Krishnan <[email protected]>Should this go to stable?
Not a bad idea.
Re: [PATCH 2/6] cxlflash: Update cxl-specific arguments to generic cookie
In reply to Uma KrishnanQuoted 4 lines · Uma Krishnan
Convert cxl-specific pointers to generic cookies to facilitate future enhancements.
Signed-off-by Uma Krishnan <[email protected]>
Re: [PATCH 5/6] cxlflash: Adapter context init can return error
In reply to Uma KrishnanQuoted 4 lines · Uma Krishnan
Adapter context creation can return either NULL or an error pointer. Updating the check condition to reflect this.
Signed-off-by Uma Krishnan <[email protected]>
Re: [PATCH 1/6] cxlflash: Reset command ioasc
In reply to Matthew R. OchsOn Jan 7, 2018, at 1:36 PM, Matthew R. Ochs <[email protected]> wrote:
On Thu, Jan 04, 2018 at 05:33:48PM +1100, Andrew Donnellan wrote:
On 04/01/18 09:54, Uma Krishnan wrote:
In the event of a command failure, cxlflash returns the failure to the upper layers to process. After processing the error, when the command is queued again, the private command structure will not be zeroed and the ioasc could be stale. Per the SISLite specification, the AFU only sets the ioasc in the presence of a failure. Thus, even though the original command succeeds the second time, the command is considered a failure due to stale ioasc. This cycle repeats indefinitely and can cause a hang or IO failure.
To fix the issue, clear the ioasc before queuing any command.
data")
Should this go to stable?
Not a bad idea.
I will forward the patch to stable once the patch is in next/master. Unless there is a need to send a V2. Thanks for pointing out Andrew !!
Re: [PATCH 1/6] cxlflash: Reset command ioasc
In reply to Matthew R. OchsQuoted 15 lines · Matthew R. Ochs
Quoted 11 lines · Andrew Donnellan
Quoted 10 lines · Uma Krishnan
In the event of a command failure, cxlflash returns the failure to the upper layers to process. After processing the error, when the command is queued again, the private command structure will not be zeroed and the ioasc could be stale. Per the SISLite specification, the AFU only sets the ioasc in the presence of a failure. Thus, even though the original command succeeds the second time, the command is considered a failure due to stale ioasc. This cycle repeats indefinitely and can cause a hang or IO failure.
To fix the issue, clear the ioasc before queuing any command.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Fixes 479ad8e9d48c ("scsi: cxlflash: Remove zeroing of private commanddata")
Signed-off-by Uma Krishnan <[email protected]>Should this go to stable?
Not a bad idea.
I will forward the patch to stable once the patch is in next/master. Unless there is a need to send a V2. Thanks for pointing out Andrew !!
Uma,
Quoted 3 lines
This patch series contains miscellaneous fixes. The first patch fixes a bug while the rest improve the code structure and prepare the code for future enhancements.
Added stable tag to first patch and applied series to 4.16/scsi-queue. Thank you!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering