IOMMU Fixes for Linux v4.0-rc3
The patches contain: * Fix multiple ARM IOMMU drivers to behave well when the hardware is not present * Mark MSM driver as broken * Fix build errors with the new ARM generic io-page-table code -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJU/zbaAAoJECvwRC2XARrjZFsP/2rZAiDJ1NGBOoJO+v+QlEY/ //wxpyKWnJ977vkgIAVvBZqWLFbwO8UF3jnRlfF4nrpbkbRynB62kczov9G/3Mzo kur1gT472xYSTd87yGfBKl9hfIn5GQpe8BFX3UU9SkkSR11z7iDBb6X7LevmeyqB B24WgzX0haKCSYMj5/jd1iskzI1KomhoLLUrh5+vmDHj12P9B2TmCuK/6hZOBtQI GSCvrje3FWHdymCfGym2QZmwQIdm6ZlvzSBuTLp8F3PUKbf7hVvpszCbMRJ/ZYCl gDvn0mDXyi14heEeXzHVF6574Sd1UBfxRWpgmDQpDRUAREzt3NW+FUbwMQg1XnzD nN8ft1QCjhzK2elb0rsp6ZN4tkLEGZMU/EgUfnrLvt9/yhhOzwN7u2tDIXpM5dwW KsgX/cKQssH8tJBfRy8YyXmb6ez9nV3yo0byHUCrC5YlCYrSGEpSe9mMstO5/Zo7 UFL0OPdbscdU1H2kYTA8YA1RywmUM/icn8mTrh/B2qkhxwusEJeqj4UOmtM3oiwF RuUp3hfeYYuDaDIiAsJ0yaaSMdmQ2LummJClYJOVVOSAKacLWwG4HkyBLSrMIiol H30cUEtGGnSbrptnYAI5M3gVFuNj1kTVjSw2ccc3EaEiAC7/iOPk4ho52ItEAkpT ZGCBV1jtJ51RNeOh8r66 =dL5c -----END PGP SIGNATURE----- Merge tag 'iommu-fixes-v4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: "The patches contain: - fix multiple ARM IOMMU drivers to behave well when the hardware is not present - mark MSM driver as broken - fix build errors with the new ARM generic io-page-table code" * tag 'iommu-fixes-v4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/io-pgtable-arm: Add built time dependency iommu/msm: Mark driver BROKEN iommu/rockchip: Play nice in multi-platform builds iommu/omap: Play nice in multi-platform builds iommu/exynos: Play nice in multi-platform builds iommu/io-pgtable-arm: Fix self-test WARNs on i386
This commit is contained in:
commit
9c3e1323ec
5 changed files with 26 additions and 2 deletions
|
@ -23,6 +23,7 @@ config IOMMU_IO_PGTABLE
|
|||
config IOMMU_IO_PGTABLE_LPAE
|
||||
bool "ARMv7/v8 Long Descriptor Format"
|
||||
select IOMMU_IO_PGTABLE
|
||||
depends on ARM || ARM64 || COMPILE_TEST
|
||||
help
|
||||
Enable support for the ARM long descriptor pagetable format.
|
||||
This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page
|
||||
|
@ -63,6 +64,7 @@ config MSM_IOMMU
|
|||
bool "MSM IOMMU Support"
|
||||
depends on ARM
|
||||
depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST
|
||||
depends on BROKEN
|
||||
select IOMMU_API
|
||||
help
|
||||
Support for the IOMMUs found on certain Qualcomm SOCs.
|
||||
|
|
|
@ -1186,8 +1186,15 @@ static const struct iommu_ops exynos_iommu_ops = {
|
|||
|
||||
static int __init exynos_iommu_init(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
int ret;
|
||||
|
||||
np = of_find_matching_node(NULL, sysmmu_of_match);
|
||||
if (!np)
|
||||
return 0;
|
||||
|
||||
of_node_put(np);
|
||||
|
||||
lv2table_kmem_cache = kmem_cache_create("exynos-iommu-lv2table",
|
||||
LV2TABLE_SIZE, LV2TABLE_SIZE, 0, NULL);
|
||||
if (!lv2table_kmem_cache) {
|
||||
|
|
|
@ -56,7 +56,8 @@
|
|||
((((d)->levels - ((l) - ARM_LPAE_START_LVL(d) + 1)) \
|
||||
* (d)->bits_per_level) + (d)->pg_shift)
|
||||
|
||||
#define ARM_LPAE_PAGES_PER_PGD(d) ((d)->pgd_size >> (d)->pg_shift)
|
||||
#define ARM_LPAE_PAGES_PER_PGD(d) \
|
||||
DIV_ROUND_UP((d)->pgd_size, 1UL << (d)->pg_shift)
|
||||
|
||||
/*
|
||||
* Calculate the index at level l used to map virtual address a using the
|
||||
|
@ -66,7 +67,7 @@
|
|||
((l) == ARM_LPAE_START_LVL(d) ? ilog2(ARM_LPAE_PAGES_PER_PGD(d)) : 0)
|
||||
|
||||
#define ARM_LPAE_LVL_IDX(a,l,d) \
|
||||
(((a) >> ARM_LPAE_LVL_SHIFT(l,d)) & \
|
||||
(((u64)(a) >> ARM_LPAE_LVL_SHIFT(l,d)) & \
|
||||
((1 << ((d)->bits_per_level + ARM_LPAE_PGD_IDX(l,d))) - 1))
|
||||
|
||||
/* Calculate the block/page mapping size at level l for pagetable in d. */
|
||||
|
|
|
@ -1376,6 +1376,13 @@ static int __init omap_iommu_init(void)
|
|||
struct kmem_cache *p;
|
||||
const unsigned long flags = SLAB_HWCACHE_ALIGN;
|
||||
size_t align = 1 << 10; /* L2 pagetable alignement */
|
||||
struct device_node *np;
|
||||
|
||||
np = of_find_matching_node(NULL, omap_iommu_of_match);
|
||||
if (!np)
|
||||
return 0;
|
||||
|
||||
of_node_put(np);
|
||||
|
||||
p = kmem_cache_create("iopte_cache", IOPTE_TABLE_SIZE, align, flags,
|
||||
iopte_cachep_ctor);
|
||||
|
|
|
@ -1015,8 +1015,15 @@ static struct platform_driver rk_iommu_driver = {
|
|||
|
||||
static int __init rk_iommu_init(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
int ret;
|
||||
|
||||
np = of_find_matching_node(NULL, rk_iommu_dt_ids);
|
||||
if (!np)
|
||||
return 0;
|
||||
|
||||
of_node_put(np);
|
||||
|
||||
ret = bus_set_iommu(&platform_bus_type, &rk_iommu_ops);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue