summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/tegra-smmu.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'v3.7-rc7' into next/cleanupOlof Johansson2012-11-251-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Merging in mainline back to next/cleanup since it has collected a few conflicts between fixes going upstream and some of the cleanup patches. Git doesn't auto-resolve some of them, and they're mostly noise so let's take care of it locally. Conflicts are in: arch/arm/mach-omap2/omap_hwmod_44xx_data.c arch/arm/plat-omap/i2c.c drivers/video/omap2/dss/dss.c Signed-off-by: Olof Johansson <olof@lixom.net>
| * iommu/tegra-smmu.c: fix dentry reference leak in smmu_debugfs_stats_show().Cyril Roelandt2012-11-171-0/+1
| | | | | | | | | | | | | | Call to d_find_alias() needs a corresponding dput(). Signed-off-by: Cyril Roelandt <tipecaml@gmail.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
* | ARM: tegra: move tegra-ahb.h out of arch/arm/mach-tegra/Stephen Warren2012-11-051-2/+1
| | | | | | | | | | | | | | | | | | We wish to empty arch/arm/mach-tegra/include/mach/ as much as possible to enable single zImage. Move tegra-ahb.h to a more central location (suggested by Arnd, OK'd by Greg KH), and actually make tegra-ahb.c include the header to ensure client and provider agree on the prototype. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* | iommu: tegra: remove include of <mach/iomap.h>Stephen Warren2012-11-051-1/+0
|/ | | | | | | | Nothing from this file is used, and the file will hopefully be deleted soon. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Joerg Roedel <joerg.roedel@amd.com>
* iommu/tegra: smmu: Fix deadly typoHiro Sugawara2012-10-241-1/+1
| | | | | | | | | Fix a deadly typo in macro definition. Cc: stable@vger.kernel.org Signed-off-by: Hiro Sugawara <hsugawara@nvidia.com> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* Merge branches 'dma-debug', 'iommu/fixes', 'arm/tegra', 'arm/exynos', ↵Joerg Roedel2012-10-021-13/+248
|\ | | | | | | | | | | | | 'x86/amd', 'x86/vt-d' and 'x86/amd-irq-remapping' into next Conflicts: drivers/iommu/amd_iommu_init.c
| * dma: tegra: move smmu.h into SMMU driverStephen Warren2012-09-181-1/+40
| | | | | | | | | | | | | | | | | | | | | | There's no need to place these defines into arch/arm/mach-tegra/include/. Move them into the SMMU driver to clean up mach-tegra, as a pre-requisite for single-zImage. Signed-off-by: Stephen Warren <swarren@nvidia.com> Cc: Hiroshi Doyu <hdoyu@nvidia.com> Acked-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * iommu/tegra: smmu: Use debugfs_create_dir for directoryHiroshi Doyu2012-09-181-17/+35
| | | | | | | | | | | | | | | | | | | | The commit c3b1a35 "debugfs: make sure that debugfs_create_file() gets used only for regulars" doesn't allow to use debugfs_create_file() for dir. Keep debugfs data in smmu_device instead of directory's i_private. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * iommu/tegra: smmu: debugfs for TLB/PTC statisticsHiroshi Doyu2012-08-031-12/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add debugfs entries to collect TLB/PTC statistics. $ echo "reset" > /sys/kernel/debug/smmu/mc/{tlb,ptc} $ echo "on" > /sys/kernel/debug/smmu/mc/{tlb,ptc} $ echo "off" > /sys/kernel/debug/smmu/mc/{tlb,ptc} $ cat /sys/kernel/debug/smmu/mc/{tlb,ptc} hit:0014910c miss:00014d22 The above format is: hit:<HIT count><SPC>miss:<MISS count><SPC><CR+LF> fscanf(fp, "hit:%lx miss:%lx", &hit, &miss); Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | iommu/tegra: smmu: Fix error initial value at domain_initHiroshi Doyu2012-08-031-1/+1
| | | | | | | | | | | | | | | | err initial value should be -EAGAIN. Otherwise 2nd iteration always fails in the case as[0] is occupied. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | iommu/tegra: smmu: Cleanup with lesser nestHiroshi Doyu2012-08-031-5/+8
| | | | | | | | | | | | | | Small clean up with lesser nest for readability. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | iommu/tegra: remove invalid reference to list iterator variableJulia Lawall2012-08-031-1/+1
|/ | | | | | | | | | | | | | | | If list_for_each_entry, etc complete a traversal of the list, the iterator variable ends up pointing to an address at an offset from the list head, and not a meaningful structure. Thus this value should not be used after the end of the iterator. Replace c->dev by dev, which is the value that c->dev has been compared to. This problem was found using Coccinelle (http://coccinelle.lip6.fr/). Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Hiroshi DOYU <hdoyu@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
*---. Merge branches 'iommu/fixes', 'x86/amd', 'groups', 'arm/tegra' and ↵Joerg Roedel2012-07-231-131/+154
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'api/domain-attr' into next Conflicts: drivers/iommu/iommu.c include/linux/iommu.h
| | | * iommu/tegra: Implement DOMAIN_ATTR_GEOMETRY attributeHiroshi DOYU2012-07-111-0/+5
| | |/ | |/| | | | | | | | | | | | | | | | Implement the attribute for the Tegra IOMMU drivers. Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * iommu/tegra: Don't call alloc_pdir with as->lockJoerg Roedel2012-07-171-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of taking as->lock before calling alloc_pdir() and releasing it in that function to allocate memory, just take the lock only in the alloc_pdir function and run the loop without any lock held. This simplifies the complicated lock->unlock->alloc->lock->unlock sequence into alloc->lock->unlock. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * iommu/tegra: smmu: Fix unsleepable memory allocation at alloc_pdir()Hiroshi DOYU2012-07-171-32/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | alloc_pdir() is called from smmu_iommu_domain_init() with spin_lock held. memory allocations in alloc_pdir() had to be atomic. Instead of converting into atomic allocation, this patch once releases a lock, does the allocation, holds the lock again and then sees if it's raced or not in order to avoid introducing mutex and preallocation. Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Reported-by: Chris Wright <chrisw@sous-sol.org> Cc: Chris Wright <chrisw@sous-sol.org> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * iommu/tegra: smmu: Remove unnecessary sanity check at alloc_pdir()Hiroshi DOYU2012-07-171-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | alloc_pdir() is called with smmu->as[?].pdir_page == NULL. No need to check pdir_page again inside alloc_pdir(). Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * iommu/tegra: smmu: Fix uninitialized var warningHiroshi Doyu2012-06-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | For the compiler warning, uninitizlized var when getting value by a pointer. Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * iommu/tegra: smmu: Remove unnecessary cleanups with devm_*()Hiroshi Doyu2012-06-251-31/+6
| | | | | | | | | | | | | | | | | | | | | | | | Remove unnecessary cleanup procedures with devm_*() functions. Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * iommu/tegra: smmu: Simplify allocation at onceHiroshi Doyu2012-06-251-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | To simplify the code, alloc necessary data at once. Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * iommu/tegra: smmu: Add device tree support for SMMUHiroshi Doyu2012-06-251-54/+95
| |/ | | | | | | | | | | | | | | | | | | | | | | | | The necessary info is expected to pass from DT. For more precise resource reservation, there shouldn't be any overlapping of register range between SMMU and MC. SMMU register offset needs to be calculated correctly, based on its register bank. Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | iommu/tegra: smmu: Fix unsleepable memory allocationHiroshi DOYU2012-07-021-2/+2
|/ | | | | | | | | | | allo_pdir() is called in smmu_iommu_domain_init() with spin_lock held. memory allocations in it have to be atomic/unsleepable. Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Reported-by: Chris Wright <chrisw@sous-sol.org> Acked-by: Chris Wright <chrisw@sous-sol.org> Cc: stable@vger.kernel.org Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* iommu/tegra: smmu: Print device name correctlyHiroshi DOYU2012-04-161-1/+1
| | | | | | | | Print an attached device name correctly. Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* ARM: IOMMU: Tegra30: Add iommu_ops for SMMU driverHiroshi DOYU2012-01-261-0/+1034
Tegra 30 IOMMU H/W, SMMU (System Memory Management Unit). This patch implements struct iommu_ops for SMMU for the upper IOMMU API. This H/W module supports multiple virtual address spaces(domain x4), and manages 2 level H/W translation pagetable. Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
OpenPOWER on IntegriCloud