[PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Thierry Reding
From: Thierry Reding Drivers that are built as modules may want to use these functions, so make them available like the rest of the functions. Signed-off-by: Thierry Reding --- kernel/dma/direct.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c i

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 12:06:02PM +0100, Thierry Reding wrote: > From: Thierry Reding > > Drivers that are built as modules may want to use these functions, so > make them available like the rest of the functions. > > Signed-off-by: Thierry Reding How do they want to use these functions? The

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Thierry Reding
On Tue, Feb 05, 2019 at 05:10:36PM +0100, Christoph Hellwig wrote: > On Tue, Feb 05, 2019 at 12:06:02PM +0100, Thierry Reding wrote: > > From: Thierry Reding > > > > Drivers that are built as modules may want to use these functions, so > > make them available like the rest of the functions. > >

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 05:20:57PM +0100, Thierry Reding wrote: > The problem is that if I use dma_alloc_coherent(), then the memory will > already be mapped via the SMMU at that point and then the driver, not > knowing that memory has already been mapped, will attempt to map an IOVA > which will c

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Thierry Reding
On Tue, Feb 05, 2019 at 05:38:37PM +0100, Christoph Hellwig wrote: > On Tue, Feb 05, 2019 at 05:20:57PM +0100, Thierry Reding wrote: > > The problem is that if I use dma_alloc_coherent(), then the memory will > > already be mapped via the SMMU at that point and then the driver, not > > knowing that

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 06:56:11PM +0100, Thierry Reding wrote: > Sure, here you go: > > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/host1x/cdma.c#n106 Yes, I think we I can come up with a nicer helper for that. ___

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Thierry Reding
On Tue, Feb 05, 2019 at 07:02:18PM +0100, Christoph Hellwig wrote: > On Tue, Feb 05, 2019 at 06:56:11PM +0100, Thierry Reding wrote: > > Sure, here you go: > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/host1x/cdma.c#n106 > > Yes, I think we

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 11:29:12PM +0100, Thierry Reding wrote: > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/host1x/cdma.c#n106 > > > > Yes, I think we I can come up with a nicer helper for that. > > One thing I could also try is to remove di

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Marek Szyprowski
Hi Thierry, On 2019-02-05 23:29, Thierry Reding wrote: > On Tue, Feb 05, 2019 at 07:02:18PM +0100, Christoph Hellwig wrote: >> On Tue, Feb 05, 2019 at 06:56:11PM +0100, Thierry Reding wrote: >>> Sure, here you go: >>> >>> >>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git