From patchwork Tue Sep 29 11:01:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 263296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53E5CC4727C for ; Tue, 29 Sep 2020 11:36:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CBCE23ABA for ; Tue, 29 Sep 2020 11:36:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379397; bh=Fos8BaE3bYuVzPOI84cI9gq+tooOKMU1WwPwuUcClUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=r7EkI5//UH9AoC2AjyVNBPEv2AaENG5rOFmT7Jz+G3nx1WtXs59W1KcZHGF03Chwn e0A+OA4zxqK8X5u04IpHD+v4YOc9fzhT2J2WUAuVD6AgMFDzKA4zJFwudiEFbwXQBw LxO48dhFdtuBXMR5Dk6uXt1Ke2WE19cgXADyy870= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728241AbgI2Lgg (ORCPT ); Tue, 29 Sep 2020 07:36:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:49220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728673AbgI2LgJ (ORCPT ); Tue, 29 Sep 2020 07:36:09 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF37D23D9C; Tue, 29 Sep 2020 11:30:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379059; bh=Fos8BaE3bYuVzPOI84cI9gq+tooOKMU1WwPwuUcClUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JzTcw9NT787aKCop7CMG22gqHb6y/LyA67jcc/qsHdE9fcmjzHVczaFyRdNvLKsCN Xj3WlKNIS8MaGWwl/4elOjfHLoyyCgP4Z/p699iHBCJp2OvgONLK5lvMbam9fGzI6N 2kphv25kaZL2gzOZOCZsOeM7VGe2MhoW01lZA/UA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Kuehling , Dennis Li , Alex Deucher , Sasha Levin Subject: [PATCH 4.19 212/245] drm/amdkfd: fix a memory leak issue Date: Tue, 29 Sep 2020 13:01:03 +0200 Message-Id: <20200929105957.289993913@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105946.978650816@linuxfoundation.org> References: <20200929105946.978650816@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dennis Li [ Upstream commit 087d764159996ae378b08c0fdd557537adfd6899 ] In the resume stage of GPU recovery, start_cpsch will call pm_init which set pm->allocated as false, cause the next pm_release_ib has no chance to release ib memory. Add pm_release_ib in stop_cpsch which will be called in the suspend stage of GPU recovery. Reviewed-by: Felix Kuehling Signed-off-by: Dennis Li Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 189212cb35475..bff39f561264e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -1101,6 +1101,8 @@ static int stop_cpsch(struct device_queue_manager *dqm) unmap_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES, 0); dqm_unlock(dqm); + pm_release_ib(&dqm->packets); + kfd_gtt_sa_free(dqm->dev, dqm->fence_mem); pm_uninit(&dqm->packets);