Skip to content

Commit 352d041

Browse files
committed
iommu: apple-dart: Disallow identity domains for locked DARTs
The register controlling bypass support is read-only for locked DARTs. In addition trnaslation can not be disabled so blocking domain has to be implemented with an empty translation table. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 6543c34 commit 352d041

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/iommu/apple-dart.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,9 @@ static int apple_dart_attach_dev_identity(struct iommu_domain *domain,
867867
if (!cfg->supports_bypass)
868868
return -EINVAL;
869869

870+
if (cfg->locked)
871+
return -EINVAL;
872+
870873
for_each_stream_map(i, cfg, stream_map)
871874
WARN_ON(pm_runtime_get_sync(stream_map->dart->dev) < 0);
872875

@@ -895,6 +898,9 @@ static int apple_dart_attach_dev_blocked(struct iommu_domain *domain,
895898
struct apple_dart_stream_map *stream_map;
896899
int i;
897900

901+
if (cfg->locked)
902+
return -EINVAL;
903+
898904
for_each_stream_map(i, cfg, stream_map)
899905
WARN_ON(pm_runtime_get_sync(stream_map->dart->dev) < 0);
900906

0 commit comments

Comments
 (0)