From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Longlong Yao <Longlong.Yao@amd.com>,
Guchun Chen <guchun.chen@amd.com>, Feifei Xu <Feifei.Xu@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, Hawking.Zhang@amd.com,
mario.limonciello@amd.com, YiPeng.Chai@amd.com, Jack.Gui@amd.com,
candice.li@amd.com, Lyndon.Li@amd.com, katrinzhou@tencent.com,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.1 02/41] drm/amdgpu: fix calltrace warning in amddrm_buddy_fini
Date: Sun, 23 Jul 2023 21:20:35 -0400 [thread overview]
Message-ID: <20230724012118.2316073-2-sashal@kernel.org> (raw)
In-Reply-To: <20230724012118.2316073-1-sashal@kernel.org>
From: Longlong Yao <Longlong.Yao@amd.com>
[ Upstream commit 01382501509871d0799bab6bd412c228486af5bf ]
The following call trace is observed when removing the amdgpu driver, which
is caused by that BOs allocated for psp are not freed until removing.
[61811.450562] RIP: 0010:amddrm_buddy_fini.cold+0x29/0x47 [amddrm_buddy]
[61811.450577] Call Trace:
[61811.450577] <TASK>
[61811.450579] amdgpu_vram_mgr_fini+0x135/0x1c0 [amdgpu]
[61811.450728] amdgpu_ttm_fini+0x207/0x290 [amdgpu]
[61811.450870] amdgpu_bo_fini+0x27/0xa0 [amdgpu]
[61811.451012] gmc_v9_0_sw_fini+0x4a/0x60 [amdgpu]
[61811.451166] amdgpu_device_fini_sw+0x117/0x520 [amdgpu]
[61811.451306] amdgpu_driver_release_kms+0x16/0x30 [amdgpu]
[61811.451447] devm_drm_dev_init_release+0x4d/0x80 [drm]
[61811.451466] devm_action_release+0x15/0x20
[61811.451469] release_nodes+0x40/0xb0
[61811.451471] devres_release_all+0x9b/0xd0
[61811.451473] __device_release_driver+0x1bb/0x2a0
[61811.451476] driver_detach+0xf3/0x140
[61811.451479] bus_remove_driver+0x6c/0xf0
[61811.451481] driver_unregister+0x31/0x60
[61811.451483] pci_unregister_driver+0x40/0x90
[61811.451486] amdgpu_exit+0x15/0x447 [amdgpu]
For smu v13_0_2, if the GPU supports xgmi, refer to
commit f5c7e7797060 ("drm/amdgpu: Adjust removal control flow for smu v13_0_2"),
it will run gpu recover in AMDGPU_RESET_FOR_DEVICE_REMOVE mode when removing,
which makes all devices in hive list have hw reset but no resume except the
basic ip blocks, then other ip blocks will not call .hw_fini according to
ip_block.status.hw.
Since psp_free_shared_bufs just includes some software operations, so move
it to psp_sw_fini.
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index a3cd816f98a14..9e6719a561587 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -514,6 +514,8 @@ static int psp_sw_fini(void *handle)
kfree(cmd);
cmd = NULL;
+ psp_free_shared_bufs(psp);
+
if (psp->km_ring.ring_mem)
amdgpu_bo_free_kernel(&adev->firmware.rbuf,
&psp->km_ring.ring_mem_mc_addr,
@@ -2671,8 +2673,6 @@ static int psp_hw_fini(void *handle)
psp_ring_destroy(psp, PSP_RING_TYPE__KM);
- psp_free_shared_bufs(psp);
-
return 0;
}
--
2.39.2
next prev parent reply other threads:[~2023-07-24 1:22 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 1:20 [PATCH AUTOSEL 6.1 01/41] drm/amd/display: Do not set drr on pipe commit Sasha Levin
2023-07-24 1:20 ` Sasha Levin [this message]
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 03/41] drm/radeon: Fix integer overflow in radeon_cs_parser_init Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 04/41] drm/amdgpu: Fix integer overflow in amdgpu_cs_pass1 Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 05/41] drm/amdgpu: fix memory leak in mes self test Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 06/41] ALSA: emu10k1: roll up loops in DSP setup code for Audigy Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 07/41] ASoC: Intel: sof_sdw: add quirk for MTL RVP Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 08/41] ASoC: Intel: sof_sdw: add quirk for LNL RVP Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 09/41] PCI: tegra194: Fix possible array out of bounds access Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 10/41] ASoC: SOF: amd: Add pci revision id check Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 11/41] drm/stm: ltdc: fix late dereference check Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 12/41] drm: rcar-du: remove R-Car H3 ES1.* workarounds Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 13/41] ASoC: amd: vangogh: Add check for acp config flags in vangogh platform Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 14/41] ARM: dts: imx6dl: prtrvt, prtvt7, prti6q, prtwd2: fix USB related warnings Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 15/41] ASoC: Intel: sof_sdw_rt_sdca_jack_common: test SOF_JACK_JDSRC in _exit Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 16/41] ASoC: Intel: sof_sdw: Add support for Rex soundwire Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 17/41] iopoll: Call cpu_relax() in busy loops Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 18/41] quota: Properly disable quotas when add_dquot_ref() fails Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 19/41] quota: fix warning in dqgrab() Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 20/41] ALSA: hda: Add Loongson LS7A HD-Audio support Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 21/41] ASoC: SOF: Intel: fix SoundWire/HDaudio mutual exclusion Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 22/41] dma-remap: use kvmalloc_array/kvfree for larger dma memory remap Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 23/41] accel/habanalabs: add pci health check during heartbeat Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 24/41] HID: logitech-hidpp: Add USB and Bluetooth IDs for the Logitech G915 TKL Keyboard Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 25/41] iommu/amd: Introduce Disable IRTE Caching Support Sasha Levin
2023-07-24 1:20 ` [PATCH AUTOSEL 6.1 26/41] drm/amdgpu: install stub fence into potential unused fence pointers Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 27/41] drm/amd/display: Apply 60us prefetch for DCFCLK <= 300Mhz Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 28/41] Revert "drm/amd/display: Do not set drr on pipe commit" Sasha Levin
2023-07-24 10:46 ` Michel Dänzer
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 29/41] HID: add quirk for 03f0:464a HP Elite Presenter Mouse Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 30/41] RDMA/mlx5: Return the firmware result upon destroying QP/RQ Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 31/41] drm/amd/display: Skip DPP DTO update if root clock is gated Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 32/41] drm/amd/display: Enable dcn314 DPP RCO Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 33/41] ASoC: SOF: core: Free the firmware trace before calling snd_sof_shutdown() Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 34/41] ovl: check type and offset of struct vfsmount in ovl_entry Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 35/41] HID: intel-ish-hid: ipc: Add Arrow Lake PCI device ID Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 36/41] udf: Fix uninitialized array access for some pathnames Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 37/41] ALSA: hda/realtek: Add quirks for ROG ALLY CS35l41 audio Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 38/41] fs: jfs: Fix UBSAN: array-index-out-of-bounds in dbAllocDmapLev Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 39/41] MIPS: dec: prom: Address -Warray-bounds warning Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 40/41] FS: JFS: Fix null-ptr-deref Read in txBegin Sasha Levin
2023-07-24 1:21 ` [PATCH AUTOSEL 6.1 41/41] FS: JFS: Check for read-only mounted filesystem " 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=20230724012118.2316073-2-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Feifei.Xu@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Jack.Gui@amd.com \
--cc=Longlong.Yao@amd.com \
--cc=Lyndon.Li@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=YiPeng.Chai@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=candice.li@amd.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=guchun.chen@amd.com \
--cc=katrinzhou@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@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