aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
diff options
context:
space:
mode:
authorGravatar Mukul Joshi <mukul.joshi@amd.com> 2024-01-24 10:14:51 +0800
committerGravatar Alex Deucher <alexander.deucher@amd.com> 2024-01-25 14:57:52 -0500
commitc84a7e21db79fa899b9ad2d56464779f182789cb (patch)
treedb28a905a1839a9385575f6e847a230dddb66e40 /drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
parentdrm/amdgpu/pm: Add default case for smu IH process func (diff)
downloadlinux-c84a7e21db79fa899b9ad2d56464779f182789cb.tar.gz
linux-c84a7e21db79fa899b9ad2d56464779f182789cb.tar.bz2
linux-c84a7e21db79fa899b9ad2d56464779f182789cb.zip
drm/amdgpu: Fix module unload hang with RAS enabled
The driver unload hangs because the page retirement kthread cannot be stopped as it is sleeping and waiting on page retirement event to occur. Add kthread_should_stop() to the event condition to wake up the kthread when kthread stop is called during driver unload. Fixes: 3fdcd0a31d7a ("drm/amdgpu: Prepare for asynchronous processing of umc page retirement") Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index a32e7eb31354..80816c4ec1f1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -2670,8 +2670,12 @@ static int amdgpu_ras_page_retirement_thread(void *param)
while (!kthread_should_stop()) {
wait_event_interruptible(con->page_retirement_wq,
+ kthread_should_stop() ||
atomic_read(&con->page_retirement_req_cnt));
+ if (kthread_should_stop())
+ break;
+
dev_info(adev->dev, "Start processing page retirement. request:%d\n",
atomic_read(&con->page_retirement_req_cnt));