aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/viodasd.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-03-12 02:23:56 -0400
committerPaul Mackerras <paulus@samba.org>2008-03-12 19:09:28 -0400
commit25c0a7b83297f10186a7a1ee5c563f005dfabc44 (patch)
tree717a3d23d732ca7570b4bbef3540ffeabe35bdee /drivers/block/viodasd.c
parent98cddbfb3218925c35697562f7d9df692bf6a436 (diff)
[POWERPC] Fix viodasd driver with scatterlist debug
The iSeries viodasd drivers does some very strange things with scatterlists, one of these causing a BUG_ON to trigger when scatterlist debugging is enabled due to initializing the scatterlist with memset instead of sg_init_table(). This fixes it by using sg_init_table(). The rest of the stuff it does to that poor list is still pretty awful but it will work. I may look into fixing things in a nicer way some other time. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/block/viodasd.c')
-rw-r--r--drivers/block/viodasd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index 9e61fca46117..41ca721d2523 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -528,8 +528,7 @@ static int block_event_to_scatterlist(const struct vioblocklpevent *bevent,
528 numsg = VIOMAXBLOCKDMA; 528 numsg = VIOMAXBLOCKDMA;
529 529
530 *total_len = 0; 530 *total_len = 0;
531 memset(sg, 0, sizeof(sg[0]) * VIOMAXBLOCKDMA); 531 sg_init_table(sg, VIOMAXBLOCKDMA);
532
533 for (i = 0; (i < numsg) && (rw_data->dma_info[i].len > 0); ++i) { 532 for (i = 0; (i < numsg) && (rw_data->dma_info[i].len > 0); ++i) {
534 sg_dma_address(&sg[i]) = rw_data->dma_info[i].token; 533 sg_dma_address(&sg[i]) = rw_data->dma_info[i].token;
535 sg_dma_len(&sg[i]) = rw_data->dma_info[i].len; 534 sg_dma_len(&sg[i]) = rw_data->dma_info[i].len;