[ARM] ARM SCSI: Don't try to dma_map_sg too many scatterlist entries
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Sun, 4 Mar 2007 20:21:38 +0000 (20:21 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 4 Mar 2007 20:33:31 +0000 (20:33 +0000)
An off-by-one bug meant we were always trying to map one too many
scatterlist entries.  This was mostly harmless prior to the checks
going in to consistent_sync(), but now causes the kernel to BUG.

Also, powertec.c was missing an assignment to info->ec.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/scsi/arm/cumana_2.c
drivers/scsi/arm/eesox.c
drivers/scsi/arm/powertec.c

index d2d51dc51ab83727f8761ab7c25425ac32ad77a3..82add77ad1316714fbe7cb3b28b65f996e1ac824 100644 (file)
@@ -178,10 +178,10 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
                        dma_dir = DMA_MODE_READ,
                        alatch_dir = ALATCH_DMA_IN;
 
-               dma_map_sg(dev, info->sg, bufs + 1, map_dir);
+               dma_map_sg(dev, info->sg, bufs, map_dir);
 
                disable_dma(dmach);
-               set_dma_sg(dmach, info->sg, bufs + 1);
+               set_dma_sg(dmach, info->sg, bufs);
                writeb(alatch_dir, info->base + CUMANASCSI2_ALATCH);
                set_dma_mode(dmach, dma_dir);
                enable_dma(dmach);
index d4136524fc46aafc3f794a5f3a37975177535636..ed06a8c19ad649aafcdc06c3ee5bf7fe4ca29815 100644 (file)
@@ -175,10 +175,10 @@ eesoxscsi_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
                        map_dir = DMA_FROM_DEVICE,
                        dma_dir = DMA_MODE_READ;
 
-               dma_map_sg(dev, info->sg, bufs + 1, map_dir);
+               dma_map_sg(dev, info->sg, bufs, map_dir);
 
                disable_dma(dmach);
-               set_dma_sg(dmach, info->sg, bufs + 1);
+               set_dma_sg(dmach, info->sg, bufs);
                set_dma_mode(dmach, dma_dir);
                enable_dma(dmach);
                return fasdma_real_all;
index f9cd20bfb95890f9ae79cb1d162e41865bf12f4f..159047a34997e99638f2cead22b3d634d8dadb0b 100644 (file)
@@ -148,10 +148,10 @@ powertecscsi_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
                        map_dir = DMA_FROM_DEVICE,
                        dma_dir = DMA_MODE_READ;
 
-               dma_map_sg(dev, info->sg, bufs + 1, map_dir);
+               dma_map_sg(dev, info->sg, bufs, map_dir);
 
                disable_dma(dmach);
-               set_dma_sg(dmach, info->sg, bufs + 1);
+               set_dma_sg(dmach, info->sg, bufs);
                set_dma_mode(dmach, dma_dir);
                enable_dma(dmach);
                return fasdma_real_all;
@@ -342,6 +342,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
        info->base = base;
        powertecscsi_terminator_ctl(host, term[ec->slot_no]);
 
+       info->ec = ec;
        info->info.scsi.io_base         = base + POWERTEC_FAS216_OFFSET;
        info->info.scsi.io_shift        = POWERTEC_FAS216_SHIFT;
        info->info.scsi.irq             = ec->irq;