Skip to content

Commit 8e1a254

Browse files
committed
Merge tag 'iommu-fixes-v3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull iommu fixes from Joerg Roedel: "A couple of fixes from the IOMMU side: - some small fixes for the new ARM-SMMU driver - a register offset correction for VT-d - add MAINTAINERS entry for drivers/iommu Overall no really big or intrusive changes" * tag 'iommu-fixes-v3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: x86/iommu: correct ICS register offset MAINTAINERS: add overall IOMMU section iommu/arm-smmu: don't enable SMMU device until probing has completed iommu/arm-smmu: fix iommu_present() test in init iommu/arm-smmu: fix a signedness bug
2 parents 0d45dab + 82aeef0 commit 8e1a254

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4476,6 +4476,13 @@ L: [email protected]
44764476
S: Maintained
44774477
F: drivers/tty/serial/ioc3_serial.c
44784478

4479+
IOMMU DRIVERS
4480+
M: Joerg Roedel <[email protected]>
4481+
4482+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
4483+
S: Maintained
4484+
F: drivers/iommu/
4485+
44794486
IP MASQUERADING
44804487
M: Juanjo Ciarlante <[email protected]>
44814488
S: Maintained

drivers/iommu/arm-smmu.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ struct arm_smmu_cfg {
377377
u32 cbar;
378378
pgd_t *pgd;
379379
};
380+
#define INVALID_IRPTNDX 0xff
380381

381382
#define ARM_SMMU_CB_ASID(cfg) ((cfg)->cbndx)
382383
#define ARM_SMMU_CB_VMID(cfg) ((cfg)->cbndx + 1)
@@ -840,7 +841,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
840841
if (IS_ERR_VALUE(ret)) {
841842
dev_err(smmu->dev, "failed to request context IRQ %d (%u)\n",
842843
root_cfg->irptndx, irq);
843-
root_cfg->irptndx = -1;
844+
root_cfg->irptndx = INVALID_IRPTNDX;
844845
goto out_free_context;
845846
}
846847

@@ -869,7 +870,7 @@ static void arm_smmu_destroy_domain_context(struct iommu_domain *domain)
869870
writel_relaxed(0, cb_base + ARM_SMMU_CB_SCTLR);
870871
arm_smmu_tlb_inv_context(root_cfg);
871872

872-
if (root_cfg->irptndx != -1) {
873+
if (root_cfg->irptndx != INVALID_IRPTNDX) {
873874
irq = smmu->irqs[smmu->num_global_irqs + root_cfg->irptndx];
874875
free_irq(irq, domain);
875876
}
@@ -1857,8 +1858,6 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
18571858
goto out_put_parent;
18581859
}
18591860

1860-
arm_smmu_device_reset(smmu);
1861-
18621861
for (i = 0; i < smmu->num_global_irqs; ++i) {
18631862
err = request_irq(smmu->irqs[i],
18641863
arm_smmu_global_fault,
@@ -1876,6 +1875,8 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
18761875
spin_lock(&arm_smmu_devices_lock);
18771876
list_add(&smmu->list, &arm_smmu_devices);
18781877
spin_unlock(&arm_smmu_devices_lock);
1878+
1879+
arm_smmu_device_reset(smmu);
18791880
return 0;
18801881

18811882
out_free_irqs:
@@ -1966,10 +1967,10 @@ static int __init arm_smmu_init(void)
19661967
return ret;
19671968

19681969
/* Oh, for a proper bus abstraction */
1969-
if (!iommu_present(&platform_bus_type));
1970+
if (!iommu_present(&platform_bus_type))
19701971
bus_set_iommu(&platform_bus_type, &arm_smmu_ops);
19711972

1972-
if (!iommu_present(&amba_bustype));
1973+
if (!iommu_present(&amba_bustype))
19731974
bus_set_iommu(&amba_bustype, &arm_smmu_ops);
19741975

19751976
return 0;

include/linux/intel-iommu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */
5656
#define DMAR_IQ_SHIFT 4 /* Invalidation queue head/tail shift */
5757
#define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */
58-
#define DMAR_ICS_REG 0x98 /* Invalidation complete status register */
58+
#define DMAR_ICS_REG 0x9c /* Invalidation complete status register */
5959
#define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */
6060

6161
#define OFFSET_STRIDE (9)

0 commit comments

Comments
 (0)