From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S945552AbcJaScO (ORCPT ); Mon, 31 Oct 2016 14:32:14 -0400 Received: from anholt.net ([50.246.234.109]:44335 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S945538AbcJaScL (ORCPT ); Mon, 31 Oct 2016 14:32:11 -0400 From: Eric Anholt To: Michael Zoran , gregkh@linuxfoundation.org Cc: 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: Re: [PATCH] staging: vc04_services: call sg_init_table to init scatterlist In-Reply-To: <20161028175813.28022-1-mzoran@crowfest.net> References: <20161028175813.28022-1-mzoran@crowfest.net> User-Agent: Notmuch/0.22.2+1~gb0bcfaa (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Mon, 31 Oct 2016 11:32:08 -0700 Message-ID: <87wpgoqsif.fsf@eliezer.anholt.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Michael Zoran writes: > 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, unsi= gned short type, > pagelist->type =3D type; > pagelist->offset =3D offset; >=20=20 > + /* > + * 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 */ I feel like the comments don't add much, but either way: Acked-by: Eric Anholt > for (i =3D 0; i < num_pages; i++) > sg_set_page(scatterlist + i, pages[i], PAGE_SIZE, 0); >=20=20 > --=20 > 2.10.1 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJYF44oAAoJELXWKTbR/J7oygoP/0Nm3dOlinEDBXnPaF3texN1 aIctoCP8cMG7IqocQbinf+odxbrXSPYEPJag62G0fMKArb8hQXc15DCzArLuUyEO vYfPfCSIZE5gkNiyY7O000TCz73jlj9Mn59GAg/eXdc2GBbl8lsD6O3WlQiQ5aY8 v8+BDbg20Nsi42VdFnlMn45G30rjAS0rBqCjBqBZfCAenkRdosvyJqPjRNHFMJkd EjhQagvZ9+ArA8icWDey9wMBaxhzhZD+OPywbm+wlbCkHoOIH5CL/hKi9LtmjK8O gGwoQtBgd4UCzZLE/3XiVhCyrgPI5TO+NjbosAeVVzffQd32dSv2B343NALjOb/Z 8i/sSc1GSpTMQVvWdURxY+hAjba86RVHIsJW8b6G3aWGMLHDiv+NrhfjFvdN1ten QStGhts9CckI5qkJNRF6eMt++7x9L6y3DbmR/mKRBaFUExz8lhjqWufaI9Ujr5m3 dgRr3p4mmdzLTkeS6JMwMFK3XLpXkAmk6mwzxJMMw5UvjE7HjyfH7Y7A4UgRI2gV nsFHkKRWimEH1ipwhlvgQ3nAKT2l4FWlwmKrVziRF8aKr/ZvEGQbY0Ky8WJERMn/ aamoz7JkwB3MY8EmNkH9Y2uInK7+xSN91dRZ5ZKYE0UDtO4lJml0Keh48q5loEUL owzVNKunW3CL2zCrJcE9 =pyy/ -----END PGP SIGNATURE----- --=-=-=-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: eric@anholt.net (Eric Anholt) Date: Mon, 31 Oct 2016 11:32:08 -0700 Subject: [PATCH] staging: vc04_services: call sg_init_table to init scatterlist In-Reply-To: <20161028175813.28022-1-mzoran@crowfest.net> References: <20161028175813.28022-1-mzoran@crowfest.net> Message-ID: <87wpgoqsif.fsf@eliezer.anholt.net> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Michael Zoran writes: > 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 */ I feel like the comments don't add much, but either way: Acked-by: Eric Anholt > for (i = 0; i < num_pages; i++) > sg_set_page(scatterlist + i, pages[i], PAGE_SIZE, 0); > > -- > 2.10.1 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 800 bytes Desc: not available URL: