Skip to content

Commit f67ef07

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 746bc9b commit f67ef07

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
@@ -885,9 +885,9 @@ static struct iommu_device *apple_dart_probe_device(struct device *dev)
885885
return ERR_PTR(-ENODEV);
886886

887887
for_each_stream_map(i, cfg, stream_map)
888-
device_link_add(
889-
dev, stream_map->dart->dev,
890-
DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_SUPPLIER);
888+
device_link_add(dev, stream_map->dart->dev,
889+
DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_SUPPLIER |
890+
DL_FLAG_RPM_ACTIVE);
891891

892892
return &cfg->stream_maps[0].dart->iommu;
893893
}

0 commit comments

Comments
 (0)