aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 12:08:13 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 12:08:13 -0400
commitb6257a9036f06878a0f02354d5a07f155e1cfee0 (patch)
treec0e12e3568199b748ebc7c1f9cf4005ae5da5f36 /drivers
parentc548f08a4f7b89b93c805e0c4024b8302afa7121 (diff)
parentf5c0dde4c66421a3a2d7d6fa604a712c9b0744e5 (diff)
Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block: [SCSI] Remove full sg table memset() [SCSI] ide-scsi: remove usage of sg_last() Fix loop terminating conditions in fill_sg(). [BLOCK] Clear sg entry before filling in blk_rq_map_sg() IA64: iommu uses sg_next with an invalid sg element cciss: disable DMA refetch on Smart Array P600 swiotlb: fix map_sg failure handling SPARC64: fix iommu sg chaining [SCSI] ide-scsi: use scsi_sg_count() instead of ->use_sg
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/cciss.c11
-rw-r--r--drivers/scsi/ide-scsi.c8
-rw-r--r--drivers/scsi/scsi_lib.c2
3 files changed, 12 insertions, 9 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index ca56a0e5cd5e..7c2cfde08f18 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -3076,15 +3076,20 @@ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
3076 } 3076 }
3077#endif 3077#endif
3078 3078
3079 /* Disabling DMA prefetch for the P600 3079 /* Disabling DMA prefetch and refetch for the P600.
3080 * An ASIC bug may result in a prefetch beyond 3080 * An ASIC bug may result in accesses to invalid memory addresses.
3081 * physical memory. 3081 * We've disabled prefetch for some time now. Testing with XEN
3082 * kernels revealed a bug in the refetch if dom0 resides on a P600.
3082 */ 3083 */
3083 if(board_id == 0x3225103C) { 3084 if(board_id == 0x3225103C) {
3084 __u32 dma_prefetch; 3085 __u32 dma_prefetch;
3086 __u32 dma_refetch;
3085 dma_prefetch = readl(c->vaddr + I2O_DMA1_CFG); 3087 dma_prefetch = readl(c->vaddr + I2O_DMA1_CFG);
3086 dma_prefetch |= 0x8000; 3088 dma_prefetch |= 0x8000;
3087 writel(dma_prefetch, c->vaddr + I2O_DMA1_CFG); 3089 writel(dma_prefetch, c->vaddr + I2O_DMA1_CFG);
3090 pci_read_config_dword(pdev, PCI_COMMAND_PARITY, &dma_refetch);
3091 dma_refetch |= 0x1;
3092 pci_write_config_dword(pdev, PCI_COMMAND_PARITY, dma_refetch);
3088 } 3093 }
3089 3094
3090#ifdef CCISS_DEBUG 3095#ifdef CCISS_DEBUG
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index d297f64cd432..fa7ba64483fb 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -70,7 +70,7 @@ typedef struct idescsi_pc_s {
70 u8 *buffer; /* Data buffer */ 70 u8 *buffer; /* Data buffer */
71 u8 *current_position; /* Pointer into the above buffer */ 71 u8 *current_position; /* Pointer into the above buffer */
72 struct scatterlist *sg; /* Scatter gather table */ 72 struct scatterlist *sg; /* Scatter gather table */
73 struct scatterlist *last_sg; /* Last sg element */ 73 unsigned int sg_cnt; /* Number of entries in sg */
74 int b_count; /* Bytes transferred from current entry */ 74 int b_count; /* Bytes transferred from current entry */
75 struct scsi_cmnd *scsi_cmd; /* SCSI command */ 75 struct scsi_cmnd *scsi_cmd; /* SCSI command */
76 void (*done)(struct scsi_cmnd *); /* Scsi completion routine */ 76 void (*done)(struct scsi_cmnd *); /* Scsi completion routine */
@@ -192,7 +192,7 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne
192 } 192 }
193 bcount -= count; pc->b_count += count; 193 bcount -= count; pc->b_count += count;
194 if (pc->b_count == pc->sg->length) { 194 if (pc->b_count == pc->sg->length) {
195 if (pc->sg == pc->last_sg) 195 if (!--pc->sg_cnt)
196 break; 196 break;
197 pc->sg = sg_next(pc->sg); 197 pc->sg = sg_next(pc->sg);
198 pc->b_count = 0; 198 pc->b_count = 0;
@@ -229,7 +229,7 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign
229 } 229 }
230 bcount -= count; pc->b_count += count; 230 bcount -= count; pc->b_count += count;
231 if (pc->b_count == pc->sg->length) { 231 if (pc->b_count == pc->sg->length) {
232 if (pc->sg == pc->last_sg) 232 if (!--pc->sg_cnt)
233 break; 233 break;
234 pc->sg = sg_next(pc->sg); 234 pc->sg = sg_next(pc->sg);
235 pc->b_count = 0; 235 pc->b_count = 0;
@@ -807,7 +807,7 @@ static int idescsi_queue (struct scsi_cmnd *cmd,
807 memcpy (pc->c, cmd->cmnd, cmd->cmd_len); 807 memcpy (pc->c, cmd->cmnd, cmd->cmd_len);
808 pc->buffer = NULL; 808 pc->buffer = NULL;
809 pc->sg = scsi_sglist(cmd); 809 pc->sg = scsi_sglist(cmd);
810 pc->last_sg = sg_last(pc->sg, cmd->use_sg); 810 pc->sg_cnt = scsi_sg_count(cmd);
811 pc->b_count = 0; 811 pc->b_count = 0;
812 pc->request_transfer = pc->buffer_size = scsi_bufflen(cmd); 812 pc->request_transfer = pc->buffer_size = scsi_bufflen(cmd);
813 pc->scsi_cmd = cmd; 813 pc->scsi_cmd = cmd;
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index aac8a02cbe80..0c86be71bb33 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -764,8 +764,6 @@ struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *cmd, gfp_t gfp_mask)
764 if (unlikely(!sgl)) 764 if (unlikely(!sgl))
765 goto enomem; 765 goto enomem;
766 766
767 memset(sgl, 0, sizeof(*sgl) * sgp->size);
768
769 /* 767 /*
770 * first loop through, set initial index and return value 768 * first loop through, set initial index and return value
771 */ 769 */