From patchwork Thu Jun 2 14:39:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9150503 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 95CCA6074E for ; Thu, 2 Jun 2016 14:39:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87AC328047 for ; Thu, 2 Jun 2016 14:39:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C98C28304; Thu, 2 Jun 2016 14:39: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=-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 334B728047 for ; Thu, 2 Jun 2016 14:39:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 550D86E0E4; Thu, 2 Jun 2016 14:39:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id E58FF6EBF1 for ; Thu, 2 Jun 2016 14:39:25 +0000 (UTC) Received: by mail-qk0-x242.google.com with SMTP id i187so142009qkd.1 for ; Thu, 02 Jun 2016 07:39:25 -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=KXVB7SS8H9JHoULzEpERY5wqMZqUBq3Gr4+BLNwPRNg=; b=tlWdRHZb/LV5o1jKT0g+i7EXVVxzlbDaBObfTAAgylEpkyERWPJQNUrpOmYWiA2cxS BOOUzRc2l0d+u88bRkQbG0zq549CEMYUgyqg14M9GOSduuEsjRkJngaaUenxiFXF2nSh phQPqH1ZFEqNbfLVoLm10HAzLwXISRMasCIuWDYbY0omlUpxNwTcykg76im/y1MTG9xF +9HzFrELtenYC8fmldh3zZJqSDx3H+4SM4z1e+W0oWrhrzJWRf5elEaVH+f8SpZ0PIAz SRwsQcdFos/fnkxg34GLlxmEthqt/e46+ehyYgLGpW6sCvbLtT6PuPKlQdVGa3SUAbAz MgUA== 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=KXVB7SS8H9JHoULzEpERY5wqMZqUBq3Gr4+BLNwPRNg=; b=HqDSdFcMjhvbg7zu8IVvvIqAAIMxUAhamv7KPK8bpgtRe93aM/4YjO0BaEyvtXi4+X aSxOKaiNtwtNKQO9yF3WgZ1CYWdcWREnw5WdHy/7eNRFeDoPSuS7/N+EFK14yNR/60fA k3fwYgEuLOD9wwF9Wj4mic3DBytXpQflUq8/pIL57iGaSgRvjoyT09HhYipiAUBiINAx Bhl8s+38ZUeQurdxM4AMAQyjZSeVV/kp5icpJcXCvQlwDA3O7GhhuhOaHMpO9V7hMoin wprvKbCiJPwXt/wDTW5905E88I2e7fFPKxIkbRnMWhFnNil3H0LUPAiTQuaGLMGvOjfm jjsg== X-Gm-Message-State: ALyK8tIQSrGqeKieubRcBj/4hMtRw2F5LBifOO1CDNISeJYdrWiTQqMNLO1Lc14kBpEy0A== X-Received: by 10.55.203.73 with SMTP id d70mr29560307qkj.116.1464878364553; Thu, 02 Jun 2016 07:39:24 -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.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Jun 2016 07:39:24 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 09/13] drm/amdgpu: fix sdma3 ucode mem leak Date: Thu, 2 Jun 2016 10:39:09 -0400 Message-Id: <1464878353-16836-10-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/sdma_v3_0.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c index 33605d4..532ea88 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c @@ -236,6 +236,15 @@ static void sdma_v3_0_init_golden_registers(struct amdgpu_device *adev) } } +static void sdma_v3_0_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_v3_0_init_microcode - load ucode images from disk * @@ -1256,6 +1265,7 @@ static int sdma_v3_0_sw_fini(void *handle) for (i = 0; i < adev->sdma.num_instances; i++) amdgpu_ring_fini(&adev->sdma.instance[i].ring); + sdma_v3_0_free_microcode(adev); return 0; }