Commit 2505873a authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley

[SCSI] aic79xx: fix IOMMU mapping failure handling

Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 647b2425
...@@ -1413,6 +1413,10 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev, ...@@ -1413,6 +1413,10 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
unsigned long flags; unsigned long flags;
int nseg; int nseg;
nseg = scsi_dma_map(cmd);
if (nseg < 0)
return SCSI_MLQUEUE_HOST_BUSY;
ahd_lock(ahd, &flags); ahd_lock(ahd, &flags);
/* /*
...@@ -1430,6 +1434,7 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev, ...@@ -1430,6 +1434,7 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) { if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) {
ahd->flags |= AHD_RESOURCE_SHORTAGE; ahd->flags |= AHD_RESOURCE_SHORTAGE;
ahd_unlock(ahd, &flags); ahd_unlock(ahd, &flags);
scsi_dma_unmap(cmd);
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;
} }
...@@ -1485,8 +1490,6 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev, ...@@ -1485,8 +1490,6 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
ahd_set_sense_residual(scb, 0); ahd_set_sense_residual(scb, 0);
scb->sg_count = 0; scb->sg_count = 0;
nseg = scsi_dma_map(cmd);
BUG_ON(nseg < 0);
if (nseg > 0) { if (nseg > 0) {
void *sg = scb->sg_list; void *sg = scb->sg_list;
struct scatterlist *cur_seg; struct scatterlist *cur_seg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment