aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-03-09 09:50:40 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 13:15:44 -0400
commit2505873afe510d8db05665684c056ac8f0b24563 (patch)
tree94de8c445c8e0d341d0f1765f651ff6a728cea92
parent647b24256241e144fe8369244da1730b577211e9 (diff)
[SCSI] aic79xx: fix IOMMU mapping failure handling
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 72fccd9f40df..0081aa357c8b 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -1413,6 +1413,10 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
1413 unsigned long flags; 1413 unsigned long flags;
1414 int nseg; 1414 int nseg;
1415 1415
1416 nseg = scsi_dma_map(cmd);
1417 if (nseg < 0)
1418 return SCSI_MLQUEUE_HOST_BUSY;
1419
1416 ahd_lock(ahd, &flags); 1420 ahd_lock(ahd, &flags);
1417 1421
1418 /* 1422 /*
@@ -1430,6 +1434,7 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
1430 if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) { 1434 if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) {
1431 ahd->flags |= AHD_RESOURCE_SHORTAGE; 1435 ahd->flags |= AHD_RESOURCE_SHORTAGE;
1432 ahd_unlock(ahd, &flags); 1436 ahd_unlock(ahd, &flags);
1437 scsi_dma_unmap(cmd);
1433 return SCSI_MLQUEUE_HOST_BUSY; 1438 return SCSI_MLQUEUE_HOST_BUSY;
1434 } 1439 }
1435 1440
@@ -1485,8 +1490,6 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
1485 ahd_set_sense_residual(scb, 0); 1490 ahd_set_sense_residual(scb, 0);
1486 scb->sg_count = 0; 1491 scb->sg_count = 0;
1487 1492
1488 nseg = scsi_dma_map(cmd);
1489 BUG_ON(nseg < 0);
1490 if (nseg > 0) { 1493 if (nseg > 0) {
1491 void *sg = scb->sg_list; 1494 void *sg = scb->sg_list;
1492 struct scatterlist *cur_seg; 1495 struct scatterlist *cur_seg;