[PATCH] iommu: Improve error handling when setting bus iommu

2014-10-28 Thread Heiko Stübner
When some part of bus_set_iommu fails it should undo any made changes and not simply leave everything as is. This includes unregistering the bus notifier in iommu_bus_init when add_iommu_group fails and also setting the bus->iommu_ops back to NULL. Signed-off-by: Heiko Stuebner --- drivers/iomm

Re: [PATCH v6 1/3] iommu/rockchip: rk3288 iommu driver

2014-10-28 Thread Heiko Stübner
Am Mittwoch, 29. Oktober 2014, 02:50:06 schrieb Daniel Kurtz: > Heiko, > > Does this version work for you on 3.18-rc1? the iommu and drm driver using it did probe sucessfully, so Tested-by: Heiko Stuebner > > On Oct 27, 2014 8:44 PM, "Daniel Kurtz" wrote: > > The rk3288 has several iommus.

Re: [Patch Part2 v3 15/24] x86, MSI: Use hierarchy irqdomain to manage MSI interrupts

2014-10-28 Thread Thomas Gleixner
On Tue, 28 Oct 2014, Jiang Liu wrote: > +static int msi_set_affinity(struct irq_data *data, const struct cpumask > *mask, > + bool force) > +{ > + struct irq_data *parent = data->parent_data; > + int ret; > > - msg.data &= ~MSI_DATA_VECTOR_MASK; > - msg.da

Re: [PATCH v6 1/3] iommu/rockchip: rk3288 iommu driver

2014-10-28 Thread Daniel Kurtz
Heiko, Does this version work for you on 3.18-rc1? On Oct 27, 2014 8:44 PM, "Daniel Kurtz" wrote: > The rk3288 has several iommus. Each iommu belongs to a single master > device. There is one device (ISP) that has two slave iommus, but that > case is not yet supported by this driver. > > At su

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

2014-10-28 Thread Joerg Roedel
From: Joerg Roedel Changes V3->V4: * Rebased to v3.18-rc2 * Updated patch description and some comments Changes V2->V3: * Rebased to v3.17-rc4 * Fixed compile error because pmdp_get_and_clear_notify was missing Changes V1->V2: * Rebase to v3.16-rc7 * Added call of ->invalidate_range to _

[PATCH 3/3] mmu_notifier: Add the call-back for mmu_notifier_invalidate_range()

2014-10-28 Thread Joerg Roedel
From: Joerg Roedel Now that the mmu_notifier_invalidate_range() calls are in place, add the call-back to allow subsystems to register against it. Reviewed-by: Andrea Arcangeli Reviewed-by: Jérôme Glisse Signed-off-by: Joerg Roedel --- include/linux/mmu_notifier.h | 37 +++

[PATCH 2/3] mmu_notifier: Call mmu_notifier_invalidate_range() from VMM

2014-10-28 Thread Joerg Roedel
From: Joerg Roedel Add calls to the new mmu_notifier_invalidate_range() function to all places in the VMM that need it. Reviewed-by: Andrea Arcangeli Reviewed-by: Jérôme Glisse Signed-off-by: Joerg Roedel --- include/linux/mmu_notifier.h | 41 + kernel

[PATCH 1/3] mmu_notifier: Add mmu_notifier_invalidate_range()

2014-10-28 Thread Joerg Roedel
From: Joerg Roedel This notifier closes an important gap in the current mmu_notifier implementation, the existing call-backs are called too early or too late to reliably manage a non-CPU TLB. Specifically, invalidate_range_start() is called when all pages are still mapped and invalidate_range_en

Re: [PATCH] iommu: use dev_get_platdata()

2014-10-28 Thread kiran . padwal
On Wednesday, October 22, 2014 10:30am, "Joerg Roedel" said: > On Fri, Oct 10, 2014 at 07:01:10PM +0530, Kiran Padwal wrote: >> Use the wrapper function for retrieving the platform data instead of >> accessing dev->platform_data directly. >> >> Signed-off-by: Kiran Padwal >> --- >> drivers/io

[Patch Part2 v3 21/24] iommu/vt-d: Refine the interfaces to create IRQ for DMAR unit

2014-10-28 Thread Jiang Liu
Refine the interfaces to create IRQ for DMAR unit. It's a preparation for converting DMAR IRQ to irqdomain on x86. It also moves dmar_alloc_hwirq()/dmar_free_hwirq() from irq_remapping.h to dmar.h. They are not irq_remapping specific. Signed-off-by: Jiang Liu --- arch/ia64/include/asm/irq_remap

[Patch Part2 v3 19/24] x86: irq_remapping: Clean up unused MSI related code

2014-10-28 Thread Jiang Liu
Now MSI interrupt has been converted to new hierarchy irqdomain interfaces, so kill legacy MSI related code and interfaces. Signed-off-by: Jiang Liu --- arch/x86/include/asm/irq_remapping.h | 13 --- arch/x86/include/asm/pci.h |5 -- arch/x86/kernel/x86_init.c |2 -

[Patch Part2 v3 17/24] iommu/vt-d: Clean up unused MSI related code

2014-10-28 Thread Jiang Liu
Now MSI interrupt has been converted to new hierarchy irqdomain interfaces, so kill legacy MSI related code. Signed-off-by: Jiang Liu --- drivers/iommu/intel_irq_remapping.c | 144 --- 1 file changed, 144 deletions(-) diff --git a/drivers/iommu/intel_irq_remappi

[Patch Part2 v3 18/24] iommu/amd: Clean up unused MSI related code

2014-10-28 Thread Jiang Liu
Now MSI interrupt has been converted to new hierarchy irqdomain interfaces, so kill legacy MSI related code. Signed-off-by: Jiang Liu --- drivers/iommu/amd_iommu.c | 115 + 1 file changed, 2 insertions(+), 113 deletions(-) diff --git a/drivers/iommu/

[Patch Part2 v3 15/24] x86, MSI: Use hierarchy irqdomain to manage MSI interrupts

2014-10-28 Thread Jiang Liu
Enhance MSI code to support hierarchy irqdomain, it helps to make the architecture more clear. Signed-off-by: Jiang Liu --- arch/x86/include/asm/hw_irq.h|9 +- arch/x86/include/asm/irq_remapping.h |6 +- arch/x86/kernel/apic/msi.c | 237

[Patch Part2 v3 10/24] x86: irq_remapping: Introduce new interfaces to support hierarchy irqdomain

2014-10-28 Thread Jiang Liu
Introduce new interfaces for interrupt remapping drivers to support hierarchy irqdomain: 1) irq_remapping_get_ir_irq_domain(): get irqdomain associated with an interrupt remapping unit. IOAPIC/HPET drivers use this interface to get parent interrupt remapping irqdomain. 2) irq_remapping_get_ir

[Patch Part2 v3 09/24] x86, dmar: Use new irqdomain interfaces to allocate/free IRQ

2014-10-28 Thread Jiang Liu
Use new irqdomain interfaces to allocate/free IRQ for DMAR and interrupt remapping, so we could kill GENERIC_IRQ_LEGACY_ALLOC_HWIRQ later. The private definition of irq_alloc_hwirqs()/irq_free_hwirqs() are temporary solution, it will be removed once we have converted interrupt remapping driver to

[Patch Part2 v3 11/24] iommu/vt-d: Change prototypes to prepare for enabling hierarchy irqdomain

2014-10-28 Thread Jiang Liu
Prepare for support hierarchy irqdomain by changing function prototypes, should be no function changes. Signed-off-by: Jiang Liu --- drivers/iommu/intel_irq_remapping.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/iommu/intel_irq_remappin

[Patch Part2 v3 13/24] iommu/amd: Enhance AMD IR driver to suppport hierarchy irqdomain

2014-10-28 Thread Jiang Liu
Enhance AMD interrupt remapping driver to support hierarchy irqdomain, it will simplify the code eventually. Signed-off-by: Jiang Liu --- drivers/iommu/amd_iommu.c | 341 ++- drivers/iommu/amd_iommu_init.c |4 + drivers/iommu/amd_iommu_proto.h |

[Patch Part2 v3 12/24] iommu/vt-d: Enhance Intel IR driver to suppport hierarchy irqdomain

2014-10-28 Thread Jiang Liu
Enhance Intel interrupt remapping driver to support hierarchy irqdomain, it will simplify the code eventually. It also implements intel_ir_chip to support stacked irq_chip. Signed-off-by: Jiang Liu --- drivers/iommu/intel_irq_remapping.c | 356 +-- include/linux/