[PATCH 2/6] drm/amdgpu: block till late_init_work done in dev_fini

Monk Liu Monk.Liu at amd.com
Tue Feb 27 08:47:11 UTC 2018


otherwise page fault hit in the work if driver
finished too quick

Change-Id: I4fd47ccd836441b1b3f426dec5d364d9df02e23d
Signed-off-by: Monk Liu <Monk.Liu at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 75d1733..3251f81 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2089,7 +2089,9 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
 		adev->firmware.gpu_info_fw = NULL;
 	}
 	adev->accel_working = false;
-	cancel_delayed_work_sync(&adev->late_init_work);
+
+	while (cancel_delayed_work_sync(&adev->late_init_work))
+		msleep(1);
 	/* free i2c buses */
 	if (!amdgpu_device_has_dc_support(adev))
 		amdgpu_i2c_fini(adev);
-- 
2.7.4



More information about the amd-gfx mailing list