summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchel Humpherys <mitchelh@codeaurora.org>2015-04-07 17:17:51 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:11:55 -0700
commit2c1e73b58e6fc2c6c06a5e68445f0bfd11de6535 (patch)
tree40701a3c18e9ba037fca8ed5e544f7fbe1d0c92d
parent4e0702c06c68aeb1e99f811c026c3205a3888382 (diff)
iommu/arm-smmu: drop S2CR sanity check
An extra check was added in [3c8766d0c: "iommu/arm-smmu: Do not access non-existing S2CR registers"] to make sure we didn't add stream IDs greater than the maximum allowed value when stream matching is not supported. That check was designed to happen at device tree parse time, after probing the SMMU to get the maximum allowed SID value. However, we've added support for clocks since that time, which are also parsed from the device tree. So we can't probe the device to see what features it supports until we parse the device tree so that we can enable clocks. Fix this catch-22 by dropping the max stream ID value check. This won't affect current MSM targets at all since they all support the stream matching feature, so the sanity check was never applicable. An alternate solution might be to do a multi-phase parse of the device tree to pull out just the necessary configuration to power on the SMMU (clocks, etc), then probe the device for features, then parse the rest of the device tree (during which time we'd do this sanity check). Change-Id: I679bbde96a4b8800da0c6d7a5a186d0fe7bd0d75 Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
-rw-r--r--drivers/iommu/arm-smmu.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 5bfe25878a66..a810ae3b21b3 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -631,18 +631,9 @@ static int register_smmu_master(struct arm_smmu_device *smmu,
master->of_node = entry->node;
master->cfg.num_streamids = entry->num_sids;
- for (i = 0; i < master->cfg.num_streamids; ++i) {
- u16 streamid = entry->streamids[i];
-
- if (!(smmu->features & ARM_SMMU_FEAT_STREAM_MATCH) &&
- (streamid >= smmu->num_mapping_groups)) {
- dev_err(dev,
- "stream ID for master device %s greater than maximum allowed (%d)\n",
- entry->node->name, smmu->num_mapping_groups);
- return -ERANGE;
- }
- master->cfg.streamids[i] = streamid;
- }
+ for (i = 0; i < master->cfg.num_streamids; ++i)
+ master->cfg.streamids[i] = entry->streamids[i];
+
return insert_smmu_master(smmu, master);
}