Skip to content

Commit 05d5010

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 6516270 commit 05d5010

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
@@ -862,6 +862,9 @@ static int apple_dart_attach_dev_identity(struct iommu_domain *domain,
862862
if (!cfg->supports_bypass)
863863
return -EINVAL;
864864

865+
if (cfg->locked)
866+
return -EINVAL;
867+
865868
for_each_stream_map(i, cfg, stream_map)
866869
WARN_ON(pm_runtime_get_sync(stream_map->dart->dev) < 0);
867870

@@ -889,6 +892,9 @@ static int apple_dart_attach_dev_blocked(struct iommu_domain *domain,
889892
struct apple_dart_stream_map *stream_map;
890893
int i;
891894

895+
if (cfg->locked)
896+
return -EINVAL;
897+
892898
for_each_stream_map(i, cfg, stream_map)
893899
WARN_ON(pm_runtime_get_sync(stream_map->dart->dev) < 0);
894900

0 commit comments

Comments
 (0)