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

Commit 2eb31363 authored by Patrick Daly's avatar Patrick Daly
Browse files

iommu: arm-smmu: Correct decrement of s2cr use count



If a pair (context bank, s2cr, smr) initialized by the bootloader is handed
off to its real client, only decrement the counts of the corresponding
s2cr.

Fixes commit da68882a
("iommu: arm-smmu: Handoff SMR registers and context banks")

Change-Id: Id26f0f3b1835fd3d0707c573641b60f44f991f67
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent a3ba7da6
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3317,8 +3317,7 @@ static int arm_smmu_alloc_cb(struct iommu_domain *domain,
	}

	for (i = 0; i < smmu->num_mapping_groups; i++) {
		if (smmu->s2crs[i].cbndx == cb) {
			smmu->s2crs[i].cbndx = 0;
		if (smmu->s2crs[i].cb_handoff && smmu->s2crs[i].cbndx == cb) {
			smmu->s2crs[i].cb_handoff = false;
			smmu->s2crs[i].count -= 1;
		}