linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: lyndonli <Lyndon.Li@amd.com>, "Guchun Chen" <guchun.chen@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Sasha Levin" <sashal@kernel.org>,
	Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch,
	luben.tuikov@amd.com, Philip.Yang@amd.com, sunpeng.li@amd.com,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.2 29/30] drm/amdgpu: Fix call trace warning and hang when removing amdgpu device
Date: Sun, 19 Mar 2023 20:52:54 -0400	[thread overview]
Message-ID: <20230320005258.1428043-29-sashal@kernel.org> (raw)
In-Reply-To: <20230320005258.1428043-1-sashal@kernel.org>

From: lyndonli <Lyndon.Li@amd.com>

[ Upstream commit 93bb18d2a873d2fa9625c8ea927723660a868b95 ]

On GPUs with RAS enabled, below call trace and hang are observed when
shutting down device.

v2: use DRM device unplugged flag instead of shutdown flag as the check to
prevent memory wipe in shutdown stage.

[ +0.000000] RIP: 0010:amdgpu_vram_mgr_fini+0x18d/0x1c0 [amdgpu]
[ +0.000001] PKRU: 55555554
[ +0.000001] Call Trace:
[ +0.000001] <TASK>
[ +0.000002] amdgpu_ttm_fini+0x140/0x1c0 [amdgpu]
[ +0.000183] amdgpu_bo_fini+0x27/0xa0 [amdgpu]
[ +0.000184] gmc_v11_0_sw_fini+0x2b/0x40 [amdgpu]
[ +0.000163] amdgpu_device_fini_sw+0xb6/0x510 [amdgpu]
[ +0.000152] amdgpu_driver_release_kms+0x16/0x30 [amdgpu]
[ +0.000090] drm_dev_release+0x28/0x50 [drm]
[ +0.000016] devm_drm_dev_init_release+0x38/0x60 [drm]
[ +0.000011] devm_action_release+0x15/0x20
[ +0.000003] release_nodes+0x40/0xc0
[ +0.000001] devres_release_all+0x9e/0xe0
[ +0.000001] device_unbind_cleanup+0x12/0x80
[ +0.000003] device_release_driver_internal+0xff/0x160
[ +0.000001] driver_detach+0x4a/0x90
[ +0.000001] bus_remove_driver+0x6c/0xf0
[ +0.000001] driver_unregister+0x31/0x50
[ +0.000001] pci_unregister_driver+0x40/0x90
[ +0.000003] amdgpu_exit+0x15/0x120 [amdgpu]

Signed-off-by: lyndonli <Lyndon.Li@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Christian König <christian.koenig@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_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 25a68d8888e0d..5d4649b8bfd33 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -1315,7 +1315,7 @@ void amdgpu_bo_release_notify(struct ttm_buffer_object *bo)
 
 	if (!bo->resource || bo->resource->mem_type != TTM_PL_VRAM ||
 	    !(abo->flags & AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE) ||
-	    adev->in_suspend || adev->shutdown)
+	    adev->in_suspend || drm_dev_is_unplugged(adev_to_drm(adev)))
 		return;
 
 	if (WARN_ON_ONCE(!dma_resv_trylock(bo->base.resv)))
-- 
2.39.2


  parent reply	other threads:[~2023-03-20  0:56 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20  0:52 [PATCH AUTOSEL 6.2 01/30] drm/cirrus: NULL-check pipe->plane.state->fb in cirrus_pipe_update() Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 02/30] HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 03/30] ca8210: fix mac_len negative array access Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 04/30] HID: logitech-hidpp: Add support for Logitech MX Master 3S mouse Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 05/30] HID: intel-ish-hid: ipc: Fix potential use-after-free in work function Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 06/30] m68k: mm: Fix systems with memory at end of 32-bit address space Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 07/30] m68k: Only force 030 bus error if PC not in exception table Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 08/30] selftests/bpf: check that modifier resolves after pointer Sasha Levin
2023-03-20 15:31   ` Lorenz Bauer
2023-03-20 15:48     ` Greg KH
2023-03-28 10:18       ` Lorenz Bauer
2023-04-11 15:08         ` Lorenz Bauer
2023-04-11 15:14           ` Greg KH
2023-05-24 11:03             ` Lorenz Bauer
2023-05-24 16:03               ` Greg KH
2023-05-24 17:04                 ` Lorenz Bauer
2023-05-26 16:43                   ` Greg KH
2023-05-30 11:24                     ` Lorenz Bauer
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 09/30] cpumask: fix incorrect cpumask scanning result checks Sasha Levin
2023-03-20  1:59   ` Linus Torvalds
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 10/30] scsi: target: iscsi: Fix an error message in iscsi_check_key() Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 11/30] scsi: qla2xxx: Add option to disable FC2 Target support Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 12/30] scsi: hisi_sas: Check devm_add_action() return value Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 13/30] scsi: ufs: core: Add soft dependency on governor_simpleondemand Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 14/30] scsi: lpfc: Check kzalloc() in lpfc_sli4_cgn_params_read() Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 15/30] scsi: lpfc: Avoid usage of list iterator variable after loop Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 16/30] scsi: mpi3mr: ioctl timeout when disabling/enabling interrupt Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 17/30] scsi: mpi3mr: Driver unload crashes host when enhanced logging is enabled Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 18/30] scsi: mpi3mr: Wait for diagnostic save during controller init Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 19/30] scsi: mpi3mr: Return proper values for failures in firmware init path Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 20/30] scsi: mpi3mr: NVMe command size greater than 8K fails Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 21/30] scsi: mpi3mr: Bad drive in topology results kernel crash Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 22/30] scsi: storvsc: Handle BlockSize change in Hyper-V VHD/VHDX file Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 23/30] platform/x86: ISST: Increase range of valid mail box commands Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 24/30] platform/x86: int3472: Add GPIOs to Surface Go 3 Board data Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 25/30] net: usb: cdc_mbim: avoid altsetting toggling for Telit FE990 Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 26/30] net: usb: qmi_wwan: add Telit 0x1080 composition Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 27/30] drm/amd/display: Update clock table to include highest clock setting Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 28/30] sh: sanitize the flags on sigreturn Sasha Levin
2023-03-20  0:52 ` Sasha Levin [this message]
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 30/30] drm/amd: Fix initialization mistake for NBIO 7.3.0 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=20230320005258.1428043-29-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Lyndon.Li@amd.com \
    --cc=Philip.Yang@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=guchun.chen@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luben.tuikov@amd.com \
    --cc=stable@vger.kernel.org \
    --cc=sunpeng.li@amd.com \
    /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;
as well as URLs for NNTP newsgroup(s).