iommu/omap: Adapt to runtime pm
authorOmar Ramirez Luna <omar.luna@linaro.org>
Tue, 20 Nov 2012 01:05:51 +0000 (19:05 -0600)
committerJoerg Roedel <joro@8bytes.org>
Mon, 3 Dec 2012 17:48:23 +0000 (18:48 +0100)
commitebf7cda0f92effd8169b831fae81e9437dce1fef
tree4c506bb094eee7c2128c7c9b17a6b0480a99a0dd
parent72b15b6ae97796c5fac687addde5dbfab872cf94
iommu/omap: Adapt to runtime pm

Use runtime PM functionality interfaced with hwmod enable/idle
functions, to replace direct clock operations and sysconfig
handling.

Due to reset sequence, pm_runtime_[get|put]_sync must be used, to
avoid possible operations with the module under reset. Because of
this and given that the driver uses spin_locks to protect their
critical sections, we must use pm_runtime_irq_safe in order for the
runtime ops to be happy, otherwise might_sleep_if checks in runtime
framework will complain.

The remaining pm_runtime out of iommu_enable and iommu_disable
corresponds to paths that can be accessed through debugfs, some of
them doesn't work if the module is not enabled first, but in future
if the mmu is idled withouth freeing, these are needed to debug.

Signed-off-by: Omar Ramirez Luna <omar.luna@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
arch/arm/mach-omap2/omap-iommu.c
drivers/iommu/omap-iommu.c
drivers/iommu/omap-iommu.h
drivers/iommu/omap-iommu2.c
include/linux/platform_data/iommu-omap.h