From: Benjamin Herrenschmidt Date: Wed, 12 Mar 2008 06:23:56 +0000 (+1100) Subject: [POWERPC] Fix viodasd driver with scatterlist debug X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=25c0a7b83297f10186a7a1ee5c563f005dfabc44;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [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 Signed-off-by: Paul Mackerras --- diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index 9e61fca4611..41ca721d252 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, 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;