aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMatthew R. Ochs <mrochs@linux.vnet.ibm.com>2017-04-12 14:15:02 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2017-04-13 22:55:41 -0400
commit50b787f7235efbd074bbdf4315e0cc261d85b4d7 (patch)
treec2df9481419a8efbc021a1e61352e3e9b893f1df /drivers
parentscsi: cxlflash: Fence EEH during probe (diff)
downloadlinux-dev-50b787f7235efbd074bbdf4315e0cc261d85b4d7.tar.xz
linux-dev-50b787f7235efbd074bbdf4315e0cc261d85b4d7.zip
scsi: cxlflash: Remove unnecessary DMA mapping
Devices supported by the cxlflash driver are fully coherent and do not require a bus address mapping. Avoid unnecessary path length by using the virtual address and length already present in the scatter-gather entry. 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')
-rw-r--r--drivers/scsi/cxlflash/main.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index ebba3c90a242..3c4a83307e6e 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -176,7 +176,6 @@ static void cmd_complete(struct afu_cmd *cmd)
dev_dbg_ratelimited(dev, "%s:scp=%p result=%08x ioasc=%08x\n",
__func__, scp, scp->result, cmd->sa.ioasc);
- scsi_dma_unmap(scp);
scp->scsi_done(scp);
if (cmd_is_tmf) {
@@ -445,7 +444,6 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp)
struct scatterlist *sg = scsi_sglist(scp);
u16 req_flags = SISL_REQ_FLAGS_SUP_UNDERRUN;
ulong lock_flags;
- int nseg = 0;
int rc = 0;
dev_dbg_ratelimited(dev, "%s: (scp=%p) %d/%d/%d/%llu "
@@ -487,15 +485,8 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp)
}
if (likely(sg)) {
- nseg = scsi_dma_map(scp);
- if (unlikely(nseg < 0)) {
- dev_err(dev, "%s: Fail DMA map\n", __func__);
- rc = SCSI_MLQUEUE_HOST_BUSY;
- goto out;
- }
-
- cmd->rcb.data_len = sg_dma_len(sg);
- cmd->rcb.data_ea = sg_dma_address(sg);
+ cmd->rcb.data_len = sg->length;
+ cmd->rcb.data_ea = (uintptr_t)sg_virt(sg);
}
cmd->scp = scp;
@@ -513,8 +504,6 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp)
memcpy(cmd->rcb.cdb, scp->cmnd, sizeof(cmd->rcb.cdb));
rc = afu->send_cmd(afu, cmd);
- if (unlikely(rc))
- scsi_dma_unmap(scp);
out:
return rc;
}