diff options
author | Mikita Lipski <mikita.lipski@amd.com> | 2018-01-10 10:01:38 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-04-25 11:07:29 -0400 |
commit | ad64dc0137968f09800e58174bbfd5eac9fe5418 (patch) | |
tree | a4a8b0ca36699ba24dd112bf36162fe5f07421c8 | |
parent | 75569c182e4f65cd8826a5853dc9cbca703cbd0e (diff) |
drm/amd/display: Fix deadlock when flushing irq
Lock irq table when reading a work in queue,
unlock to flush the work, lock again till all tasks
are cleared
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c index 490017df371d..4be21bf54749 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | |||
@@ -329,14 +329,15 @@ void amdgpu_dm_irq_fini(struct amdgpu_device *adev) | |||
329 | { | 329 | { |
330 | int src; | 330 | int src; |
331 | struct irq_list_head *lh; | 331 | struct irq_list_head *lh; |
332 | unsigned long irq_table_flags; | ||
332 | DRM_DEBUG_KMS("DM_IRQ: releasing resources.\n"); | 333 | DRM_DEBUG_KMS("DM_IRQ: releasing resources.\n"); |
333 | |||
334 | for (src = 0; src < DAL_IRQ_SOURCES_NUMBER; src++) { | 334 | for (src = 0; src < DAL_IRQ_SOURCES_NUMBER; src++) { |
335 | 335 | DM_IRQ_TABLE_LOCK(adev, irq_table_flags); | |
336 | /* The handler was removed from the table, | 336 | /* The handler was removed from the table, |
337 | * it means it is safe to flush all the 'work' | 337 | * it means it is safe to flush all the 'work' |
338 | * (because no code can schedule a new one). */ | 338 | * (because no code can schedule a new one). */ |
339 | lh = &adev->dm.irq_handler_list_low_tab[src]; | 339 | lh = &adev->dm.irq_handler_list_low_tab[src]; |
340 | DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags); | ||
340 | flush_work(&lh->work); | 341 | flush_work(&lh->work); |
341 | } | 342 | } |
342 | } | 343 | } |