From patchwork Tue Feb 7 08:37:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yao mark X-Patchwork-Id: 9559489 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BFE3B60236 for ; Tue, 7 Feb 2017 08:38:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEBE428178 for ; Tue, 7 Feb 2017 08:38:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A33962818E; Tue, 7 Feb 2017 08:38:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5254F28178 for ; Tue, 7 Feb 2017 08:38:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cb1IK-0007rh-6L; Tue, 07 Feb 2017 08:38:36 +0000 Received: from regular1.263xmail.com ([211.150.99.139]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cb1IF-0007mr-Ce; Tue, 07 Feb 2017 08:38:34 +0000 Received: from mark.yao?rock-chips.com (unknown [192.168.167.229]) by regular1.263xmail.com (Postfix) with ESMTP id A63AF5795; Tue, 7 Feb 2017 16:38:05 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from yaozq-pc.lan (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 855DD3A3; Tue, 7 Feb 2017 16:38:05 +0800 (CST) X-RL-SENDER: mark.yao@rock-chips.com X-FST-TO: airlied@linux.ie X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: mark.yao@rock-chips.com X-UNIQUE-TAG: <263505584ba8ad0325d2253c9378696d> X-ATTACHMENT-NUM: 0 X-SENDER: yzq@rock-chips.com X-DNS-TYPE: 0 Received: from yaozq-pc.lan (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 12392EFPU9D; Tue, 07 Feb 2017 16:38:06 +0800 (CST) From: Mark Yao To: David Airlie , Heiko Stuebner , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/7] drm/rockchip: Fix the call to drm_gem_put_pages() Date: Tue, 7 Feb 2017 16:37:50 +0800 Message-Id: <1486456670-18974-1-git-send-email-mark.yao@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486456542-18675-1-git-send-email-mark.yao> References: <1486456542-18675-1-git-send-email-mark.yao> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170207_003832_820043_B0CC01D1 X-CRM114-Status: UNSURE ( 6.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Yao , Tomasz Figa MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tomasz Figa When freeing the buffer we don't have any means of determining if the buffer was read or written, so we must assume both and pass true for both arguments of drm_gem_put_pages(). Let's fix the code which currently passes false. TEST=while true; do backlight_dbus_tool --set --percent=0 && sleep 8 && backlight_dbus_tool --set --percent=100 && sleep 3 ; done Signed-off-by: Tomasz Figa Signed-off-by: Mark Yao Reviewed-on: https://chromium-review.googlesource.com/382934 Reviewed-by: Daniel Kurtz --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index cc48673..1daa531 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -119,7 +119,7 @@ static void rockchip_gem_put_pages(struct rockchip_gem_object *rk_obj) { sg_free_table(rk_obj->sgt); kfree(rk_obj->sgt); - drm_gem_put_pages(&rk_obj->base, rk_obj->pages, false, false); + drm_gem_put_pages(&rk_obj->base, rk_obj->pages, true, true); } static int rockchip_gem_alloc_iommu(struct rockchip_gem_object *rk_obj,