Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-19 Thread Christoph Hellwig
On Wed, Jul 18, 2018 at 02:55:59PM -0700, Geoff Levand wrote: > Hi, > > On 07/17/2018 09:33 AM, Fredrik Noring wrote: > >>> Here are three other regressions related to the coherent mask > >>> WARN_ON_ONCE: > >> > >> They are a pretty strong indication that yes, you should really set > >> the

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-18 Thread Geoff Levand
Hi, On 07/17/2018 09:33 AM, Fredrik Noring wrote: >>> Here are three other regressions related to the coherent mask WARN_ON_ONCE: >> >> They are a pretty strong indication that yes, you should really set >> the coherent mask if you ever do coherent allocations.. > > I'm unfortunately unfamiliar

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-17 Thread Fredrik Noring
Hi Christoph, Geoff, [ CC-ing Geoff to give him an opportunity to chime in about the PS3 part. ] > > Here are three other regressions related to the coherent mask WARN_ON_ONCE: > > They are a pretty strong indication that yes, you should really set > the coherent mask if you ever do coherent

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-17 Thread Christoph Hellwig
On Sun, Jul 15, 2018 at 02:28:27PM +0200, Fredrik Noring wrote: > Hi Christoph, Robin, > > On Thu, Jul 05, 2018 at 09:36:13PM +0200, Christoph Hellwig wrote: > > > - BUG_ON(!ops); > > > - WARN_ON_ONCE(dev && !dev->coherent_dma_mask); > > > - > > > if (dma_alloc_from_dev_coherent(dev, size,

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-15 Thread Fredrik Noring
Hi Christoph, Robin, On Thu, Jul 05, 2018 at 09:36:13PM +0200, Christoph Hellwig wrote: > > - BUG_ON(!ops); > > - WARN_ON_ONCE(dev && !dev->coherent_dma_mask); > > - > > if (dma_alloc_from_dev_coherent(dev, size, dma_handle, _addr)) > > return cpu_addr; > > > > +

Aw: Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-08 Thread Jürgen Urban
Hello Fredrik, > Gesendet: Samstag, 07. Juli 2018 um 08:32 Uhr > Von: "Fredrik Noring" > An: "Jürgen Urban" , "Robin Murphy" > > Cc: "Christoph Hellwig" , linux-ker...@vger.kernel.org, > iommu@lists.linux-foundation.org, "Maciej

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-07 Thread Fredrik Noring
Hi Jürgen, Robin, > Don't forget that the SIF DMA packets are limited and the kernel will > block/reschedule when it is out of SIF DMA packets. The allocation is > implemented inside the SBIOS. You may easily get a deadlock or a livelock > when you just let it run without thinking about the

Aw: Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-06 Thread Jürgen Urban
Hello Fredrik, > Gesendet: Freitag, 06. Juli 2018 um 22:54 Uhr > Von: "Fredrik Noring" > An: "Robin Murphy" > Cc: "Christoph Hellwig" , linux-ker...@vger.kernel.org, > iommu@lists.linux-foundation.org, "Maciej W. Rozycki" , > jue

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-06 Thread Fredrik Noring
Hi Robin, > > Does dma_set_coherent_mask want a device object representing the IOP? Such > > a thing is currently not implemented, but can certainly be done. > > Nope, just the same OHCI device as the dma_declare_coherent_memory() call. Ah... and then some kind of dma_ops structure is needed to

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-06 Thread Robin Murphy
On 06/07/18 15:19, Fredrik Noring wrote: Hi Robin, On Fri, Jul 06, 2018 at 12:57:11PM +0100, Robin Murphy wrote: On 05/07/18 20:36, Christoph Hellwig wrote: - BUG_ON(!ops); - WARN_ON_ONCE(dev && !dev->coherent_dma_mask); - if (dma_alloc_from_dev_coherent(dev, size,

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-06 Thread Fredrik Noring
Hi Robin, On Fri, Jul 06, 2018 at 12:57:11PM +0100, Robin Murphy wrote: > On 05/07/18 20:36, Christoph Hellwig wrote: > > > - BUG_ON(!ops); > > > - WARN_ON_ONCE(dev && !dev->coherent_dma_mask); > > > - > > > if (dma_alloc_from_dev_coherent(dev, size, dma_handle, > > > _addr)) > > >

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-06 Thread Robin Murphy
On 05/07/18 20:36, Christoph Hellwig wrote: - BUG_ON(!ops); - WARN_ON_ONCE(dev && !dev->coherent_dma_mask); - if (dma_alloc_from_dev_coherent(dev, size, dma_handle, _addr)) return cpu_addr; + BUG_ON(!ops); + WARN_ON_ONCE(dev &&

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-05 Thread Christoph Hellwig
> - BUG_ON(!ops); > - WARN_ON_ONCE(dev && !dev->coherent_dma_mask); > - > if (dma_alloc_from_dev_coherent(dev, size, dma_handle, _addr)) > return cpu_addr; > > + BUG_ON(!ops); > + WARN_ON_ONCE(dev && !dev->coherent_dma_mask); I think doing dma on a device

Re: [PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-03 Thread Fredrik Noring
Thank you Robin, On Tue, Jul 03, 2018 at 02:08:30PM +0100, Robin Murphy wrote: > The reasons why dma_free_attrs() should not be called from IRQ context > are not necessarily obvious and somewhat buried in the development > history, so let's start by documenting the warning itself to help anyone >

[PATCH] dma-mapping: Relax warnings for per-device areas

2018-07-03 Thread Robin Murphy
The reasons why dma_free_attrs() should not be called from IRQ context are not necessarily obvious and somewhat buried in the development history, so let's start by documenting the warning itself to help anyone who does happen to hit it and wonder what the deal is. However, this check turns out