From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Subject: Re: [PATCH v2 4/7] scatterlist: add sg_alloc_table_from_buf() helper Date: Wed, 30 Mar 2016 20:18:31 +0200 Message-ID: <20160330201831.38e1d6bd@bbrezillon> References: <1459352394-22810-1-git-send-email-boris.brezillon@free-electrons.com> <1459352394-22810-5-git-send-email-boris.brezillon@free-electrons.com> <20160330165143.GI2350@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160330165143.GI2350-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Mark Brown Cc: David Woodhouse , Brian Norris , linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Andrew Morton , Dave Gordon , linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Maxime Ripard , Chen-Yu Tsai , linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, Vinod Koul , Dan Williams , dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.orgRichard Weinberger List-Id: devicetree@vger.kernel.org On Wed, 30 Mar 2016 09:51:43 -0700 Mark Brown wrote: > On Wed, Mar 30, 2016 at 05:39:51PM +0200, Boris Brezillon wrote: > > sg_alloc_table_from_buf() provides an easy solution to create an sg_table > > from a virtual address pointer. This function takes care of dealing with > > vmallocated buffers, buffer alignment, or DMA engine limitations (maximum > > DMA transfer size). > > This seems nice. Should we also have a further helper on top of this > which will get constraints from a dmaengine, it seems like it'd be a > common need? Yep, we could create a wrapper extracting dma_slave caps info, converting it to sg_constraints and calling sg_alloc_table_from_buf(). But let's try to get this function accepted first, and I'll send another patch providing this wrapper. BTW, do you see other things that should be added in sg_constraints? -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html