• Lucas Stach's avatar
    drm/scheduler: fix inconsistent locking of job_list_lock · a7fbb630
    Lucas Stach authored
    1db8c142 (drm/scheduler: Add drm_sched_suspend/resume_timeout()) made
    the job_list_lock IRQ safe in as the suspend/resume calls were expected to
    be called from IRQ context. This usage never materialized in upstream.
    Instead amdgpu started locking the job_list_lock in an IRQ unsafe way in
    amdgpu_ib_preempt_mark_partial_job() and amdgpu_ib_preempt_job_recovery(),
    which leads to potential deadlock if one would actually start to call the
    drm_sched_suspend/resume_timeout functions from IRQ context.
    
    As no current user needs the locking to be IRQ safe, the local IRQ
    disable/enable is pure overhead. Fix the inconsistent locking by changing
    all uses of job_list_lock to use the IRQ unsafe locking primitives.
    Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
    Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    a7fbb630
sched_main.c 22.5 KB