Skip to content

Commit efeea5c

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 976123a commit efeea5c

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

749749
for_each_stream_map(i, cfg, stream_map)
750-
device_link_add(
751-
dev, stream_map->dart->dev,
752-
DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_SUPPLIER);
750+
device_link_add(dev, stream_map->dart->dev,
751+
DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_SUPPLIER |
752+
DL_FLAG_RPM_ACTIVE);
753753

754754
return &cfg->stream_maps[0].dart->iommu;
755755
}

0 commit comments

Comments
 (0)