Skip to content

Commit b91a82b

Browse files
povikjannau
authored andcommitted
iommu: apple-dart: Link to consumers with blanket RPM_ACTIVE
Without the RPM_ACTIVE flag, runtime PM core only seems to consider the link insofar as it prevents the DART from suspending in case of consumers *considered active by runtime PM*. Other devices, like those on which runtime PM has yet to be enabled, or which lack any runtime PM support, are not considered in preventing the DART from suspending. DART going through suspend/resume cycle with active consumers can break the consumers' operation by the DART being reset in its resume path, among other things. Add RPM_ACTIVE flag to the link to have the consumer in the link prevent the DART from being suspended, unless the consumer itself is runtime PM suspended. This supersedes an earlier PCIe-only workaround. (TODO: Does this mean devices without bound drivers will keep their DARTs up indefinitely? This depends on the timing of the iommu probe_device/release_device calls. Investigate.) Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
1 parent a3d4cd5 commit b91a82b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/iommu/apple-dart.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,9 +737,9 @@ static struct iommu_device *apple_dart_probe_device(struct device *dev)
737737
return ERR_PTR(-ENODEV);
738738

739739
for_each_stream_map(i, cfg, stream_map)
740-
device_link_add(
741-
dev, stream_map->dart->dev,
742-
DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_SUPPLIER);
740+
device_link_add(dev, stream_map->dart->dev,
741+
DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_SUPPLIER |
742+
DL_FLAG_RPM_ACTIVE);
743743

744744
return &cfg->stream_maps[0].dart->iommu;
745745
}

0 commit comments

Comments
 (0)