Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3201894pxk; Mon, 21 Sep 2020 07:45:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfxaWFEYLW3nvWuXuF6wx7AxAwlPIgVZ9ushbQWMWJtKuVkthbe83Bh31/GmpiLSR/tCF3 X-Received: by 2002:a05:6402:17f6:: with SMTP id t22mr51652005edy.374.1600699542970; Mon, 21 Sep 2020 07:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600699542; cv=none; d=google.com; s=arc-20160816; b=wOhqqZaiudHfFrJK2k7rqvTrDbi22bclT3yVDbHjAQBXF4d+Ap0dXpauJVeIixjSV5 SrEAihMRwkx0xm/AVAj9UD8ymhE2hGohT34hPu+04I8sa/uZu3Edn8EP5nI7mxhpVMfz d+4G2jZlZc3g4/Fj+zX75v8X5ZYFbh7A3FvHwRtj2VFBiQqnBSxUb31UXHPtBoDdAxnS vnQgeH7oruqTw662+nH10sjhjrjbLmA80hTtzJh9DpCG5uWs57a2b1j8AXg+CAT2cc3f oMcBB2ZFwkEHCYsDjzvHUXnovmDmTckUA7EV6Uwjx9w7TG1u7Z8N+9nSRccqwxUPaA4f rkvw== 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=nnmakGZcOGICKjxzGYJHd0JTdovh5unvnvxsr3maMq8=; b=U4H3U/uy1WqQWjOzMspNn8amPZcjwrOXoeGQfNKuL+Ts6Svy+E7WfoJk/VY3IL6OtS K1iLKVKrRWBq0lEgPq+B3lHsaT7W0jhx8Nvkrjgc2VNYApTTn83Zyrjk1w1nEQ4zy2zQ T7znDyu1d0oGsoIbLU/3zQsKzWj0lybpAj/ORdJCgeYnied45Rd9F9zqgxGJef1has3H xXjm0XNV44SGjOu6RR/BdG6n/5D+rA7aE6uTNCy0MycZTpwD5otcKLKNPmG6xa2M8f7m r+Wki2h/CR/6fYfBBEgh2OgLu2VZktfGYbg5R0YwVAkvz4Vo/PwopNQEPiCeL5VoZlcQ rDKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0RjYQ4mI; 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 f23si7921112eja.564.2020.09.21.07.45.19; Mon, 21 Sep 2020 07:45:42 -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=0RjYQ4mI; 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 S1728196AbgIUOm4 (ORCPT + 99 others); Mon, 21 Sep 2020 10:42:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:49964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727807AbgIUOlK (ORCPT ); Mon, 21 Sep 2020 10:41:10 -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 0F75A23719; Mon, 21 Sep 2020 14:41:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600699268; bh=yXmewIWDXlBhmb3VzfAZZFKO+0DKCsEThF1ITQoq03s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0RjYQ4mIhlQQLk3BGUkYcUoVt7Tcu0GO/C1alPBHUbjLUZL0d49NSdfhi3MwjdJt7 O5L11Q5MbqLevGANWC9sRITM2xKOM0r8KsPGY6UrI3sftjMRvNOQogemN6lDF/ykbZ b6QbrV2DTY/tm4rPXMaOmiEt5+0wLMvylVSf6VrE= 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.4 11/15] drm/amdkfd: fix a memory leak issue Date: Mon, 21 Sep 2020 10:40:50 -0400 Message-Id: <20200921144054.2135602-11-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200921144054.2135602-1-sashal@kernel.org> References: <20200921144054.2135602-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 a2ed9c257cb0d..e9a2784400792 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -1075,6 +1075,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); -- 2.25.1