Skip to content

Commit ef50e9a

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 5c33afc commit ef50e9a

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
@@ -865,6 +865,9 @@ static int apple_dart_attach_dev_identity(struct iommu_domain *domain,
865865
if (!cfg->supports_bypass)
866866
return -EINVAL;
867867

868+
if (cfg->locked)
869+
return -EINVAL;
870+
868871
for_each_stream_map(i, cfg, stream_map)
869872
WARN_ON(pm_runtime_get_sync(stream_map->dart->dev) < 0);
870873

@@ -892,6 +895,9 @@ static int apple_dart_attach_dev_blocked(struct iommu_domain *domain,
892895
struct apple_dart_stream_map *stream_map;
893896
int i;
894897

898+
if (cfg->locked)
899+
return -EINVAL;
900+
895901
for_each_stream_map(i, cfg, stream_map)
896902
WARN_ON(pm_runtime_get_sync(stream_map->dart->dev) < 0);
897903

0 commit comments

Comments
 (0)