Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-31 Thread Nicolas Saenz Julienne
Hi Nathan, On Thu, 2020-07-30 at 18:10 -0700, Nathan Chancellor wrote: > On Tue, Jul 28, 2020 at 12:09:18PM +0200, Christoph Hellwig wrote: > > Ok, I found a slight bug that wasn't intended. I wanted to make sure > > we can always fall back to a lower pool, but got that wrong. Should be > >

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-31 Thread Amit Pundir
On Fri, 31 Jul 2020 at 06:40, Nathan Chancellor wrote: > > On Tue, Jul 28, 2020 at 12:09:18PM +0200, Christoph Hellwig wrote: > > Ok, I found a slight bug that wasn't intended. I wanted to make sure > > we can always fall back to a lower pool, but got that wrong. Should be > > fixed in the next

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-30 Thread Nathan Chancellor
On Tue, Jul 28, 2020 at 12:09:18PM +0200, Christoph Hellwig wrote: > Ok, I found a slight bug that wasn't intended. I wanted to make sure > we can always fall back to a lower pool, but got that wrong. Should be > fixed in the next version. Hi Christoph and Nicolas, Did a version of that series

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-28 Thread Christoph Hellwig
On Tue, Jul 28, 2020 at 11:30:32AM +0200, Nicolas Saenz Julienne wrote: > On Tue, 2020-07-28 at 11:13 +0200, Christoph Hellwig wrote: > > On Mon, Jul 27, 2020 at 07:56:56PM +0200, Nicolas Saenz Julienne wrote: > > > Hi Christoph, > > > thanks for having a look at this! > > > > > > On Fri,

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-28 Thread Nicolas Saenz Julienne
On Tue, 2020-07-28 at 11:13 +0200, Christoph Hellwig wrote: > On Mon, Jul 27, 2020 at 07:56:56PM +0200, Nicolas Saenz Julienne wrote: > > Hi Christoph, > > thanks for having a look at this! > > > > On Fri, 2020-07-24 at 15:41 +0200, Christoph Hellwig wrote: > > > Yes, the iommu is an interesting

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-28 Thread Christoph Hellwig
On Mon, Jul 27, 2020 at 07:56:56PM +0200, Nicolas Saenz Julienne wrote: > Hi Christoph, > thanks for having a look at this! > > On Fri, 2020-07-24 at 15:41 +0200, Christoph Hellwig wrote: > > Yes, the iommu is an interesting case, and the current code is > > wrong for that. > > Care to expand on

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-27 Thread Nicolas Saenz Julienne
Hi Christoph, thanks for having a look at this! On Fri, 2020-07-24 at 15:41 +0200, Christoph Hellwig wrote: > Yes, the iommu is an interesting case, and the current code is > wrong for that. Care to expand on this? I do get that checking dma_coherent_ok() on memory that'll later on be mapped

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-24 Thread Christoph Hellwig
On Fri, Jul 24, 2020 at 09:49:17PM +0530, Amit Pundir wrote: > On Fri, 24 Jul 2020 at 19:11, Christoph Hellwig wrote: > > > > Yes, the iommu is an interesting case, and the current code is > > wrong for that. Can you try the patch below? It contains a modified > > version of Nicolas' patch to

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-24 Thread Amit Pundir
On Fri, 24 Jul 2020 at 19:11, Christoph Hellwig wrote: > > Yes, the iommu is an interesting case, and the current code is > wrong for that. Can you try the patch below? It contains a modified > version of Nicolas' patch to try CMA again for the expansion and a new > (for now hackish) way to not

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-24 Thread Christoph Hellwig
Yes, the iommu is an interesting case, and the current code is wrong for that. Can you try the patch below? It contains a modified version of Nicolas' patch to try CMA again for the expansion and a new (for now hackish) way to not apply the addressability check for dma-iommu allocations. diff

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-24 Thread Amit Pundir
On Fri, 24 Jul 2020 at 15:06, Nicolas Saenz Julienne wrote: > > Hi Amit, > > On Thu, 2020-07-23 at 10:44 +0530, Amit Pundir wrote: > > Hi Nicolas, > > > > Sorry I got stuck on other things yesterday. > > No worries :) > > > On Tue, 21 Jul 2020 at 21:57, Nicolas Saenz Julienne > > [...] > > > > >

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-24 Thread Nicolas Saenz Julienne
Hi Amit, On Thu, 2020-07-23 at 10:44 +0530, Amit Pundir wrote: > Hi Nicolas, > > Sorry I got stuck on other things yesterday. No worries :) > On Tue, 21 Jul 2020 at 21:57, Nicolas Saenz Julienne [...] > > > > Let's get a bigger hammer, I'm just looking for clues here. Can you > > apply this

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-22 Thread Amit Pundir
Hi Nicolas, Sorry I got stuck on other things yesterday. On Tue, 21 Jul 2020 at 21:57, Nicolas Saenz Julienne wrote: > > On Tue, 2020-07-21 at 20:52 +0530, Amit Pundir wrote: > > [...] > > > > > > Can you try booting *without* my patch and this in the kernel > > > > > command > > > > > line:

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-21 Thread Nicolas Saenz Julienne
On Tue, 2020-07-21 at 20:52 +0530, Amit Pundir wrote: [...] > > > > Can you try booting *without* my patch and this in the kernel > > > > command > > > > line: "cma=16M@0x1-0x2". > > > > > > It doesn't boot with this added kernel command line. > > > > For the record, this

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-21 Thread Amit Pundir
On Tue, 21 Jul 2020 at 18:15, Nicolas Saenz Julienne wrote: > > On Tue, 2020-07-21 at 17:45 +0530, Amit Pundir wrote: > > On Tue, 21 Jul 2020 at 16:45, Nicolas Saenz Julienne > > wrote: > > > On Tue, 2020-07-21 at 14:24 +0530, Amit Pundir wrote: > > > > On Tue, 21 Jul 2020 at 14:09, Nicolas

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-21 Thread Nicolas Saenz Julienne
On Tue, 2020-07-21 at 17:45 +0530, Amit Pundir wrote: > On Tue, 21 Jul 2020 at 16:45, Nicolas Saenz Julienne > wrote: > > On Tue, 2020-07-21 at 14:24 +0530, Amit Pundir wrote: > > > On Tue, 21 Jul 2020 at 14:09, Nicolas Saenz Julienne > > > wrote: > > > > Hi Amit, > > > > > Hi Nicolas, > > > > >

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-21 Thread Amit Pundir
On Tue, 21 Jul 2020 at 17:07, Nicolas Saenz Julienne wrote: > > On Tue, 2020-07-21 at 13:28 +0200, Christoph Hellwig wrote: > > On Tue, Jul 21, 2020 at 01:15:23PM +0200, Nicolas Saenz Julienne > > wrote: > > > I'm at loss at what could be failing here. Your device should be > > > able > > > to

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-21 Thread Amit Pundir
On Tue, 21 Jul 2020 at 16:45, Nicolas Saenz Julienne wrote: > > On Tue, 2020-07-21 at 14:24 +0530, Amit Pundir wrote: > > On Tue, 21 Jul 2020 at 14:09, Nicolas Saenz Julienne > > wrote: > > > Hi Amit, > > > > Hi Nicolas, > > > > > > > > I see a boot regression with this commit d9765e41d8e9

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-21 Thread Nicolas Saenz Julienne
On Tue, 2020-07-21 at 13:28 +0200, Christoph Hellwig wrote: > On Tue, Jul 21, 2020 at 01:15:23PM +0200, Nicolas Saenz Julienne > wrote: > > I'm at loss at what could be failing here. Your device should be > > able > > to address the whole 8GB memory space, which AFAIK is the max > > available > >

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-21 Thread Christoph Hellwig
On Tue, Jul 21, 2020 at 01:15:23PM +0200, Nicolas Saenz Julienne wrote: > I'm at loss at what could be failing here. Your device should be able > to address the whole 8GB memory space, which AFAIK is the max available > on that smartphone family. But maybe the device-tree is lying, who > knows...

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-21 Thread Nicolas Saenz Julienne
On Tue, 2020-07-21 at 14:24 +0530, Amit Pundir wrote: > On Tue, 21 Jul 2020 at 14:09, Nicolas Saenz Julienne > wrote: > > Hi Amit, > > > Hi Nicolas, > > > > > > I see a boot regression with this commit d9765e41d8e9 "dma-pool: > > > Do not allocate pool memory from CMA" on my Xiaomi Poco F1 > > >

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-21 Thread Amit Pundir
On Tue, 21 Jul 2020 at 14:09, Nicolas Saenz Julienne wrote: > > Hi Amit, > > On Tue, 2020-07-21 at 12:51 +0530, Amit Pundir wrote: > > On Wed, 8 Jul 2020 at 22:43, Nicolas Saenz Julienne > > wrote: > > > There is no guarantee to CMA's placement, so allocating a zone > > > specific > > > atomic

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-21 Thread Nicolas Saenz Julienne
Hi Amit, On Tue, 2020-07-21 at 12:51 +0530, Amit Pundir wrote: > On Wed, 8 Jul 2020 at 22:43, Nicolas Saenz Julienne > wrote: > > There is no guarantee to CMA's placement, so allocating a zone > > specific > > atomic pool from CMA might return memory from a completely > > different > > memory

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-21 Thread Amit Pundir
On Wed, 8 Jul 2020 at 22:43, Nicolas Saenz Julienne wrote: > > There is no guarantee to CMA's placement, so allocating a zone specific > atomic pool from CMA might return memory from a completely different > memory zone. So stop using it. > > Fixes: c84dc6e68a1d ("dma-pool: add additional

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-09 Thread David Rientjes
On Wed, 8 Jul 2020, Nicolas Saenz Julienne wrote: > There is no guarantee to CMA's placement, so allocating a zone specific > atomic pool from CMA might return memory from a completely different > memory zone. So stop using it. > > Fixes: c84dc6e68a1d ("dma-pool: add additional coherent pools to

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-08 Thread Jeremy Linton
Hi, On 7/8/20 11:49 AM, Nicolas Saenz Julienne wrote: There is no guarantee to CMA's placement, so allocating a zone specific atomic pool from CMA might return memory from a completely different memory zone. So stop using it. Fixes: c84dc6e68a1d ("dma-pool: add additional coherent pools to map

[PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-08 Thread Nicolas Saenz Julienne
There is no guarantee to CMA's placement, so allocating a zone specific atomic pool from CMA might return memory from a completely different memory zone. So stop using it. Fixes: c84dc6e68a1d ("dma-pool: add additional coherent pools to map to gfp mask") Reported-by: Jeremy Linton

Re: [PATCH] dma-pool: Do not allocate pool memory from CMA

2020-07-08 Thread Christoph Hellwig
On Wed, Jul 08, 2020 at 06:49:39PM +0200, Nicolas Saenz Julienne wrote: > There is no guarantee to CMA's placement, so allocating a zone specific > atomic pool from CMA might return memory from a completely different > memory zone. So stop using it. > > Fixes: c84dc6e68a1d ("dma-pool: add