Re: [PATCH v3 0/2] Exynos IOMMU: proper runtime PM support (use device dependencies)

2016-09-20 Thread Marek Szyprowski
Hi All, On 2016-09-19 23:45, Tobias Jakobi wrote: I did some tests with the new version today. Sadly the reboot/shutdown issues are still present. Thanks for the report. I've managed to reproduce this issue and it is again caused by modifying device on devices_kset list before it will be final

Re: [PATCH RESEND 4/4] iommu/amd: No need to wait iommu completion if no dte irq entry change

2016-09-20 Thread Joerg Roedel
On Tue, Sep 20, 2016 at 09:05:34AM +0800, Baoquan He wrote: > This is a clean up. In get_irq_table() only if DTE entry is changed > iommu_completion_wait() need be called. Otherwise no need to do it. > > Signed-off-by: Baoquan He > --- > drivers/iommu/amd_iommu.c | 6 +++--- > 1 file changed, 3

Re: [PATCH RESEND 4/4] iommu/amd: No need to wait iommu completion if no dte irq entry change

2016-09-20 Thread Baoquan He
On 09/20/16 at 11:56am, Joerg Roedel wrote: > On Tue, Sep 20, 2016 at 09:05:34AM +0800, Baoquan He wrote: > > This is a clean up. In get_irq_table() only if DTE entry is changed > > iommu_completion_wait() need be called. Otherwise no need to do it. > > > > Signed-off-by: Baoquan He > > --- > >

[GIT PULL] iommu/arm-smmu: Updates for 4.9

2016-09-20 Thread Will Deacon
Hi Joerg, Please pull these significant arm-smmu updates for 4.9. The vast majority of the code here is Robin's series to move the drivers over to the generic DT bindings, which finally hooks up the DMA API and MSI mapping for host machines. This has been stewing for a while and is now at the poin

Re: [PATCH v5 4/8] iommu/amd: Add function copy_dev_tables

2016-09-20 Thread Joerg Roedel
Hi Baoquan, On Thu, Sep 15, 2016 at 11:03:22PM +0800, Baoquan He wrote: > +static int copy_dev_tables(void) > +{ > + u64 entry; > + u32 lo, hi, devid; > + phys_addr_t old_devtb_phys; > + struct dev_table_entry *old_devtb = NULL; > + u16 dom_id, dte_v; > + struct amd_iommu *

Re: [PATCH v5 5/8] iommu/amd: copy old trans table from old kernel

2016-09-20 Thread Joerg Roedel
On Thu, Sep 15, 2016 at 11:03:23PM +0800, Baoquan He wrote: > Here several things need be done: > 1) If iommu is pre-enabled in a normal kernel, just disable it and print >warning. > 2) If failed to copy dev table of old kernel, continue to proceed as >it does in normal kernel. > 3) Re-enab

Re: [PATCH v5 6/8] iommu/amd: Do not re-enable dev table entries in kdump

2016-09-20 Thread Joerg Roedel
On Thu, Sep 15, 2016 at 11:03:24PM +0800, Baoquan He wrote: > This enabling should have been done in normal kernel. It's unnecessary > to enable it again in kdump kernel. > > And clean up the function comments of init_device_table_dma. Well, no. We don't want to make any assumptions on what the p

Re: [PATCH v5 7/8] iommu/amd: Don't update domain info to dte entry at iommu init stage

2016-09-20 Thread Joerg Roedel
On Thu, Sep 15, 2016 at 11:03:25PM +0800, Baoquan He wrote: > AMD iommu creates protection domain and assign each device to it during > iommu driver initialization stage. This happened just after system pci > bus scanning stage, and much earlier than device driver init stage. So > at this time if i

[PATCH/RFC] iommu/ipmmu-vmsa: Update ->add_device() return value

2016-09-20 Thread Magnus Damm
s for now, as they just mean that the * device is not translated by an IOMMU. We still care about * other errors and fail to initialize when they happen. */ Signed-off-by: Magnus Damm --- Applies to next-20160920 on top of: b1e2afc iommu/ipmmu-vmsa: Fix wrong error handle of ipmmu_add_dev

Re: [PATCH v5 8/8] iommu/amd: Update domain into to dte entry during device driver init

2016-09-20 Thread Joerg Roedel
On Thu, Sep 15, 2016 at 11:03:26PM +0800, Baoquan He wrote: > All devices are supposed to reset themselves at device driver initialization > stage. At this time if in kdump kernel those on-flight DMA will be stopped > because of device reset. It's best time to update the protection domain info, > e

Re: [PATCH/RFC] iommu/ipmmu-vmsa: Update ->add_device() return value

2016-09-20 Thread Robin Murphy
> the add_iommu_group() function in iommu.c: > > /* > * We ignore -ENODEV errors for now, as they just mean that the > * device is not translated by an IOMMU. We still care about > * other errors and fail to initialize when they happen. > */ > > Signed-off-by: M

[PATCH v5 00/07] iommu/ipmmu-vmsa: IPMMU multi-arch update V5

2016-09-20 Thread Magnus Damm
build on multiple architectures. In the process of doing so the interrupt code gets reworked and the foundation for supporting multiple contexts are added. Changes since V4: - Updated patch 3/7 to work on top on the following commit in next-20160920: b1e2afc iommu/ipmmu-vmsa: Fix wrong error

[PATCH v5 01/07] iommu/ipmmu-vmsa: Remove platform data handling

2016-09-20 Thread Magnus Damm
From: Magnus Damm The IPMMU driver is using DT these days, and platform data is no longer used by the driver. Remove unused code. Signed-off-by: Magnus Damm Reviewed-by: Laurent Pinchart --- Changes since V4: - None Changes since V3: - None Changes since V2: - None Changes since V1:

[PATCH v5 02/07] iommu/ipmmu-vmsa: Rework interrupt code and use bitmap for context

2016-09-20 Thread Magnus Damm
From: Magnus Damm Introduce a bitmap for context handing and convert the interrupt routine to handle all registered contexts. At this point the number of contexts are still limited. Also remove the use of the ARM specific mapping variable from ipmmu_irq() to allow compile on ARM64. Signed-off-

[PATCH v5 04/07] iommu/ipmmu-vmsa: Break out domain allocation code

2016-09-20 Thread Magnus Damm
From: Magnus Damm Break out the domain allocation code into a separate function. This is preparation for future code sharing. Signed-off-by: Magnus Damm --- Changes since V4: - None Changes since V3: - None Changes since V2: - Included this new patch as-is from the following series:

[PATCH v5 03/07] iommu/ipmmu-vmsa: Break out utlb parsing code

2016-09-20 Thread Magnus Damm
From: Magnus Damm Break out the utlb parsing code and dev_data allocation into a separate function. This is preparation for future code sharing. Signed-off-by: Magnus Damm --- Changes since V4: - Dropped hunk with fix to apply on top of: b1e2afc iommu/ipmmu-vmsa: Fix wrong error handle of

[PATCH v5 05/07] iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops

2016-09-20 Thread Magnus Damm
From: Magnus Damm Introduce an alternative set of iommu_ops suitable for 64-bit ARM as well as 32-bit ARM when CONFIG_IOMMU_DMA=y. Also adjust the Kconfig to depend on ARM or IOMMU_DMA. Signed-off-by: Magnus Damm --- Changes since V4: - Added Kconfig hunk to depend on ARM or IOMMU_DMA Chan

[PATCH v5 06/07] iommu/ipmmu-vmsa: ARM and ARM64 archdata access

2016-09-20 Thread Magnus Damm
From: Magnus Damm Not all architectures have an iommu member in their archdata, so use #ifdefs support build wit COMPILE_TEST on any architecture. Signed-off-by: Magnus Damm --- Changes since V4: - None Changes since V3: - New patch drivers/iommu/ipmmu-vmsa.c | 37

[PATCH v5 07/07] iommu/ipmmu-vmsa: Drop LPAE Kconfig dependency

2016-09-20 Thread Magnus Damm
From: Magnus Damm Neither the ARM page table code enabled by IOMMU_IO_PGTABLE_LPAE nor the IPMMU_VMSA driver actually depends on ARM_LPAE, so get rid of the dependency. Tested with ipmmu-vmsa on r8a7794 ALT and a kernel config using: # CONFIG_ARM_LPAE is not set Signed-off-by: Magnus Damm Ack

Re: [PATCH v7 05/22] Docs: dt: document ARM SMMUv3 generic binding usage

2016-09-20 Thread Rob Herring
On Mon, Sep 12, 2016 at 05:13:43PM +0100, Robin Murphy wrote: > We're about to ratify our use of the generic binding, so document it. > > CC: Rob Herring > CC: Mark Rutland > Signed-off-by: Robin Murphy > > --- > > - Reference PCI "iommu-map" binding instead, as that's our main concern > - Fi

Re: [PATCH/RFC] iommu/ipmmu-vmsa: Update ->add_device() return value

2016-09-20 Thread Magnus Damm
Hi Robin, Thanks for your feedback!! On Tue, Sep 20, 2016 at 10:18 PM, Robin Murphy wrote: > Hi Magnus, > > On 20/09/16 13:41, Magnus Damm wrote: >> From: Magnus Damm >> >> Update the IPMMU driver to return -ENODEV when adding devices >> not hooked up a particular IPMMU instance. >> >> Currentl