From a5b5f3bec2bdc9a61b8f8190a3b3c32c64f19525 Mon Sep 17 00:00:00 2001 From: Andrzej Hajda Date: Fri, 19 Jul 2013 07:39:53 -0300 Subject: [PATCH] [media] exynos4-is: Ensure the FIMC gate clock is disabled at driver remove() The patch fixes following warning: [ 9664.460000] WARNING: CPU: 0 PID: 2880 at drivers/clk/clk.c:695 __clk_unprepare+0x8c/0xa4() [ 9664.470000] Modules linked in: m5mols s5k5baf s5p_fimc(-) ipv6 s5p_csis v4l2_mem2mem videobuf2_dma_contig videobuf2_memops exynos4_is_common videobuf2_core [last unloaded: m5mols] [ 9664.485000] CPU: 0 PID: 2880 Comm: rmmod Tainted: G W 3.11.0-rc1-00070-ga94e22f-dirty #1558 [ 9664.495000] [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x14) [ 9664.505000] [] (show_stack+0x10/0x14) from [] (dump_stack+0x6c/0xac) [ 9664.510000] [] (dump_stack+0x6c/0xac) from [] (warn_slowpath_common+0x64/0x88) [ 9664.520000] [] (warn_slowpath_common+0x64/0x88) from [] (warn_slowpath_null+0x1c/0x24) [ 9664.530000] [] (warn_slowpath_null+0x1c/0x24) from [] (__clk_unprepare+0x8c/0xa4) [ 9664.540000] [] (__clk_unprepare+0x8c/0xa4) from [] (clk_unprepare+0x14/0x1c) [ 9664.550000] [] (clk_unprepare+0x14/0x1c) from [] (fimc_clk_put+0x3c/0x5c [s5p_fimc]) [ 9664.560000] [] (fimc_clk_put+0x3c/0x5c [s5p_fimc]) from [] (fimc_remove+0x5c/0x90 [s5p_fimc]) [ 9664.570000] [] (fimc_remove+0x5c/0x90 [s5p_fimc]) from [] (platform_drv_remove+0x18/0x1c) [ 9664.580000] [] (platform_drv_remove+0x18/0x1c) from [] (__device_release_driver+0x70/0xcc) [ 9664.590000] [] (__device_release_driver+0x70/0xcc) from [] (driver_detach+0xac/0xb0) [ 9664.595000] [] (driver_detach+0xac/0xb0) from [] (bus_remove_driver+0x7c/0xc0) [ 9664.605000] [] (bus_remove_driver+0x7c/0xc0) from [] (SyS_delete_module+0x11c/0x204) [ 9664.615000] [] (SyS_delete_module+0x11c/0x204) from [] (ret_fast_syscall+0x0/0x30) [ 9664.625000] ---[ end trace 662c092cce432c8d ]--- Signed-off-by: Andrzej Hajda Signed-off-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/exynos4-is/fimc-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c index 6489c5160ee8..3d66d88ea3a1 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.c +++ b/drivers/media/platform/exynos4-is/fimc-core.c @@ -1110,6 +1110,8 @@ static int fimc_remove(struct platform_device *pdev) struct fimc_dev *fimc = platform_get_drvdata(pdev); pm_runtime_disable(&pdev->dev); + if (!pm_runtime_status_suspended(&pdev->dev)) + clk_disable(fimc->clock[CLK_GATE]); pm_runtime_set_suspended(&pdev->dev); fimc_unregister_capture_subdev(fimc); -- 2.20.1