From patchwork Fri Aug 22 07:52:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 4761851 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ACB829F383 for ; Fri, 22 Aug 2014 07:55:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC65020108 for ; Fri, 22 Aug 2014 07:55:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 14FDC200FF for ; Fri, 22 Aug 2014 07:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756093AbaHVHxr (ORCPT ); Fri, 22 Aug 2014 03:53:47 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:34675 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756062AbaHVHxp (ORCPT ); Fri, 22 Aug 2014 03:53:45 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NAP0006X7E9CB40@mailout4.w1.samsung.com>; Fri, 22 Aug 2014 08:56:33 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-54-53f6f7072f09 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 99.5F.25543.707F6F35; Fri, 22 Aug 2014 08:53:43 +0100 (BST) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NAP003ZW77U1T20@eusync3.samsung.com>; Fri, 22 Aug 2014 08:53:43 +0100 (BST) From: Andrzej Hajda To: Inki Dae Cc: Andrzej Hajda , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org (open list), linux-samsung-soc@vger.kernel.org (moderated list:ARM/S5P EXYNOS AR...) Subject: [PATCH 10/15] drm/exynos/ipp: stop hardware before freeing memory Date: Fri, 22 Aug 2014 09:52:21 +0200 Message-id: <1408693946-15456-11-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1408693946-15456-1-git-send-email-a.hajda@samsung.com> References: <1408693946-15456-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOJMWRmVeSWpSXmKPExsVy+t/xq7rs378FG7xbxmtxa905VosrX9+z WUy6P4HF4sW9iywWZ5vesFtc3jWHzWLG+X1MFmuP3GW3mDH5JZsDp8f97uNMHn1bVjF6fN4k F8AcxWWTkpqTWZZapG+XwJWxec8CxoLjXBW7bsxibWC8ydHFyMkhIWAi8en/ZiYIW0ziwr31 bF2MXBxCAksZJa79bGGEcPqYJG68+QlWxSagKfF38002EFtEQFli1b52dpAiZoGPTBJXlr5h BkkIC3hJnLhzkBHEZhFQlXjwsxMszivgIvF34xFGiHVyEiePTWYFsTmB4hcOTgOrERJwlui6 PY1pAiPvAkaGVYyiqaXJBcVJ6bmGesWJucWleel6yfm5mxghgfVlB+PiY1aHGAU4GJV4eBN/ fw0WYk0sK67MPcQowcGsJMK7ad63YCHelMTKqtSi/Pii0pzU4kOMTBycUg2MC5l31Qh+l3Vd tLEg4PfGgGNMC7g3+67JuN5hv3B9YbPQ8oXzJOr7PE+5Lzxn65Tfz6TEO4nl/PJZ7jtDv7+Y VvQ018PqkHBPs3jF/KZN/cu/T5T5PPeJbc2tvMhyl7iXGw+q6H48d2filmWFCqdKhFWs+Ms5 49heRqf3bbe8qcqQy+72clW+EktxRqKhFnNRcSIAbtekPAoCAAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Memory shouldn't be freed when hardware is still running. Signed-off-by: Andrzej Hajda --- 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 c72d8d1..6de75aa 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1283,12 +1283,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) { @@ -1304,16 +1307,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)