Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff5d6f72 authored by Charan Teja Reddy's avatar Charan Teja Reddy
Browse files

iommu/arm-smmu: fix issue by devm_free_irq on cb interrupt line



Fix the issue caused by the devm_free_irq on a unfilled CB interrupt
array by filling the cfg->irptndx at proper place.

devm_free_irq+0x58/0x60
arm_smmu_destroy_domain_context+0xc4/0x188
arm_smmu_attach_dev+0xb00/0xb2c
__iommu_attach_device+0x4c/0x110
__iommu_attach_group+0x54/0x74
iommu_attach_group+0x30/0x50
arm_iommu_attach_device+0x88/0x2f

Change-Id: I50cb4206ab56d78809777543162edf68974fcc37
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent e7cc30f3
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -1803,12 +1803,6 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
		goto out_unlock;

	cfg->cbndx = ret;
	if (smmu->version < ARM_SMMU_V2) {
		cfg->irptndx = atomic_inc_return(&smmu->irptndx);
		cfg->irptndx %= smmu->num_context_irqs;
	} else {
		cfg->irptndx = cfg->cbndx;
	}

	if (arm_smmu_is_slave_side_secure(smmu_domain)) {
		smmu_domain->pgtbl_cfg = (struct io_pgtable_cfg) {
@@ -1878,6 +1872,13 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
			goto out_clear_smmu;


		if (smmu->version < ARM_SMMU_V2) {
			cfg->irptndx = atomic_inc_return(&smmu->irptndx);
			cfg->irptndx %= smmu->num_context_irqs;
		} else {
			cfg->irptndx = cfg->cbndx;
		}

		/*
		 * Request context fault interrupt. Do this last to avoid the
		 * handler seeing a half-initialised domain state.