From patchwork Thu Jun 2 14:39:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9150537 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 9E2806074E for ; Thu, 2 Jun 2016 14:39:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FF2F28047 for ; Thu, 2 Jun 2016 14:39:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84E69282ED; Thu, 2 Jun 2016 14:39:58 +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 5283C28305 for ; Thu, 2 Jun 2016 14:39:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E8DEE6EBFA; Thu, 2 Jun 2016 14:39:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF16C6E0E4 for ; Thu, 2 Jun 2016 14:39:26 +0000 (UTC) Received: by mail-qk0-x241.google.com with SMTP id q184so5271890qkf.0 for ; Thu, 02 Jun 2016 07:39:26 -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=ZFjvfBDyE8UYhEnLlhLMe1VTcZw71eogxzgZjrUgL0g=; b=EkfrNOYMhQngdhkej3SJH2Z88tZ1vq8RqX7Wudior26FAGtyIbNnAnXQOp1T5UInBq Bfths8Xb/oldBoN2oXKEIYW1QtNiL7VgxBOK7LqRujzUFvi+j7f3RK3bkKxZAA5XC/3g 0Upjs5y8TVgyYCYpGllpp5Sb8XmyBMctt8S3uI/1izkXnxazariaK8fq+uQxzk4jTSPz 96Pm6iG/RGV8YugYif2YUTst6JiURCKIVAo3nq/7WMA1Brd33QDoCsGPb906ggsEXNGY qqh5j6czvgM9chu0luUIsvDgt2E1ExyM0NyMUHkpxBP6gGXI8sY5ojzPnZhGOq8o7Zvg b/Qg== 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=ZFjvfBDyE8UYhEnLlhLMe1VTcZw71eogxzgZjrUgL0g=; b=At2g+g+FIdbp9RKImANGcI+42y4UlR7hHQEpG1FJsvhdOcYacm8NcfZhUQCCN9FK8A 5VaEDKdg9OIwIHrO9gfo0Bud9xrNtTU1hFkhtvbnjUUVO55ex7Iy+CFIdApKinByk8xP ggvaIH5yxxgLYL3uMH0XePLCV8oimFeGeUeCSH/W3EBd0H8CTKE2jFc+wfw/bkeDhIPv Ks010KTjIUevt7HlkhWFQtE3x/reXNGCf7zfhGY++MloRnWFoFSe2CAKku3EqCZwRLty AEEGT1g1I0FcT+rKia04tmjxFgwafT0iAH6wgQwzSJRIAS2glHpWIw8ytsr0x9MZnQb7 4mvw== X-Gm-Message-State: ALyK8tIHr9zjm1lGVIRIXn2OeA2zozGTg1fq55OFgruQJuPYidXw/mJ01xWSdW+Fj1zsjQ== X-Received: by 10.55.154.72 with SMTP id c69mr1039218qke.47.1464878365681; Thu, 02 Jun 2016 07:39:25 -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.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Jun 2016 07:39:25 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 11/13] drm/amdgpu: fix cik sdma ucode memleak Date: Thu, 2 Jun 2016 10:39:11 -0400 Message-Id: <1464878353-16836-12-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/cik_sdma.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c index 0079916..9dc4e24 100644 --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c @@ -66,6 +66,16 @@ MODULE_FIRMWARE("radeon/mullins_sdma1.bin"); u32 amdgpu_cik_gpu_check_soft_reset(struct amdgpu_device *adev); + +static void cik_sdma_free_microcode(struct amdgpu_device *adev) +{ + int i; + for (i = 0; i < adev->sdma.num_instances; i++) { + release_firmware(adev->sdma.instance[i].fw); + adev->sdma.instance[i].fw = NULL; + } +} + /* * sDMA - System DMA * Starting with CIK, the GPU has new asynchronous @@ -1005,6 +1015,7 @@ static int cik_sdma_sw_fini(void *handle) for (i = 0; i < adev->sdma.num_instances; i++) amdgpu_ring_fini(&adev->sdma.instance[i].ring); + cik_sdma_free_microcode(adev); return 0; }