Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Add a mutex lock to protect poison injection

When poison is triggered multiple times, competition will occur.
Add a mutex lock to protect poison injection

Signed-off-by: Ce Sun <cesun102@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Ce Sun and committed by
Alex Deucher
0989b764 907813e5

+5
+3
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
··· 3512 3512 if (kthread_should_stop()) 3513 3513 break; 3514 3514 3515 + mutex_lock(&con->poison_lock); 3515 3516 gpu_reset = 0; 3516 3517 3517 3518 do { ··· 3569 3568 /* Wake up work to save bad pages to eeprom */ 3570 3569 schedule_delayed_work(&con->page_retirement_dwork, 0); 3571 3570 } 3571 + mutex_unlock(&con->poison_lock); 3572 3572 } 3573 3573 3574 3574 return 0; ··· 3650 3648 } 3651 3649 3652 3650 mutex_init(&con->recovery_lock); 3651 + mutex_init(&con->poison_lock); 3653 3652 INIT_WORK(&con->recovery_work, amdgpu_ras_do_recovery); 3654 3653 atomic_set(&con->in_recovery, 0); 3655 3654 atomic_set(&con->rma_in_recovery, 0);
+2
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
··· 587 587 struct list_head critical_region_head; 588 588 struct mutex critical_region_lock; 589 589 590 + /* Protect poison injection */ 591 + struct mutex poison_lock; 590 592 }; 591 593 592 594 struct ras_fs_data {