Skip to content

Commit

Permalink
[POWERPC] Fix viodasd driver with scatterlist debug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Mar 12, 2008
1 parent 98cddbf commit 25c0a7b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/block/viodasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,7 @@ static int block_event_to_scatterlist(const struct vioblocklpevent *bevent,
numsg = VIOMAXBLOCKDMA;

*total_len = 0;
memset(sg, 0, sizeof(sg[0]) * VIOMAXBLOCKDMA);

sg_init_table(sg, VIOMAXBLOCKDMA);
for (i = 0; (i < numsg) && (rw_data->dma_info[i].len > 0); ++i) {
sg_dma_address(&sg[i]) = rw_data->dma_info[i].token;
sg_dma_len(&sg[i]) = rw_data->dma_info[i].len;
Expand Down

0 comments on commit 25c0a7b

Please sign in to comment.