Commit c84a7e21 authored by Mukul Joshi's avatar Mukul Joshi Committed by Alex Deucher

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: 3fdcd0a3 ("drm/amdgpu: Prepare for asynchronous processing of umc page retirement")
Signed-off-by: default avatarMukul Joshi <mukul.joshi@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1e201202
...@@ -2670,8 +2670,12 @@ static int amdgpu_ras_page_retirement_thread(void *param) ...@@ -2670,8 +2670,12 @@ static int amdgpu_ras_page_retirement_thread(void *param)
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
wait_event_interruptible(con->page_retirement_wq, wait_event_interruptible(con->page_retirement_wq,
kthread_should_stop() ||
atomic_read(&con->page_retirement_req_cnt)); atomic_read(&con->page_retirement_req_cnt));
if (kthread_should_stop())
break;
dev_info(adev->dev, "Start processing page retirement. request:%d\n", dev_info(adev->dev, "Start processing page retirement. request:%d\n",
atomic_read(&con->page_retirement_req_cnt)); atomic_read(&con->page_retirement_req_cnt));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment