Commit 604459de authored by Sricharan R's avatar Sricharan R Committed by Julan Hsu
Browse files

BACKPORT: UPSTREAM: iommu/arm-smmu: Add pm_runtime/sleep ops

The smmu needs to be functional only when the respective
master's using it are active. The device_link feature
helps to track such functional dependencies, so that the
iommu gets powered when the master device enables itself
using pm_runtime. So by adapting the smmu driver for
runtime pm, above said dependency can be addressed.

This patch adds the pm runtime/sleep callbacks to the
driver and the corresponding bulk clock handling for all
the clocks needed by smmu.

Also, while we enable the runtime pm, add a pm sleep suspend
callback that pushes devices to low power state by turning
the clocks off in a system sleep.
Add corresponding clock enable path in resume callback as well.

This backport fixes the previously merged ff0fa3d2 ("FROMLIST:
iommu/arm-smmu: Add pm_runtime/sleep ops") to match the upstream result,
without having to revert a series of FROMLIST.

BUG=b:137202421
TEST=Run label_image in loop

(cherry picked from commit 96a299d2
 https://github.com/torvalds/linux.git

)

Signed-off-by: default avatarSricharan R <sricharan@codeaurora.org>
Signed-off-by: default avatarArchit Taneja <architt@codeaurora.org>
[Thor: Rework to get clocks from device tree]
Signed-off-by: default avatarThor Thayer <thor.thayer@linux.intel.com>
[vivek: rework for clock and pm ops]
Signed-off-by: default avatarVivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: default avatarTomasz Figa <tfiga@chromium.org>
Tested-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
Tested-by: default avatarThor Thayer <thor.thayer@linux.intel.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarAbhinav Asati <asatiabhi@codeaurora.org>
Change-Id: I7d9edebaf5638e832d59066ce51162cf3b57d06f
Signed-off-by: default avatarVamsi Singamsetty <vamssi@codeaurora.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1613945


Reviewed-by: default avatarJulan Hsu <julanhsu@google.com>
Tested-by: default avatarJulan Hsu <julanhsu@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
parent fb2f840c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment