aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-03-04 15:21:38 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-03-04 15:33:31 -0500
commit23d046f43a05155e050a68f3ad1f19b672713374 (patch)
tree5c32d8fde63c81a76083d2a550d5ba02ba44a873 /drivers/scsi
parent6b4df7ee1f636f0dbf3896235582559c86cb18aa (diff)
[ARM] ARM SCSI: Don't try to dma_map_sg too many scatterlist entries
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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/arm/cumana_2.c4
-rw-r--r--drivers/scsi/arm/eesox.c4
-rw-r--r--drivers/scsi/arm/powertec.c5
3 files changed, 7 insertions, 6 deletions
diff --git a/drivers/scsi/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c
index d2d51dc51ab8..82add77ad131 100644
--- a/drivers/scsi/arm/cumana_2.c
+++ b/drivers/scsi/arm/cumana_2.c
@@ -178,10 +178,10 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
178 dma_dir = DMA_MODE_READ, 178 dma_dir = DMA_MODE_READ,
179 alatch_dir = ALATCH_DMA_IN; 179 alatch_dir = ALATCH_DMA_IN;
180 180
181 dma_map_sg(dev, info->sg, bufs + 1, map_dir); 181 dma_map_sg(dev, info->sg, bufs, map_dir);
182 182
183 disable_dma(dmach); 183 disable_dma(dmach);
184 set_dma_sg(dmach, info->sg, bufs + 1); 184 set_dma_sg(dmach, info->sg, bufs);
185 writeb(alatch_dir, info->base + CUMANASCSI2_ALATCH); 185 writeb(alatch_dir, info->base + CUMANASCSI2_ALATCH);
186 set_dma_mode(dmach, dma_dir); 186 set_dma_mode(dmach, dma_dir);
187 enable_dma(dmach); 187 enable_dma(dmach);
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index d4136524fc46..ed06a8c19ad6 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -175,10 +175,10 @@ eesoxscsi_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
175 map_dir = DMA_FROM_DEVICE, 175 map_dir = DMA_FROM_DEVICE,
176 dma_dir = DMA_MODE_READ; 176 dma_dir = DMA_MODE_READ;
177 177
178 dma_map_sg(dev, info->sg, bufs + 1, map_dir); 178 dma_map_sg(dev, info->sg, bufs, map_dir);
179 179
180 disable_dma(dmach); 180 disable_dma(dmach);
181 set_dma_sg(dmach, info->sg, bufs + 1); 181 set_dma_sg(dmach, info->sg, bufs);
182 set_dma_mode(dmach, dma_dir); 182 set_dma_mode(dmach, dma_dir);
183 enable_dma(dmach); 183 enable_dma(dmach);
184 return fasdma_real_all; 184 return fasdma_real_all;
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index f9cd20bfb958..159047a34997 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -148,10 +148,10 @@ powertecscsi_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
148 map_dir = DMA_FROM_DEVICE, 148 map_dir = DMA_FROM_DEVICE,
149 dma_dir = DMA_MODE_READ; 149 dma_dir = DMA_MODE_READ;
150 150
151 dma_map_sg(dev, info->sg, bufs + 1, map_dir); 151 dma_map_sg(dev, info->sg, bufs, map_dir);
152 152
153 disable_dma(dmach); 153 disable_dma(dmach);
154 set_dma_sg(dmach, info->sg, bufs + 1); 154 set_dma_sg(dmach, info->sg, bufs);
155 set_dma_mode(dmach, dma_dir); 155 set_dma_mode(dmach, dma_dir);
156 enable_dma(dmach); 156 enable_dma(dmach);
157 return fasdma_real_all; 157 return fasdma_real_all;
@@ -342,6 +342,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
342 info->base = base; 342 info->base = base;
343 powertecscsi_terminator_ctl(host, term[ec->slot_no]); 343 powertecscsi_terminator_ctl(host, term[ec->slot_no]);
344 344
345 info->ec = ec;
345 info->info.scsi.io_base = base + POWERTEC_FAS216_OFFSET; 346 info->info.scsi.io_base = base + POWERTEC_FAS216_OFFSET;
346 info->info.scsi.io_shift = POWERTEC_FAS216_SHIFT; 347 info->info.scsi.io_shift = POWERTEC_FAS216_SHIFT;
347 info->info.scsi.irq = ec->irq; 348 info->info.scsi.irq = ec->irq;