[PATCH v4 0/1] Add iommu map_sg/unmap_sg API

2014-07-31 Thread Olav Haugan
Patch for adding map_sg/unmap_sg to the generic IOMMU API. v3 -> v4: * Removed BUG_ON in both map_sg and unmap_sg * Removed PAGE_ALIGN of length of mapping v2 -> v3: * Updated commit text * Simplifed fallback code and fixed variable types in map_sg function. * Renamed and changed arguments to map

[PATCH v4 1/1] iommu-api: Add map_sg/unmap_sg functions

2014-07-31 Thread Olav Haugan
Mapping and unmapping are more often than not in the critical path. map_sg and unmap_sg allows IOMMU driver implementations to optimize the process of mapping and unmapping buffers into the IOMMU page tables. Instead of mapping a buffer one page at a time and requiring potentially expensive TLB op

Re: [PATCH v4] iommu/arm-smmu: avoid calling request_irq in atomic context

2014-07-31 Thread Will Deacon
On Wed, Jul 30, 2014 at 06:58:13PM +0100, Mitchel Humpherys wrote: > request_irq shouldn't be called from atomic context since it might > sleep, but we're calling it with a spinlock held, resulting in: [...] > @@ -900,22 +905,23 @@ static int arm_smmu_init_domain_context(struct > iommu_domain *d

Re: [PATCH v5] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Laurent Pinchart
Hi Thierry, On Thursday 31 July 2014 12:43:03 Thierry Reding wrote: > From: Thierry Reding > > This commit introduces a generic device tree binding for IOMMU devices. > Only a very minimal subset is described here, but it is enough to cover > the requirements of both the Exynos System MMU and Te

Re: [PATCH v5] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Joerg Roedel
On Thu, Jul 31, 2014 at 10:14:08AM -0700, Olof Johansson wrote: > On Thu, Jul 31, 2014 at 9:36 AM, Joerg Roedel wrote: > > On Thu, Jul 31, 2014 at 08:38:47AM -0700, Olof Johansson wrote: > >> > > >> > Applied, thanks everyone. > >> > >> Really? > >> > >> Gee, thanks for giving people a chance to r

Re: [PATCH v5] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Olof Johansson
On Thu, Jul 31, 2014 at 9:36 AM, Joerg Roedel wrote: > On Thu, Jul 31, 2014 at 08:38:47AM -0700, Olof Johansson wrote: >> > >> > Applied, thanks everyone. >> >> Really? >> >> Gee, thanks for giving people a chance to reply with acks. It's >> considered polite to do so when there has been outstandi

Re: [PATCH v5] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Joerg Roedel
On Thu, Jul 31, 2014 at 08:38:47AM -0700, Olof Johansson wrote: > > > > Applied, thanks everyone. > > Really? > > Gee, thanks for giving people a chance to reply with acks. It's > considered polite to do so when there has been outstanding questions. Its not pushed yet, I can still make changes.

Re: [PATCH v5] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Olof Johansson
On Thu, Jul 31, 2014 at 5:04 AM, Joerg Roedel wrote: > On Thu, Jul 31, 2014 at 12:43:03PM +0200, Thierry Reding wrote: >> From: Thierry Reding >> >> This commit introduces a generic device tree binding for IOMMU devices. >> Only a very minimal subset is described here, but it is enough to cover >

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation

2014-07-31 Thread Borislav Petkov
Hi, On Thu, Jul 31, 2014 at 10:41:36PM +0800, Jiang Liu wrote: > Really appreciate your help. There are two issues left > according to the log messages. first of all: A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-postin

Re: [PATCH 0/3 v2] mmu_notifier: Allow to manage CPU external TLBs

2014-07-31 Thread Jerome Glisse
On Tue, Jul 29, 2014 at 06:18:10PM +0200, Joerg Roedel wrote: > Changes V1->V2: > > * Rebase to v3.16-rc7 > * Added call of ->invalidate_range to > __mmu_notifier_invalidate_end() so that the subsystem > doesn't need to register an ->invalidate_end() call-back, > subsystems will likely eithe

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation

2014-07-31 Thread Jiang Liu
Hi Borislav, Really appreciate your help. There are two issues left according to the log messages. The first issue is " WARNING: CPU: 2 PID: 3786 at fs/proc/generic.c:521 remove_proc_entry+0x19c/0x1b0()". It's caused by an issue in usb driver and a patch is ready to fix this issue,

Re: [PATCH v4] iommu/arm-smmu: avoid calling request_irq in atomic context

2014-07-31 Thread Will Deacon
On Wed, Jul 30, 2014 at 06:58:13PM +0100, Mitchel Humpherys wrote: > request_irq shouldn't be called from atomic context since it might > sleep, but we're calling it with a spinlock held, resulting in: > > [9.172202] BUG: sleeping function called from invalid context at > kernel/mm/slub.c

Re: [PATCH v5] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Joerg Roedel
On Thu, Jul 31, 2014 at 12:43:03PM +0200, Thierry Reding wrote: > From: Thierry Reding > > This commit introduces a generic device tree binding for IOMMU devices. > Only a very minimal subset is described here, but it is enough to cover > the requirements of both the Exynos System MMU and Tegra S

Re: [PATCH v2] iommu/vt-d: race setting IRQ CPU affinity while freeing IRQ

2014-07-31 Thread Joerg Roedel
On Tue, Jul 29, 2014 at 11:21:58AM -0600, Greg Edwards wrote: > [ 6638.327851] BUG: unable to handle kernel NULL pointer dereference at > 0090 > [ 6638.335955] IP: [] intel_ioapic_set_affinity+0x82/0x1b0 > [ 6638.343012] PGD 99172e067 PUD 1026979067 PMD 0 > [ 6638.347858] Oops: [

Re: [PATCH v4] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Thierry Reding
On Thu, Jul 31, 2014 at 11:50:17AM +0100, Mark Rutland wrote: > On Thu, Jul 31, 2014 at 11:09:06AM +0100, Thierry Reding wrote: > > On Wed, Jul 30, 2014 at 07:18:42PM +0100, Mark Rutland wrote: > > [...] > > > > >> + > > > > >> +Multiple-master IOMMU with configurable DMA window: > > > > >> +--

Re: [PATCH v5] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Mark Rutland
On Thu, Jul 31, 2014 at 11:43:03AM +0100, Thierry Reding wrote: > From: Thierry Reding > > This commit introduces a generic device tree binding for IOMMU devices. > Only a very minimal subset is described here, but it is enough to cover > the requirements of both the Exynos System MMU and Tegra S

Re: [PATCH v4] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Mark Rutland
On Thu, Jul 31, 2014 at 11:09:06AM +0100, Thierry Reding wrote: > On Wed, Jul 30, 2014 at 07:18:42PM +0100, Mark Rutland wrote: > [...] > > > >> + > > > >> +Multiple-master IOMMU with configurable DMA window: > > > >> +--- > > > >> + > > > >> + /

Re: [PATCH v4] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Thierry Reding
On Thu, Jul 31, 2014 at 12:23:51PM +0200, Joerg Roedel wrote: > On Thu, Jul 31, 2014 at 12:18:08PM +0200, Thierry Reding wrote: > > It looks like this hasn't been applied yet, so I can send out a v5 > > shortly with the requested changes addressed. > > Yes, please send a v5 with the requested chan

[PATCH v5] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Thierry Reding
From: Thierry Reding This commit introduces a generic device tree binding for IOMMU devices. Only a very minimal subset is described here, but it is enough to cover the requirements of both the Exynos System MMU and Tegra SMMU as discussed here: https://lkml.org/lkml/2014/4/27/346 Acked-by:

Re: [PATCH v4] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Joerg Roedel
On Thu, Jul 31, 2014 at 12:18:08PM +0200, Thierry Reding wrote: > It looks like this hasn't been applied yet, so I can send out a v5 > shortly with the requested changes addressed. Yes, please send a v5 with the requested changes and all Reviewed-bys and Acked-bys this got so far. I'll take it int

Re: [PATCH v4] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Thierry Reding
On Thu, Jul 31, 2014 at 10:22:41AM +0100, Mark Rutland wrote: > [...] > > > > > +Examples: > > > > += > > > > + > > > > +Single-master IOMMU: > > > > + > > > > + > > > > + iommu { > > > > + #iommu-cells = <0>; > > > > + }; > > > > + > > > > +

Re: [PATCH v4] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Thierry Reding
On Wed, Jul 30, 2014 at 07:18:42PM +0100, Mark Rutland wrote: [...] > > >> + > > >> +Multiple-master IOMMU with configurable DMA window: > > >> +--- > > >> + > > >> + / { > > >> + #address-cells = <1>; > > >> + #size-cells

Re: [PATCH v4] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Thierry Reding
On Wed, Jul 30, 2014 at 10:35:06AM -0700, Olof Johansson wrote: > Hi, > > On Wed, Jul 30, 2014 at 8:26 AM, Mark Rutland wrote: > > Hi Thierry, > > > > This looks sane to me. > > > > I just have a few questions below which are hopefully simple/stupid. > > > > On Fri, Jul 04, 2014 at 04:29:17PM +01

Re: [PATCH v4] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Mark Rutland
[...] > > > +Examples: > > > += > > > + > > > +Single-master IOMMU: > > > + > > > + > > > + iommu { > > > + #iommu-cells = <0>; > > > + }; > > > + > > > + master { > > > + iommus = <&/iommu>; > > > > Nit: this should be iommus = <&{/iommu}>, or it's not

Re: [PATCH v4] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Thierry Reding
On Wed, Jul 30, 2014 at 04:26:47PM +0100, Mark Rutland wrote: > Hi Thierry, > > This looks sane to me. > > I just have a few questions below which are hopefully simple/stupid. > > On Fri, Jul 04, 2014 at 04:29:17PM +0100, Thierry Reding wrote: > > From: Thierry Reding > > > > This commit intro