Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034046AbcJ1R6Y (ORCPT ); Fri, 28 Oct 2016 13:58:24 -0400 Received: from gw.crowfest.net ([52.42.241.221]:48472 "EHLO gw.crowfest.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S942481AbcJ1R6W (ORCPT ); Fri, 28 Oct 2016 13:58:22 -0400 From: Michael Zoran To: gregkh@linuxfoundation.org Cc: eric@anholt.net, swarren@wwwdotorg.org, lee@kernel.org, mzoran@crowfest.net, daniels@collabora.com, noralf@tronnes.org, popcornmix@gmail.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: vc04_services: call sg_init_table to init scatterlist Date: Fri, 28 Oct 2016 10:58:13 -0700 Message-Id: <20161028175813.28022-1-mzoran@crowfest.net> X-Mailer: git-send-email 2.10.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1274 Lines: 33 Call the sg_init_table function to correctly initialze the DMA scatterlist. This function is required to completely initialize the list and is mandatory if DMA debugging is enabled in the build configuration. One of the purposes of sg_init_table is to set the magic "cookie" on each list element and ensure the chain end is marked. Signed-off-by: Michael Zoran --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index 6fa2b5a..21b26e5 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -464,6 +464,12 @@ create_pagelist(char __user *buf, size_t count, unsigned short type, pagelist->type = type; pagelist->offset = offset; + /* + * Initialize the scatterlist so that the magic cookie + * is filled if debugging is enabled + */ + sg_init_table(scatterlist, num_pages); + /* Now set the pages for each scatterlist */ for (i = 0; i < num_pages; i++) sg_set_page(scatterlist + i, pages[i], PAGE_SIZE, 0); -- 2.10.1