From patchwork Thu Jun 2 14:39:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9150505 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 4FE5F6074E for ; Thu, 2 Jun 2016 14:39:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41DC628047 for ; Thu, 2 Jun 2016 14:39:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36BEA28304; Thu, 2 Jun 2016 14:39:41 +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]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 143E628047 for ; Thu, 2 Jun 2016 14:39:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C62B26EBF7; Thu, 2 Jun 2016 14:39:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x243.google.com (mail-qk0-x243.google.com [IPv6:2607:f8b0:400d:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id B43F86EBF4 for ; Thu, 2 Jun 2016 14:39:24 +0000 (UTC) Received: by mail-qk0-x243.google.com with SMTP id l185so1317350qkc.2 for ; Thu, 02 Jun 2016 07:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BL4RKeygoji32vgkcrnDUrGRySGXVo+9CP+LAOvaF4g=; b=q0+g1qDyl/Oi5dCOHyBSH7l7jqzIpTj6bALNnBHrLS1Uqs9csj9sM79pB//yN6HUA5 T7XyoxmkwTkP/Ppefw8a9e40/UoKHTqTXiJ4MNraZJBr0OZGRs2oCFj6SGQGvYzZa7Nf 62FlglATKIh+VsLdb9/OEEQkTeaSpks1WCjd/Ko0rBgQy5NevPPiWL7Dt3glcYQIdOy2 XPjSIRd9m05Ls4hGn8jR/ENBz+1CZCl/8RHAmMrFy6clF3v5MhoytUkJnXqcos3naqGI gIBtioyaSVcBD+18EOqUBK9+2UajtJVpxIAjRIou6DEiW0/g/eHL/howxQWeVIzJaKKj qVOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BL4RKeygoji32vgkcrnDUrGRySGXVo+9CP+LAOvaF4g=; b=gTl7U620+3mERCRAnfGXCAQs77NdTineAhnfX5rfDMmN5MYMXeiVMmtFs675D88dnD Ynqlb+XVWrNXraYXPBqIj7BTpKvZrk4+jjXMTBFLzN75fSP49sLkhoBSOGRNTBk3EHxi KHMXd5ZMsyKx6kE2Ax2KtFDDuDmvOeovOr+Cez/CHcSbJAWN8Ryh8xFrmw0O7aVeqMDT 3/qEM04meeRE+NaNL6zrpewLZ96f9xAVpu3K261fyKeyAqp+Lhyb7aFFhIDjRlst7z4O 1rVD1KZx9BTkyfxJR6QltdPVViuyZFxDeciO2yhlpa90rWlTcTmFNgzy839Eu16XUpV4 uI0Q== X-Gm-Message-State: ALyK8tJgEptBxErR/hKj06N9hnllLVRgNtp7RGoz0Hohi+BNTUkeVDbsUI1JmxIpp4Hvmw== X-Received: by 10.55.40.155 with SMTP id o27mr31386402qko.165.1464878363279; Thu, 02 Jun 2016 07:39:23 -0700 (PDT) Received: from cm.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by smtp.gmail.com with ESMTPSA id 188sm220362qhf.44.2016.06.02.07.39.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Jun 2016 07:39:22 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 07/13] drm/amdgpu: fix gfx 7 ucode mem leak Date: Thu, 2 Jun 2016 10:39:07 -0400 Message-Id: <1464878353-16836-8-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464878353-16836-1-git-send-email-alexander.deucher@amd.com> References: <1464878353-16836-1-git-send-email-alexander.deucher@amd.com> MIME-Version: 1.0 Cc: Alex Deucher , Monk Liu 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: Monk Liu Signed-off-by: Monk Liu Reviewed-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c index 7f18a53..8c6ad1e 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c @@ -991,6 +991,22 @@ out: return err; } +static void gfx_v7_0_free_microcode(struct amdgpu_device *adev) +{ + release_firmware(adev->gfx.pfp_fw); + adev->gfx.pfp_fw = NULL; + release_firmware(adev->gfx.me_fw); + adev->gfx.me_fw = NULL; + release_firmware(adev->gfx.ce_fw); + adev->gfx.ce_fw = NULL; + release_firmware(adev->gfx.mec_fw); + adev->gfx.mec_fw = NULL; + release_firmware(adev->gfx.mec2_fw); + adev->gfx.mec2_fw = NULL; + release_firmware(adev->gfx.rlc_fw); + adev->gfx.rlc_fw = NULL; +} + /** * gfx_v7_0_tiling_mode_table_init - init the hw tiling table * @@ -4489,6 +4505,7 @@ static int gfx_v7_0_sw_fini(void *handle) gfx_v7_0_cp_compute_fini(adev); gfx_v7_0_rlc_fini(adev); gfx_v7_0_mec_fini(adev); + gfx_v7_0_free_microcode(adev); return 0; }