[PATCH v2 11/11] PCI: Remove pci_ats_enabled()

2015-07-20 Thread Bjorn Helgaas
Remove pci_ats_enabled(). There are no callers outside the ATS code itself. We don't need to check ats_cap, because if we don't find an ATS capability, we'll never set ats_enabled. Signed-off-by: Bjorn Helgaas --- drivers/pci/ats.c |6 +++--- include/linux/pci.h |2 -- 2 files change

[PATCH v2 10/11] PCI: Stop caching ATS Invalidate Queue Depth

2015-07-20 Thread Bjorn Helgaas
Stop caching the Invalidate Queue Depth in struct pci_dev. pci_ats_queue_depth() is typically called only once per device, and it returns a fixed value per-device, so callers who need the value frequently can cache it themselves. Signed-off-by: Bjorn Helgaas --- drivers/pci/ats.c |9 --

[PATCH v2 09/11] PCI: Move ATS declarations to linux/pci.h so they're all together

2015-07-20 Thread Bjorn Helgaas
Move ATS declarations to linux/pci.h so they're all in one place. Signed-off-by: Bjorn Helgaas Reviewed-by: Joerg Roedel --- include/linux/pci-ats.h | 41 - include/linux/pci.h | 10 +- 2 files changed, 9 insertions(+), 42 deletions(-) di

[PATCH v2 08/11] PCI: Clean up ATS error handling

2015-07-20 Thread Bjorn Helgaas
There's no need to BUG() if we enable ATS when it's already enabled. We don't need to BUG() when disabling ATS on a device that doesn't support ATS or if it's already disabled. If ATS is enabled, certainly we found an ATS capability in the past, so it should still be there now. Clean up these er

[PATCH v2 07/11] PCI: Use pci_physfn() rather than looking up physfn by hand

2015-07-20 Thread Bjorn Helgaas
Use the pci_physfn() helper rather than looking up physfn by hand. No functional change. Signed-off-by: Bjorn Helgaas Reviewed-by: Joerg Roedel --- drivers/pci/ats.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c index 95905f

[PATCH v2 06/11] PCI: Inline the ATS setup code into pci_ats_init()

2015-07-20 Thread Bjorn Helgaas
The ATS setup code in ats_alloc_one() is only used by pci_ats_init(), so inline it there. No functional change. Signed-off-by: Bjorn Helgaas Reviewed-by: Joerg Roedel --- drivers/pci/ats.c |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/pci/ats.c b/drivers/

[PATCH v2 05/11] PCI: Rationalize pci_ats_queue_depth() error checking

2015-07-20 Thread Bjorn Helgaas
We previously returned -ENODEV for devices that don't support ATS (except that we always returned 0 for VFs, whether or not they support ATS). For consistency, always return -EINVAL (not -ENODEV) if the device doesn't support ATS. Return zero for VFs that support ATS. Signed-off-by: Bjorn Helgaa

[PATCH v2 04/11] PCI: Reduce size of ATS structure elements

2015-07-20 Thread Bjorn Helgaas
The extended capabilities list is linked with 12-bit pointers, and the ATS Smallest Translation Unit and Invalidate Queue Depth fields are both 5 bits. Use u16 and u8 to hold the extended capability address and the stu and qdep values. No functional change. Signed-off-by: Bjorn Helgaas Reviewed

[PATCH v2 03/11] PCI: Embed ATS info directly into struct pci_dev

2015-07-20 Thread Bjorn Helgaas
The pci_ats struct is small and will get smaller, so I don't think it's worth allocating it separately from the pci_dev struct. Embed the ATS fields directly into struct pci_dev. Signed-off-by: Bjorn Helgaas --- drivers/pci/ats.c | 61 --- dri

[PATCH v2 02/11] PCI: Allocate ATS struct during enumeration

2015-07-20 Thread Bjorn Helgaas
Previously, we allocated pci_ats structures when an IOMMU driver called pci_enable_ats(). An SR-IOV VF shares the STU setting with its PF, so when enabling ATS on the VF, we allocated a pci_ats struct for the PF if it didn't already have one. We held the sriov->lock to serialize threads concurren

[PATCH v2 01/11] iommu/vt-d: Cache PCI ATS state and Invalidate Queue Depth

2015-07-20 Thread Bjorn Helgaas
We check the ATS state (enabled/disabled) and fetch the PCI ATS Invalidate Queue Depth in performance-sensitive paths. It's easy to cache these, which removes dependencies on PCI. Remember the ATS enabled state. When enabling, read the queue depth once and cache it in the device_domain_info stru

[PATCH v2 00/11] PCI: Fix ATS deadlock

2015-07-20 Thread Bjorn Helgaas
Gregor reported a deadlock [1] when enabling a VF that supports ATS. This series is intended to fix that. The second patch should be enough to fix the deadlock; the rest are simplification and cleanup. These are based on v4.2-rc2. [1] http://permalink.gmane.org/gmane.linux.kernel.iommu/9433 Cha

[PATCH 02/11] iommu/omap: Remove all module references

2015-07-20 Thread Suman Anna
The OMAP IOMMU driver has been adapted to the IOMMU framework for a while now, and it does not support being built as a module anymore. So, remove all the module references from the OMAP IOMMU driver. While at it, also relocate a comment around the subsys_initcall to avoid a checkpatch strict warn

[PATCH 09/11] iommu/omap: Use BIT(x) macros in omap-iommu.h

2015-07-20 Thread Suman Anna
Switch to using the BIT(x) macros in omap-iommu.h where possible. This eliminates the following checkpatch check warning: "CHECK: Prefer using the BIT macro" A couple of the warnings were ignored for better readability of the bit-shift for the different values. Signed-off-by: Suman Anna ---

[PATCH 03/11] iommu/omap: Move debugfs functions to omap-iommu-debug.c

2015-07-20 Thread Suman Anna
The main OMAP IOMMU driver file has some helper functions used by the OMAP IOMMU debugfs functionality, and there is already a dedicated source file omap-iommu-debug.c dealing with these debugfs routines. Move all these functions to the omap-iommu-debug.c file, so that all the debugfs related routi

[PATCH 04/11] iommu/omap: Protect omap-iopgtable.h against double inclusion

2015-07-20 Thread Suman Anna
Protect the omap-pgtable.h header against double inclusion in source code by using the standard include guard mechanism. Signed-off-by: Suman Anna --- drivers/iommu/omap-iopgtable.h | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/iommu/omap-iopgtable.h b/drivers/iommu/omap-iopgt

[PATCH 08/11] iommu/omap: Use BIT(x) macros in omap-iopgtable.h

2015-07-20 Thread Suman Anna
Switch to using the BIT(x) macros in omap-iopgtable.h where possible. This eliminates the following checkpatch check warning: "CHECK: Prefer using the BIT macro" A couple of macros that used zero bit shifting are defined directly to avoid the above warning on one of the macros. Signed-off-by:

[PATCH 06/11] iommu/omap: Remove trailing semi-colon from a macro

2015-07-20 Thread Suman Anna
Remove the trailing semi-colon in the DEBUG_FOPS_RO macro definition. This fixes the checking warning, "WARNING: macros should not use a trailing semicolon" Signed-off-by: Suman Anna --- drivers/iommu/omap-iommu-debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driv

[PATCH 07/11] iommu/omap: Remove unnecessary error traces on alloc failures

2015-07-20 Thread Suman Anna
Fix couple of checkpatch warnings of the type, "WARNING: Possible unnecessary 'out of memory' message" Signed-off-by: Suman Anna --- drivers/iommu/omap-iommu.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c

[PATCH 00/11] Some OMAP IOMMU cleanup patches

2015-07-20 Thread Suman Anna
Hi Joerg, The following series includes minor cleanup patches and checkpatch fixes to the OMAP IOMMU driver. The first 5 patches do some cleanup and some debugfs code rearrangement, while the last 6 patches deal with the stricter checkpatch warnings/checks. The series is baselined on 4.2-rc3 and

[PATCH 01/11] Documentation: dt: Add #iommu-cells info to OMAP iommu bindings

2015-07-20 Thread Suman Anna
The OMAP IOMMU bindings is updated to reflect the required #iommu-cells property. Signed-off-by: Suman Anna --- Documentation/devicetree/bindings/iommu/ti,omap-iommu.txt | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/ti,omap-iommu.txt b/Documen

[PATCH 05/11] iommu/omap: Remove unused union fields

2015-07-20 Thread Suman Anna
There are couple of unions defined in the structures iotlb_entry and cr_regs. There are no usage/references to some of these union fields in the code, so clean them up and simplify the structures. Signed-off-by: Suman Anna --- drivers/iommu/omap-iommu.h | 23 +++ 1 file chang

[PATCH 10/11] iommu/omap: Align code with open parenthesis

2015-07-20 Thread Suman Anna
Fix all the occurrences of the following check warning generated with the checkpatch --strict option: "CHECK: Alignment should match open parenthesis" Signed-off-by: Suman Anna --- drivers/iommu/omap-iommu.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) dif

[PATCH 11/11] iommu/omap: Split multiple assignments into separate lines

2015-07-20 Thread Suman Anna
Use separate assignments for assigning the same value into different variables. This fixes the following check warning generated with the checkpatch --strict option: "CHECK: multiple assignments should be avoided" Signed-off-by: Suman Anna --- drivers/iommu/omap-iommu.c | 6 -- 1 file ch

Re: [PATCH v4 0/4] arm64: IOMMU-backed DMA mapping

2015-07-20 Thread Robin Murphy
Hi Joerg, On 20/07/15 16:26, Joerg Roedel wrote: On Thu, Jul 16, 2015 at 07:40:11PM +0100, Robin Murphy wrote: arch/arm64/Kconfig | 1 + arch/arm64/include/asm/dma-mapping.h | 15 +- arch/arm64/mm/dma-mapping.c | 452 + What happene

Re: Kernel panic on Linux 4.1 with intel_iommu=on

2015-07-20 Thread Ting-Wei Lan
於 三,2015-07-01 於 03:32 +0800,Ting-Wei Lan 提到: > Hardware: > Intel Core i5 CPU 650 @ 3.20GHz > Intel Ironlake Desktop > > In order to use VT-d on this computer, I have to use 'intel_iommu=on > intel_iommu=igfx_off' to prevent graphics problems and system crash. > This problem happens on Linux 3.7 a

Re: [PATCH v4 0/4] arm64: IOMMU-backed DMA mapping

2015-07-20 Thread Joerg Roedel
On Thu, Jul 16, 2015 at 07:40:11PM +0100, Robin Murphy wrote: > arch/arm64/Kconfig | 1 + > arch/arm64/include/asm/dma-mapping.h | 15 +- > arch/arm64/mm/dma-mapping.c | 452 + What happened to the plan to merge this with the existing iommu