Quoting "Matthew R. Ochs" <mrochs@xxxxxxxxxxxxxxxxxx>:
Introduce support for enhanced I/O error handling.
Signed-off-by: Matthew R. Ochs <mrochs@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Manoj N. Kumar <manoj@xxxxxxxxxxxxxxxxxx>
---
drivers/scsi/cxlflash/Kconfig | 2 +-
drivers/scsi/cxlflash/common.h | 11 ++-
drivers/scsi/cxlflash/main.c | 166
++++++++++++++++++++++++++++++++++++++---
drivers/scsi/cxlflash/main.h | 4 +
4 files changed, 170 insertions(+), 13 deletions(-)
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 76a7286..18359d4 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -380,6 +380,18 @@ static int cxlflash_queuecommand(struct
Scsi_Host *host, struct scsi_cmnd *scp)
}
spin_unlock_irqrestore(&cfg->tmf_waitq.lock, lock_flags);
+ switch (cfg->state) {
+ case STATE_LIMBO:
+ pr_debug_ratelimited("%s: device in limbo!\n", __func__);
+ rc = SCSI_MLQUEUE_HOST_BUSY;
+ goto out;
remove "goto out", return SCSI_MLQUEUE_HOST_BUSY;
+ case STATE_FAILTERM:
+ pr_debug_ratelimited("%s: device has failed!\n", __func__);
+ goto error;
+ default:
+ break;
+ }
+
cmd = cxlflash_cmd_checkout(afu);
if (unlikely(!cmd)) {
pr_err("%s: could not get a free command\n", __func__);
@@ -428,6 +440,10 @@ static int cxlflash_queuecommand(struct
Scsi_Host *host, struct scsi_cmnd *scp)
out:
return rc;
+error:
+ scp->result = (DID_NO_CONNECT << 16);
+ scp->scsi_done(scp);
+ return 0;
}
I have reviewed most of part in v2.
Thanks,
Wendy
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html