Message ID | 20180727070224.23966-1-vivek.gautam@codeaurora.org (mailing list archive) |
---|---|
Headers | show |
Series | iommu/arm-smmu: Add runtime pm/sleep support | expand |
Hi Robin, On Fri, Jul 27, 2018 at 4:02 PM Vivek Gautam <vivek.gautam@codeaurora.org> wrote: > > This series provides the support for turning on the arm-smmu's > clocks/power domains using runtime pm. This is done using > device links between smmu and client devices. The device link > framework keeps the two devices in correct order for power-cycling > across runtime PM or across system-wide PM. > > With addition of a new device link flag DL_FLAG_AUTOREMOVE_SUPPLIER [8] > (available in linux-next of Rafael's linux-pm tree [9]), the device links > created between arm-smmu and its clients will be automatically purged > when arm-smmu driver unbinds from its device. > > As not all implementations support clock/power gating, we are checking > for a valid 'smmu->dev's pm_domain' to conditionally enable the runtime > power management for such smmu implementations that can support it. > Otherwise, the clocks are turned to be always on in .probe until .remove. > With conditional runtime pm now, we avoid touching dev->power.lock > in fastpaths for smmu implementations that don't need to do anything > useful with pm_runtime. > This lets us to use the much-argued pm_runtime_get_sync/put_sync() > calls in map/unmap callbacks so that the clients do not have to > worry about handling any of the arm-smmu's power. > > This series also adds support for Qcom's arm-smmu-v2 variant that > has different clocks and power requirements. > > Previous version of this patch series is @ [2]. > > Tested this series on msm8996, and sdm845 after pulling in Rafael's linux-pm > linux-next[9] and Joerg's iommu next[10] branches, and related changes for > device tree, etc. > > Hi Robin, Will, > I have addressed the comments for v13. If there's still a chance > can you please consider pulling this for v4.19. > Thanks. > > [v14] > * Moved arm_smmu_device_reset() from arm_smmu_pm_resume() to > arm_smmu_runtime_resume() so that the pm_resume callback calls > only runtime_resume to resume the device. > This should take care of restoring the state of smmu in systems > in which smmu lose register state on power-domain collapse. It's been a while since this series was posted and no more comments seem to be left anymore. Would you have some time to take a look again? Thanks. Best regards, Tomasz
On 27/07/18 08:02, Vivek Gautam wrote: > Sricharan R (3): > iommu/arm-smmu: Add pm_runtime/sleep ops > iommu/arm-smmu: Invoke pm_runtime during probe, add/remove device > iommu/arm-smmu: Add the device_link between masters and smmu > > Vivek Gautam (1): > iommu/arm-smmu: Add support for qcom,smmu-v2 variant > > .../devicetree/bindings/iommu/arm,smmu.txt | 42 +++++ > drivers/iommu/arm-smmu.c | 194 +++++++++++++++++++-- > 2 files changed, 225 insertions(+), 11 deletions(-) MSM8896 audio and display on top of mainline totally depends on this patches, I have been testing various version this series on DB820c for both display and audio. Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> --srini
On 20/08/18 10:31, Tomasz Figa wrote: > Hi Robin, > > On Fri, Jul 27, 2018 at 4:02 PM Vivek Gautam > <vivek.gautam@codeaurora.org> wrote: >> >> This series provides the support for turning on the arm-smmu's >> clocks/power domains using runtime pm. This is done using >> device links between smmu and client devices. The device link >> framework keeps the two devices in correct order for power-cycling >> across runtime PM or across system-wide PM. >> >> With addition of a new device link flag DL_FLAG_AUTOREMOVE_SUPPLIER [8] >> (available in linux-next of Rafael's linux-pm tree [9]), the device links >> created between arm-smmu and its clients will be automatically purged >> when arm-smmu driver unbinds from its device. >> >> As not all implementations support clock/power gating, we are checking >> for a valid 'smmu->dev's pm_domain' to conditionally enable the runtime >> power management for such smmu implementations that can support it. >> Otherwise, the clocks are turned to be always on in .probe until .remove. >> With conditional runtime pm now, we avoid touching dev->power.lock >> in fastpaths for smmu implementations that don't need to do anything >> useful with pm_runtime. >> This lets us to use the much-argued pm_runtime_get_sync/put_sync() >> calls in map/unmap callbacks so that the clients do not have to >> worry about handling any of the arm-smmu's power. >> >> This series also adds support for Qcom's arm-smmu-v2 variant that >> has different clocks and power requirements. >> >> Previous version of this patch series is @ [2]. >> >> Tested this series on msm8996, and sdm845 after pulling in Rafael's linux-pm >> linux-next[9] and Joerg's iommu next[10] branches, and related changes for >> device tree, etc. >> >> Hi Robin, Will, >> I have addressed the comments for v13. If there's still a chance >> can you please consider pulling this for v4.19. >> Thanks. >> >> [v14] >> * Moved arm_smmu_device_reset() from arm_smmu_pm_resume() to >> arm_smmu_runtime_resume() so that the pm_resume callback calls >> only runtime_resume to resume the device. >> This should take care of restoring the state of smmu in systems >> in which smmu lose register state on power-domain collapse. > > It's been a while since this series was posted and no more comments > seem to be left anymore. Would you have some time to take a look > again? Thanks. Other than the binding issue which turned up in the meantime, I *think* this is looking OK now in terms of being sufficiently safe for all the various awkward retention vs. state-loss combinations. There's almost certainly still ways to improve it in future, but what we have now seems like a reasonable starting point that isn't impossibly complicated to reason about. Robin.