From: Andrzej Hajda Subject: [PATCH v2 10/17] drm/exynos/ipp: stop hardware before freeing memory Date: Thu, 28 Aug 2014 11:07:34 +0200 Message-ID: <1409216861-12452-11-git-send-email-a.hajda@samsung.com> References: <1409216861-12452-1-git-send-email-a.hajda@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-reply-to: <1409216861-12452-1-git-send-email-a.hajda@samsung.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Inki Dae Cc: "moderated list:ARM/S5P EXYNOS AR..." , Seung-Woo Kim , open list , dri-devel@lists.freedesktop.org, Andrzej Hajda , Kyungmin Park , Marek Szyprowski List-Id: linux-samsung-soc@vger.kernel.org Memory shouldn't be freed when hardware is still running. Signed-off-by: Andrzej Hajda Reviewed-by: Joonyoung Shim --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index fff3509..341db52 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1282,12 +1282,15 @@ static int ipp_stop_property(struct drm_device *drm_dev, struct drm_exynos_ipp_cmd_node *c_node) { struct drm_exynos_ipp_property *property = &c_node->property; - int ret = 0, i; + int i; DRM_DEBUG_KMS("prop_id[%d]\n", property->prop_id); /* put event */ ipp_put_event(c_node, NULL); + /* stop operations */ + if (ippdrv->stop) + ippdrv->stop(ippdrv->dev, property->cmd); /* check command */ switch (property->cmd) { @@ -1303,16 +1306,10 @@ static int ipp_stop_property(struct drm_device *drm_dev, break; default: DRM_ERROR("invalid operations.\n"); - ret = -EINVAL; - goto err_clear; + return -EINVAL; } -err_clear: - /* stop operations */ - if (ippdrv->stop) - ippdrv->stop(ippdrv->dev, property->cmd); - - return ret; + return 0; } void ipp_sched_cmd(struct work_struct *work) -- 1.9.1