From patchwork Sat Jan 28 19:49:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 9543447 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 BC5456046A for ; Sat, 28 Jan 2017 19:49:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE77428178 for ; Sat, 28 Jan 2017 19:49:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A375E28338; Sat, 28 Jan 2017 19:49:43 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7348128178 for ; Sat, 28 Jan 2017 19:49:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFEF96E0A5; Sat, 28 Jan 2017 19:49:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 07D556E09E; Sat, 28 Jan 2017 19:49:37 +0000 (UTC) Received: by mail-lf0-x244.google.com with SMTP id x1so28545995lff.0; Sat, 28 Jan 2017 11:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X2kPXW8AVOuexz8kKCCaiOWvnOIgWOCpaxfT/XMuopY=; b=OxFVcptx+9mtKO4rGuFiQvFlK4k8JaXd/dPxJGp1SnsmEngs4eSoGCBIjrysz0WllV BUQox7s/McDRN/GS/xUhkxR0RURTxOC0eYJDpXkg5FhQ29f9cykTeQqgMDEsNGs8I7io MHva1K7xna6a1OOXQ85qJ5ndtyeyb5+DFW/bTEuY2jVGLFzQv4cH4TTbnXrHgUxxSfBx 9RiDzmrz3ai09spRR+AAxmJnJVhf46CnIw/or8Vx1+Vey77HMsq/swjl870EcJ+/T0+V lgmfKDFlXIyw0MNxk3KYYS9WTw1sHLP5YRPvQrT+2dUFfAR7XPJwnoJD8BwAMOUySmN+ QQqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X2kPXW8AVOuexz8kKCCaiOWvnOIgWOCpaxfT/XMuopY=; b=c2PDJ3PZiDQb5sEl6veftnqkm/my+onopvTjyvYzrsaPia9gnoprk6HBPfGDhhPOXi 8b6gn67++/irQFBDjrM1AV19wRS3GnOkMT+7tlPXhjhD9jmqPcNB/yDijW3UEOjgIl4c lkdQsB+2xYICN9B4sAhOfQMNrjarAX7faKuGOl/8LXK/BvlJkG7CKJdcAMg0Hu1bRYnA V4NM/Qw6PW7W6CKlVU65hG6OpcqfbhCEWW2f6eMw1nvbYjFbm1WtlNx0K5xu3oJIkLzu mZTsKDW8q4ZwNHczuQulxeKToaoG4UGPfWC9ef0ij/PqVE7pOUo0UwK2YzO9D5Qn1Vfl XvUQ== X-Gm-Message-State: AIkVDXIcrJFG7XuF4JMxSgdYTjYi8LKiXtJJYbw0NOTduaORA6Y4QANT+X0DqunNR+2+4Q== X-Received: by 10.25.16.193 with SMTP id 62mr4242954lfq.75.1485632975311; Sat, 28 Jan 2017 11:49:35 -0800 (PST) Received: from localhost.localdomain ([5.20.238.37]) by smtp.gmail.com with ESMTPSA id e23sm2334912lji.29.2017.01.28.11.49.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Jan 2017 11:49:34 -0800 (PST) From: Grazvydas Ignotas To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 1/3] amdgpu: Free/uninit vamgr_32 in theoretically correct order Date: Sat, 28 Jan 2017 21:49:30 +0200 Message-Id: <1485632972-4790-2-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485632972-4790-1-git-send-email-notasas@gmail.com> References: <1485632972-4790-1-git-send-email-notasas@gmail.com> MIME-Version: 1.0 Cc: amd-gfx@lists.freedesktop.org, Alex Xie X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Alex Xie vamgr_32 is a region inside general VAM range. It is better to free and deinitialize it before general VAM range. Signed-off-by: Alex Xie Reviewed-by: Christian König --- amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c index f4ede03..cad7133 100644 --- a/amdgpu/amdgpu_device.c +++ b/amdgpu/amdgpu_device.c @@ -131,10 +131,10 @@ static int amdgpu_get_auth(int fd, int *auth) static void amdgpu_device_free_internal(amdgpu_device_handle dev) { - amdgpu_vamgr_deinit(dev->vamgr); - free(dev->vamgr); amdgpu_vamgr_deinit(dev->vamgr_32); free(dev->vamgr_32); + amdgpu_vamgr_deinit(dev->vamgr); + free(dev->vamgr); util_hash_table_destroy(dev->bo_flink_names); util_hash_table_destroy(dev->bo_handles); pthread_mutex_destroy(&dev->bo_table_mutex);