Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3202116pxk; Mon, 21 Sep 2020 07:46:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztElt9BzimbsjdQQoTez/uotKMizNZduD/e00/vburcDrWsfX7WE12SdZnehdSeO+dF+wv X-Received: by 2002:a17:906:1157:: with SMTP id i23mr44334676eja.440.1600699563874; Mon, 21 Sep 2020 07:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600699563; cv=none; d=google.com; s=arc-20160816; b=stW07ZuVUBnOETFpzsOV2B4cdSCYBj8UDx5CPyQpYgqMval+JvD51bE9Z7cvH9tSAQ zZFYY5twZ1TjepCw14U496a10mY8uoi8vgGgMYmbjEuqpKo4f4CA8RjZQOzRWVBdIftJ G1l1FswkpHO8cfLNfmJ5WI5SE/aGlLvxUcR2Z1pyi51ueA6HiN+BljLNI9agRgMZLkcp JsnwIJP/1AQr7zt9/jX/j8/FFmlnLZ0wPUfnnhs8dIkFtyD++IxzhjDVCJa6MUsLjm8Q RYa+NAE2VsIgnuqpZssgBLEoihjGWnbiDICowKOrJGFe8F00ctcqKzeuz86bYWOaCKeZ /gLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HDRMk0nutfdYZ85OEV0T+tjeZsw7PMBVbWyBWUcKStU=; b=aqIUMcDvgfHSQwb8eTBdQNJFajnNde6doCSin2rTwNbNS6nH1FOdiHCB8ByzIJ7mgm DqRjHxI17PuZeu64jgzePoJvFl7ahXx0jk5WrkD9Y9yjUNZr6yOcaF+0eBfvreSty4dR U5meTJ4G6+RtxBzD46FJP9X2QNRrL96DLf/Tqps6JCAKtud6J9W8Nm5JQWeoXQ4HcSwb OS+xPCvsDta7ZdbNUflEzt1xG3tfk8SXwdLt/Jg6T1LyBiEbsmzZ3QCK/xKADBUCENF7 CDunuAQ+Ekoq92vP+KcH0pk/Zh80te2HCAszZmctZ8qE3AFjn7GiEV4Mi9jp4Znj1aru AlXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Yl1IR0e6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si8536113ejj.443.2020.09.21.07.45.39; Mon, 21 Sep 2020 07:46:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Yl1IR0e6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728251AbgIUOnd (ORCPT + 99 others); Mon, 21 Sep 2020 10:43:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:49382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727865AbgIUOkn (ORCPT ); Mon, 21 Sep 2020 10:40:43 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 72A5A2220C; Mon, 21 Sep 2020 14:40:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600699243; bh=Uwvl3XHlFp5hd3kK7y73SL6v5jqXtR60oS68Drgk1ps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yl1IR0e6JE4S/abdnum9BCThziDI2Ijbgn4279lhaWmtnRi/JCjUQGDbOkTeZuef7 1Zrxy0sbamruE0tsmTdGLxvQzNXSc2I3g14xKKBn2o57Bh+AZ8IOfDPVbS09LfsaE3 6/QZzFMqAaBvBJH9+B45KERN5YkY/QqSwqvfNf2A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dennis Li , Felix Kuehling , Alex Deucher , Sasha Levin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.8 12/20] drm/amdkfd: fix a memory leak issue Date: Mon, 21 Sep 2020 10:40:19 -0400 Message-Id: <20200921144027.2135390-12-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200921144027.2135390-1-sashal@kernel.org> References: <20200921144027.2135390-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 e9c4867abeffb..00b042a15373a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -1177,6 +1177,8 @@ static int stop_cpsch(struct device_queue_manager *dqm) dqm->sched_running = false; dqm_unlock(dqm); + pm_release_ib(&dqm->packets); + kfd_gtt_sa_free(dqm->dev, dqm->fence_mem); pm_uninit(&dqm->packets, hanging); -- 2.25.1