iommu/exynos: Add support for runtime_pm
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 19 May 2015 13:20:34 +0000 (15:20 +0200)
committerJoerg Roedel <jroedel@suse.de>
Fri, 29 May 2015 08:49:51 +0000 (10:49 +0200)
This patch fixes support for runtime power management for SYSMMU
controllers, so they are enabled when master device is attached.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/exynos-iommu.c

index b7f679c4659ccbafedb68e9a9bef67f4b757d7de..c658268478199e6a66dc61a869e9f3cff3ec8f6d 100644 (file)
@@ -715,6 +715,7 @@ static int exynos_iommu_attach_device(struct iommu_domain *iommu_domain,
                return -ENODEV;
 
        list_for_each_entry(data, &owner->controllers, owner_node) {
+               pm_runtime_get_sync(data->sysmmu);
                ret = __sysmmu_enable(data, pagetable, domain);
                if (ret >= 0) {
                        data->master = dev;
@@ -756,6 +757,7 @@ static void exynos_iommu_detach_device(struct iommu_domain *iommu_domain,
                                data->master = NULL;
                                list_del_init(&data->domain_node);
                        }
+                       pm_runtime_put(data->sysmmu);
                        found = true;
                }
        }