Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-05-02 Thread jacopo mondi
Hi Christoph, On Fri, Apr 20, 2018 at 11:59:13AM +0200, Geert Uytterhoeven wrote: > Hi Christoph, > > On Fri, Apr 20, 2018 at 10:31 AM, Christoph Hellwig > wrote: > > On Wed, Apr 18, 2018 at 03:13:14PM +0200, jacopo mondi wrote: > >> As long as it goes for arch/sh, the only user of dma_alloc_coh

Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-04-20 Thread Rich Felker
On Fri, Apr 20, 2018 at 11:59:13AM +0200, Geert Uytterhoeven wrote: > Hi Christoph, > > On Fri, Apr 20, 2018 at 10:31 AM, Christoph Hellwig > wrote: > > On Wed, Apr 18, 2018 at 03:13:14PM +0200, jacopo mondi wrote: > >> As long as it goes for arch/sh, the only user of dma_alloc_coherent() > >> i

Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-04-20 Thread Geert Uytterhoeven
Hi Christoph, On Fri, Apr 20, 2018 at 10:31 AM, Christoph Hellwig wrote: > On Wed, Apr 18, 2018 at 03:13:14PM +0200, jacopo mondi wrote: >> As long as it goes for arch/sh, the only user of dma_alloc_coherent() >> is platform_resource_setup_memory(), and it has been fixed by this >> patch. > > Gre

Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-04-20 Thread Christoph Hellwig
On Wed, Apr 18, 2018 at 03:13:14PM +0200, jacopo mondi wrote: > As long as it goes for arch/sh, the only user of dma_alloc_coherent() > is platform_resource_setup_memory(), and it has been fixed by this > patch. Great! > > Unfortunately, as Thomas pointed out, there are drivers which calls > int

Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-04-20 Thread Christoph Hellwig
On Tue, Apr 17, 2018 at 03:54:07PM +0200, Thomas Petazzoni wrote: > > dma_alloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL); > > and one to switch to the WARN_ON + if(dev) model. But I don't really > care either way, so: > > Reviewed-by: Thomas Petazzoni Yes, these should be separ

Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-04-18 Thread jacopo mondi
Hi Christoph, On Wed, Apr 18, 2018 at 03:47:03AM -0700, Christoph Hellwig wrote: > On Tue, Apr 17, 2018 at 03:35:23PM +0200, Jacopo Mondi wrote: > > With commit ce88313069c36eef80f21fd7 ("arch/sh: make the DMA mapping > > operations observe dev->dma_pfn_offset") the generic DMA allocation > > func

Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-04-18 Thread Christoph Hellwig
On Tue, Apr 17, 2018 at 03:35:23PM +0200, Jacopo Mondi wrote: > With commit ce88313069c36eef80f21fd7 ("arch/sh: make the DMA mapping > operations observe dev->dma_pfn_offset") the generic DMA allocation > function on which the SH 'dma_alloc_coherent()' function relies on, > access the 'dma_pfn_offs

Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-04-18 Thread Sergei Shtylyov
Hello! On 4/17/2018 4:35 PM, Jacopo Mondi wrote: With commit ce88313069c36eef80f21fd7 ("arch/sh: make the DMA mapping operations observe dev->dma_pfn_offset") the generic DMA allocation function on which the SH 'dma_alloc_coherent()' function relies on, access the 'dma_pfn_offset' field of stru

Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-04-17 Thread jacopo mondi
Hi Geert, On Tue, Apr 17, 2018 at 04:04:27PM +0200, Geert Uytterhoeven wrote: > Hi Jacopo, > > Thanks for your patch! > > On Tue, Apr 17, 2018 at 3:35 PM, Jacopo Mondi > wrote: > > With commit ce88313069c36eef80f21fd7 ("arch/sh: make the DMA mapping > > operations observe dev->dma_pfn_offset") t

Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-04-17 Thread Geert Uytterhoeven
Hi Jacopo, Thanks for your patch! On Tue, Apr 17, 2018 at 3:35 PM, Jacopo Mondi wrote: > With commit ce88313069c36eef80f21fd7 ("arch/sh: make the DMA mapping > operations observe dev->dma_pfn_offset") the generic DMA allocation > function on which the SH 'dma_alloc_coherent()' function relies on

Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-04-17 Thread jacopo mondi
Hi Thomas, On Tue, Apr 17, 2018 at 03:54:07PM +0200, Thomas Petazzoni wrote: > Hello, > > On Tue, 17 Apr 2018 15:35:23 +0200, Jacopo Mondi wrote: > > With commit ce88313069c36eef80f21fd7 ("arch/sh: make the DMA mapping > > operations observe dev->dma_pfn_offset") the generic DMA allocation > > fun

Re: [PATCH] sh: mm: Fix unprotected access to struct device

2018-04-17 Thread Thomas Petazzoni
Hello, On Tue, 17 Apr 2018 15:35:23 +0200, Jacopo Mondi wrote: > With commit ce88313069c36eef80f21fd7 ("arch/sh: make the DMA mapping > operations observe dev->dma_pfn_offset") the generic DMA allocation > function on which the SH 'dma_alloc_coherent()' function relies on, > access the 'dma_pfn_of

[PATCH] sh: mm: Fix unprotected access to struct device

2018-04-17 Thread Jacopo Mondi
With commit ce88313069c36eef80f21fd7 ("arch/sh: make the DMA mapping operations observe dev->dma_pfn_offset") the generic DMA allocation function on which the SH 'dma_alloc_coherent()' function relies on, access the 'dma_pfn_offset' field of struct device. Unfortunately the 'dma_generic_alloc_cohe