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

Commit e540653a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "iommu/arm-smmu: Support DOMAIN_ATTR_S1_BYPASS"

parents ee5fe7d7 17e13281
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -1468,7 +1468,9 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain,
	}

	/* SCTLR */
	reg = SCTLR_CFCFG | SCTLR_CFIE | SCTLR_CFRE | SCTLR_M | SCTLR_EAE_SBOP;
	reg = SCTLR_CFCFG | SCTLR_CFIE | SCTLR_CFRE | SCTLR_EAE_SBOP;
	if (!stage1 || !(smmu_domain->attributes & DOMAIN_ATTR_S1_BYPASS))
		reg |= SCTLR_M;
	if (stage1)
		reg |= SCTLR_S1_ASIDPNE;
#ifdef __BIG_ENDIAN
@@ -2865,6 +2867,11 @@ static int arm_smmu_domain_get_attr(struct iommu_domain *domain,
				    & (1 << DOMAIN_ATTR_NON_FATAL_FAULTS));
		ret = 0;
		break;
	case DOMAIN_ATTR_S1_BYPASS:
		*((int *)data) = !!(smmu_domain->attributes
				    & (1 << DOMAIN_ATTR_S1_BYPASS));
		ret = 0;
		break;
	default:
		ret = -ENODEV;
		break;
@@ -2976,6 +2983,18 @@ static int arm_smmu_domain_set_attr(struct iommu_domain *domain,
		smmu_domain->non_fatal_faults = *((int *)data);
		ret = 0;
		break;
	case DOMAIN_ATTR_S1_BYPASS: {
		int bypass = *((int *)data);

		if (bypass)
			smmu_domain->attributes |= 1 << DOMAIN_ATTR_S1_BYPASS;
		else
			smmu_domain->attributes &=
					~(1 << DOMAIN_ATTR_S1_BYPASS);

		ret = 0;
		break;
	}
	default:
		ret = -ENODEV;
		break;