diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-11 14:09:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-11 14:09:54 -0400 |
commit | a156e0682f5b328094c273435a46e32e100ba898 (patch) | |
tree | c62f7dbd7d099dee057ff629779f51997441178b | |
parent | 9c922a55dbfff812e8becbcfd90d1ce856adb0d9 (diff) | |
parent | 5dc5616ee850eaba055bb469a6c4a471d489140e (diff) |
Merge tag 'iommu-fixes-v4.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull iommu fixes from Joerg Roedel:
"Three fixes have queued up:
- reference count fix in the AMD IOMMUv2 driver
- sign extension fix in the ARM-SMMU driver
- build fix for rockchip driver with device tree"
* tag 'iommu-fixes-v4.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
iommu/arm-smmu: Fix sign-extension of upstream bus addresses at stage 1
iommu/rockchip: Fix build without CONFIG_OF
iommu/amd: Fix bug in put_pasid_state_wait
-rw-r--r-- | drivers/iommu/amd_iommu_v2.c | 1 | ||||
-rw-r--r-- | drivers/iommu/arm-smmu.c | 30 | ||||
-rw-r--r-- | drivers/iommu/rockchip-iommu.c | 4 |
3 files changed, 4 insertions, 31 deletions
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c index a1cbba9056fd..3465faf1809e 100644 --- a/drivers/iommu/amd_iommu_v2.c +++ b/drivers/iommu/amd_iommu_v2.c | |||
@@ -266,6 +266,7 @@ static void put_pasid_state(struct pasid_state *pasid_state) | |||
266 | 266 | ||
267 | static void put_pasid_state_wait(struct pasid_state *pasid_state) | 267 | static void put_pasid_state_wait(struct pasid_state *pasid_state) |
268 | { | 268 | { |
269 | atomic_dec(&pasid_state->count); | ||
269 | wait_event(pasid_state->wq, !atomic_read(&pasid_state->count)); | 270 | wait_event(pasid_state->wq, !atomic_read(&pasid_state->count)); |
270 | free_pasid_state(pasid_state); | 271 | free_pasid_state(pasid_state); |
271 | } | 272 | } |
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 9f7e1d34a32b..66a803b9dd3a 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c | |||
@@ -224,14 +224,7 @@ | |||
224 | #define RESUME_TERMINATE (1 << 0) | 224 | #define RESUME_TERMINATE (1 << 0) |
225 | 225 | ||
226 | #define TTBCR2_SEP_SHIFT 15 | 226 | #define TTBCR2_SEP_SHIFT 15 |
227 | #define TTBCR2_SEP_MASK 0x7 | 227 | #define TTBCR2_SEP_UPSTREAM (0x7 << TTBCR2_SEP_SHIFT) |
228 | |||
229 | #define TTBCR2_ADDR_32 0 | ||
230 | #define TTBCR2_ADDR_36 1 | ||
231 | #define TTBCR2_ADDR_40 2 | ||
232 | #define TTBCR2_ADDR_42 3 | ||
233 | #define TTBCR2_ADDR_44 4 | ||
234 | #define TTBCR2_ADDR_48 5 | ||
235 | 228 | ||
236 | #define TTBRn_HI_ASID_SHIFT 16 | 229 | #define TTBRn_HI_ASID_SHIFT 16 |
237 | 230 | ||
@@ -793,26 +786,7 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain, | |||
793 | writel_relaxed(reg, cb_base + ARM_SMMU_CB_TTBCR); | 786 | writel_relaxed(reg, cb_base + ARM_SMMU_CB_TTBCR); |
794 | if (smmu->version > ARM_SMMU_V1) { | 787 | if (smmu->version > ARM_SMMU_V1) { |
795 | reg = pgtbl_cfg->arm_lpae_s1_cfg.tcr >> 32; | 788 | reg = pgtbl_cfg->arm_lpae_s1_cfg.tcr >> 32; |
796 | switch (smmu->va_size) { | 789 | reg |= TTBCR2_SEP_UPSTREAM; |
797 | case 32: | ||
798 | reg |= (TTBCR2_ADDR_32 << TTBCR2_SEP_SHIFT); | ||
799 | break; | ||
800 | case 36: | ||
801 | reg |= (TTBCR2_ADDR_36 << TTBCR2_SEP_SHIFT); | ||
802 | break; | ||
803 | case 40: | ||
804 | reg |= (TTBCR2_ADDR_40 << TTBCR2_SEP_SHIFT); | ||
805 | break; | ||
806 | case 42: | ||
807 | reg |= (TTBCR2_ADDR_42 << TTBCR2_SEP_SHIFT); | ||
808 | break; | ||
809 | case 44: | ||
810 | reg |= (TTBCR2_ADDR_44 << TTBCR2_SEP_SHIFT); | ||
811 | break; | ||
812 | case 48: | ||
813 | reg |= (TTBCR2_ADDR_48 << TTBCR2_SEP_SHIFT); | ||
814 | break; | ||
815 | } | ||
816 | writel_relaxed(reg, cb_base + ARM_SMMU_CB_TTBCR2); | 790 | writel_relaxed(reg, cb_base + ARM_SMMU_CB_TTBCR2); |
817 | } | 791 | } |
818 | } else { | 792 | } else { |
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 4015560bf486..cab214544237 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c | |||
@@ -1004,20 +1004,18 @@ static int rk_iommu_remove(struct platform_device *pdev) | |||
1004 | return 0; | 1004 | return 0; |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | #ifdef CONFIG_OF | ||
1008 | static const struct of_device_id rk_iommu_dt_ids[] = { | 1007 | static const struct of_device_id rk_iommu_dt_ids[] = { |
1009 | { .compatible = "rockchip,iommu" }, | 1008 | { .compatible = "rockchip,iommu" }, |
1010 | { /* sentinel */ } | 1009 | { /* sentinel */ } |
1011 | }; | 1010 | }; |
1012 | MODULE_DEVICE_TABLE(of, rk_iommu_dt_ids); | 1011 | MODULE_DEVICE_TABLE(of, rk_iommu_dt_ids); |
1013 | #endif | ||
1014 | 1012 | ||
1015 | static struct platform_driver rk_iommu_driver = { | 1013 | static struct platform_driver rk_iommu_driver = { |
1016 | .probe = rk_iommu_probe, | 1014 | .probe = rk_iommu_probe, |
1017 | .remove = rk_iommu_remove, | 1015 | .remove = rk_iommu_remove, |
1018 | .driver = { | 1016 | .driver = { |
1019 | .name = "rk_iommu", | 1017 | .name = "rk_iommu", |
1020 | .of_match_table = of_match_ptr(rk_iommu_dt_ids), | 1018 | .of_match_table = rk_iommu_dt_ids, |
1021 | }, | 1019 | }, |
1022 | }; | 1020 | }; |
1023 | 1021 | ||