summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fnic/fnic_scsi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 16:20:21 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 16:20:21 -0800
commita3e7531535a0c6e5acbaa5436f37933bb471aa95 (patch)
tree99e9269c85a8b358da551a2f95a00540394af72a /drivers/scsi/fnic/fnic_scsi.c
parent39cf7c398122ff6d7df13d2832810933d227ac59 (diff)
parenta82544c7baccf2d8a12cee46110cc7d356d3edf0 (diff)
downloadlinux-a3e7531535a0c6e5acbaa5436f37933bb471aa95.tar.bz2
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley: "First round of SCSI updates for the 4.4 merge window. This batch includes a couple of minor fixes, some core changes to help issues we're still seeing with the suspend/resume code and updates to lpfc and cxlflash. We're (actually Martin Petersen is) trying to wrangle a mpt2/mpt3sas merger for the merge window which will help enormously with the maintenance burden, so there will be another round before it closes" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (56 commits) cxlflash: Fix to avoid bypassing context cleanup cxlflash: Fix to avoid lock instrumentation rejection cxlflash: Fix to avoid corrupting port selection mask cxlflash: Fix to escalate to LINK_RESET on login timeout cxlflash: Fix to avoid leaving dangling interrupt resources cxlflash: Fix to avoid potential deadlock on EEH cxlflash: Correct trace string cxlflash: Fix to avoid corrupting adapter fops cxlflash: Fix to double the delay each time MAINTAINERS: Add cxlflash driver cxlflash: Fix to prevent stale AFU RRQ cxlflash: Correct spelling, grammar, and alignment mistakes cxlflash: Fix to prevent EEH recovery failure cxlflash: Fix MMIO and endianness errors cxlflash: Fix function prolog parameters and return codes cxlflash: Remove unnecessary scsi_block_requests cxlflash: Correct behavior in device reset handler following EEH cxlflash: Fix to prevent workq from accessing freed memory cxlflash: Correct usage of scsi_host_put() cxlflash: Fix AFU version access/storage and add check ...
Diffstat (limited to 'drivers/scsi/fnic/fnic_scsi.c')
-rw-r--r--drivers/scsi/fnic/fnic_scsi.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index 25436cd2860c..266b909fe854 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -330,6 +330,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
int flags;
u8 exch_flags;
struct scsi_lun fc_lun;
+ int r;
if (sg_count) {
/* For each SGE, create a device desc entry */
@@ -346,6 +347,12 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
io_req->sgl_list,
sizeof(io_req->sgl_list[0]) * sg_count,
PCI_DMA_TODEVICE);
+
+ r = pci_dma_mapping_error(fnic->pdev, io_req->sgl_list_pa);
+ if (r) {
+ printk(KERN_ERR "PCI mapping failed with error %d\n", r);
+ return SCSI_MLQUEUE_HOST_BUSY;
+ }
}
io_req->sense_buf_pa = pci_map_single(fnic->pdev,
@@ -353,6 +360,15 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
SCSI_SENSE_BUFFERSIZE,
PCI_DMA_FROMDEVICE);
+ r = pci_dma_mapping_error(fnic->pdev, io_req->sense_buf_pa);
+ if (r) {
+ pci_unmap_single(fnic->pdev, io_req->sgl_list_pa,
+ sizeof(io_req->sgl_list[0]) * sg_count,
+ PCI_DMA_TODEVICE);
+ printk(KERN_ERR "PCI mapping failed with error %d\n", r);
+ return SCSI_MLQUEUE_HOST_BUSY;
+ }
+
int_to_scsilun(sc->device->lun, &fc_lun);
/* Enqueue the descriptor in the Copy WQ */