From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Le Ma <le.ma@amd.com>, Hawking Zhang <Hawking.Zhang@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Sasha Levin <sashal@kernel.org>,
christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com,
daniel@ffwll.ch, Felix.Kuehling@amd.com, lijo.lazar@amd.com,
rajneesh.bhardwaj@amd.com, amd-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.5 13/15] drm/amdgpu: finalizing mem_partitions at the end of GMC v9 sw_fini
Date: Wed, 22 Nov 2023 10:33:15 -0500 [thread overview]
Message-ID: <20231122153340.852434-13-sashal@kernel.org> (raw)
In-Reply-To: <20231122153340.852434-1-sashal@kernel.org>
From: Le Ma <le.ma@amd.com>
[ Upstream commit bdb72185d310fc8049c7ea95221d640e9e7165e5 ]
The valid num_mem_partitions is required during ttm pool fini,
thus move the cleanup at the end of the function.
Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index 67e669e0141cc..00c719b93c76e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -2211,8 +2211,6 @@ static int gmc_v9_0_sw_fini(void *handle)
if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 3))
amdgpu_gmc_sysfs_fini(adev);
- adev->gmc.num_mem_partitions = 0;
- kfree(adev->gmc.mem_partitions);
amdgpu_gmc_ras_fini(adev);
amdgpu_gem_force_release(adev);
@@ -2226,6 +2224,9 @@ static int gmc_v9_0_sw_fini(void *handle)
amdgpu_bo_free_kernel(&adev->gmc.pdb0_bo, NULL, &adev->gmc.ptr_pdb0);
amdgpu_bo_fini(adev);
+ adev->gmc.num_mem_partitions = 0;
+ kfree(adev->gmc.mem_partitions);
+
return 0;
}
--
2.42.0
next prev parent reply other threads:[~2023-11-22 15:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 15:33 [PATCH AUTOSEL 6.5 01/15] scsi: sd: Fix sshdr use in sd_suspend_common() Sasha Levin
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 02/15] x86/acpi: Ignore invalid x2APIC entries Sasha Levin
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 03/15] hrtimers: Push pending hrtimers away from outgoing CPU earlier Sasha Levin
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 04/15] i2c: designware: Fix corrupted memory seen in the ISR Sasha Levin
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 05/15] netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test Sasha Levin
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 06/15] nouveau: use an rwlock for the event lock Sasha Levin
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 07/15] zstd: Fix array-index-out-of-bounds UBSAN warning Sasha Levin
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 08/15] tg3: Move the [rt]x_dropped counters to tg3_napi Sasha Levin
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 09/15] tg3: Increment tx_dropped in tg3_tso_bug() Sasha Levin
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 10/15] linux/export: clean up the IA-64 KSYM_FUNC macro Sasha Levin
2023-11-22 20:08 ` Lukas Bulwahn
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 11/15] kconfig: fix memory leak from range properties Sasha Levin
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 12/15] drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2) Sasha Levin
2023-11-22 15:33 ` Sasha Levin [this message]
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 14/15] drm/amdgpu: correct chunk_ptr to a pointer to chunk Sasha Levin
2023-11-22 15:33 ` [PATCH AUTOSEL 6.5 15/15] dm-crypt: start allocating with MAX_ORDER Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231122153340.852434-13-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Felix.Kuehling@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=le.ma@amd.com \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rajneesh.bhardwaj@amd.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox