]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
CHROMIUM: drm/exynos: Fix iommu cleanup paths.
authorStéphane Marchesin <marcheu@chromium.org>
Fri, 4 Jan 2013 00:22:50 +0000 (16:22 -0800)
committerChromeBot <chrome-bot@google.com>
Wed, 9 Jan 2013 00:56:48 +0000 (16:56 -0800)
The cleanup paths don't destroy the iommu mapping, so they linger around when
init fails.

BUG=none
TEST=compiles, still works on snow

Change-Id: Ieef610db22154d37d307f4a589bd0830ef3fb97c
Reviewed-on: https://gerrit.chromium.org/gerrit/40410
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/exynos/exynos_mixer.c

index be9a63831fc5a8cdc8c6dd5a26aa87bdb171230a..e78adabb7f5376f02fefb4612a5998f4d27dbad4 100644 (file)
@@ -337,6 +337,7 @@ static void iommu_deinit(struct platform_device *pdev)
 static int exynos_drm_platform_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
+       int ret;
 
        DRM_DEBUG_DRIVER("%s\n", __FILE__);
 
@@ -352,7 +353,13 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
        pm_runtime_enable(dev);
        pm_runtime_get_sync(dev);
 
-       return drm_platform_init(&exynos_drm_driver, pdev);
+       ret = drm_platform_init(&exynos_drm_driver, pdev);
+#ifdef CONFIG_EXYNOS_IOMMU
+       if (ret)
+               iommu_deinit(pdev);
+#endif
+
+       return ret;
 }
 
 static int __devexit exynos_drm_platform_remove(struct platform_device *pdev)
index ae29909e07e9d99bbe5082157c2b1e0c5f60349a..0d5a2f0a43b2b563c4deb0f2a9e5e3742970429d 100644 (file)
@@ -1128,6 +1128,12 @@ static int iommu_init(struct platform_device *pdev)
 
        return 0;
 }
+
+static void iommu_deinit(struct platform_device *pdev)
+{
+       s5p_destroy_iommu_mapping(&pdev->dev);
+       DRM_DEBUG("released the IOMMU mapping\n");
+}
 #endif
 
 static int __devinit mixer_resources_init_exynos(
@@ -1334,6 +1340,10 @@ static int mixer_remove(struct platform_device *pdev)
        mixer_resource_poweroff(mctx);
        mixer_resources_cleanup(dev, mctx);
 
+#ifdef CONFIG_EXYNOS_IOMMU
+       iommu_deinit(pdev);
+#endif
+
        kfree(mctx);
 
        return 0;