From patchwork Fri Jun 3 22:54:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9154217 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 ED03E6082E for ; Fri, 3 Jun 2016 22:54:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C193A28340 for ; Fri, 3 Jun 2016 22:54:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B53232833C; Fri, 3 Jun 2016 22:54:53 +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=-3.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, 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 7A1CF2833C for ; Fri, 3 Jun 2016 22:54:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9821F6E1C9; Fri, 3 Jun 2016 22:54:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 534256E1D5 for ; Fri, 3 Jun 2016 22:54:45 +0000 (UTC) Received: by mail-io0-x242.google.com with SMTP id f128so1425688iof.3 for ; Fri, 03 Jun 2016 15:54:45 -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; bh=oB2h/M9vV86L+JW2nqLvIH7J17O7nnLIQzTI8Jm8IDs=; b=ZazUizOEMP4EcPub+IzSfWUa2zF+iIQ4rSdK0vx7/K4Ef/47O4nKgIWDpOoph97HFf wRqKUrkn08RI3qzMX81Z8a7frArKS0Y2XcvS3VglonIoTjwxAt5Mx6EWg/NGRMHPtOI5 3E98Q+t3RC4boLfou/8zD3AJCiUFCA1Ekg+o5bRm6KUtx1WGdnqYCuaCaIsIxzpyVg+j oK2r5Ja+Rr1LIoEq0yIUGFdW1sl24gAcE6vesYKNKobitcd5olEiEpdFe+ZzsSTqJ2Lt ygabFSP8RP6t3nJRGl7Rry/wh3LAZYBRnxQO3alf5oC1dV/DfjMGrhTozCqoR4vhHSWD tDtA== 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; bh=oB2h/M9vV86L+JW2nqLvIH7J17O7nnLIQzTI8Jm8IDs=; b=BQUSzT7Jd3RzlibhmpVASy85yE9FGEmr3nnWDT3wfGyJEOtkNk0GDqArOb29yXX0UN dDt/mOBuS1wR7ufQSeNLX5igzfLlNvgePZuc4gU9ve7A8tdB8az7IPqPKpk0ed7GUHt+ oa9POWKh+wkkHqaaY0iVaHdV8f5cdzP1W4X56XTwfGL8asCx+ot/yMk+Sb2in23nV5KC K6KzQNfTMlcH5LJsDWgBba8xMRWDu8tpUsM/rtZC7FXwffrWWYT7YVeneBi8tORX8o6c fmbWELArByXnnOVHBgcY1aSfZhQbhZSZN9H9DW1b4HyVa0H0uCfLlf79oLHTdA7Pqu6x vefA== X-Gm-Message-State: ALyK8tKs/3Sn9a6X69ZgIWmUcSwdAv5+lBC1zO+g0UBBDJuBNcYvGHZtoSWbAUF2gknPWQ== X-Received: by 10.107.58.213 with SMTP id h204mr9071786ioa.172.1464994484355; Fri, 03 Jun 2016 15:54:44 -0700 (PDT) Received: from cm.amd.com ([165.204.55.251]) by smtp.gmail.com with ESMTPSA id l123sm804543ita.1.2016.06.03.15.54.43 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 03 Jun 2016 15:54:43 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/amdgpu: fix smu ucode memleak (v2) Date: Fri, 3 Jun 2016 18:54:36 -0400 Message-Id: <1464994476-27756-2-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464994476-27756-1-git-send-email-alexander.deucher@amd.com> References: <1464994476-27756-1-git-send-email-alexander.deucher@amd.com> 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Monk Liu Properly release the smu ucode in powerplay. v2: agd: add polaris as well Signed-off-by: Monk Liu Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 2 ++ drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 1 + drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c index 0ac8642..8e52a2e 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c @@ -1014,6 +1014,8 @@ static int fiji_smu_fini(struct pp_smumgr *smumgr) kfree(smumgr->backend); smumgr->backend = NULL; } + + cgs_rel_firmware(smumgr->device, CGS_UCODE_ID_SMU); return 0; } diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c index de618ea..043b6ac 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c @@ -469,6 +469,7 @@ int polaris10_smu_fini(struct pp_smumgr *smumgr) kfree(smumgr->backend); smumgr->backend = NULL; } + cgs_rel_firmware(smumgr->device, CGS_UCODE_ID_SMU); return 0; } diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c index 70d3ecf..b22722e 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c @@ -337,6 +337,8 @@ static int tonga_smu_fini(struct pp_smumgr *smumgr) kfree(smumgr->backend); smumgr->backend = NULL; } + + cgs_rel_firmware(smumgr->device, CGS_UCODE_ID_SMU); return 0; }