iommu: disable smmu stalls on faulty transactions
Disable the SMMU stalls on faulty transactions by terminating it using the CB.SCTLR register. Faulty transaction on a CB causes the back pressure on the QSMMU transaction pipe which inturn affect the other masters using the same SMMU. Pass the DOMAIN_ATTR_CB_STALL_DISABLE flag to iommu_domain_set_attr api in order to use this feature. Change-Id: Ib8fa35854ff24e0295d330c5fb79375f58c3e841 Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
This commit is contained in:
parent
048c70075f
commit
ad3b1dcc93
3 changed files with 20 additions and 1 deletions
|
@ -234,6 +234,7 @@
|
|||
|
||||
#define SCTLR_S1_ASIDPNE (1 << 12)
|
||||
#define SCTLR_CFCFG (1 << 7)
|
||||
#define SCTLR_HUPCF (1 << 8)
|
||||
#define SCTLR_CFIE (1 << 6)
|
||||
#define SCTLR_CFRE (1 << 5)
|
||||
#define SCTLR_E (1 << 4)
|
||||
|
@ -1628,6 +1629,11 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain,
|
|||
/* SCTLR */
|
||||
reg = SCTLR_CFCFG | SCTLR_CFIE | SCTLR_CFRE | SCTLR_EAE_SBOP;
|
||||
|
||||
if (smmu_domain->attributes & (1 << DOMAIN_ATTR_CB_STALL_DISABLE)) {
|
||||
reg &= ~SCTLR_CFCFG;
|
||||
reg |= SCTLR_HUPCF;
|
||||
}
|
||||
|
||||
if ((!(smmu_domain->attributes & (1 << DOMAIN_ATTR_S1_BYPASS)) &&
|
||||
!(smmu_domain->attributes & (1 << DOMAIN_ATTR_EARLY_MAP))) ||
|
||||
!stage1)
|
||||
|
@ -3138,7 +3144,11 @@ static int arm_smmu_domain_get_attr(struct iommu_domain *domain,
|
|||
& (1 << DOMAIN_ATTR_ENABLE_TTBR1));
|
||||
ret = 0;
|
||||
break;
|
||||
|
||||
case DOMAIN_ATTR_CB_STALL_DISABLE:
|
||||
*((int *)data) = !!(smmu_domain->attributes
|
||||
& (1 << DOMAIN_ATTR_CB_STALL_DISABLE));
|
||||
ret = 0;
|
||||
break;
|
||||
default:
|
||||
ret = -ENODEV;
|
||||
break;
|
||||
|
@ -3325,6 +3335,12 @@ static int arm_smmu_domain_set_attr(struct iommu_domain *domain,
|
|||
ret = 0;
|
||||
break;
|
||||
}
|
||||
case DOMAIN_ATTR_CB_STALL_DISABLE:
|
||||
if (*((int *)data))
|
||||
smmu_domain->attributes |=
|
||||
1 << DOMAIN_ATTR_CB_STALL_DISABLE;
|
||||
ret = 0;
|
||||
break;
|
||||
default:
|
||||
ret = -ENODEV;
|
||||
break;
|
||||
|
|
|
@ -72,6 +72,8 @@ static const char *iommu_debug_attr_to_string(enum iommu_attr attr)
|
|||
return "DOMAIN_ATTR_FAST";
|
||||
case DOMAIN_ATTR_EARLY_MAP:
|
||||
return "DOMAIN_ATTR_EARLY_MAP";
|
||||
case DOMAIN_ATTR_CB_STALL_DISABLE:
|
||||
return "DOMAIN_ATTR_CB_STALL_DISABLE";
|
||||
default:
|
||||
return "Unknown attr!";
|
||||
}
|
||||
|
|
|
@ -137,6 +137,7 @@ enum iommu_attr {
|
|||
DOMAIN_ATTR_PAGE_TABLE_IS_COHERENT,
|
||||
DOMAIN_ATTR_PAGE_TABLE_FORCE_COHERENT,
|
||||
DOMAIN_ATTR_ENABLE_TTBR1,
|
||||
DOMAIN_ATTR_CB_STALL_DISABLE,
|
||||
DOMAIN_ATTR_MAX,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue