diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2019-04-18 10:41:48 +0200 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2019-04-18 09:27:34 -0500 |
commit | aa20236784ab3d0372591d6eca692956bca4ebfb (patch) | |
tree | 3eaa8e5e2bf8334b648387a023a6060d2304d017 /drivers/gpu/drm/panfrost/panfrost_job.c | |
parent | db594ba3fcf9b2b84d71ffcc62a54b49c21427da (diff) | |
download | lwn-aa20236784ab3d0372591d6eca692956bca4ebfb.tar.gz lwn-aa20236784ab3d0372591d6eca692956bca4ebfb.zip |
drm/panfrost: Prevent concurrent resets
If a job times out in slot 0 while a reset is performed because a job
timed out in slot 1, the drm-sched core can get into a deadlock.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190418084305.45021-1-tomeu.vizoso@collabora.com
Diffstat (limited to 'drivers/gpu/drm/panfrost/panfrost_job.c')
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_job.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index 0a7ed04f7d52..a5716c8fe8b3 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c @@ -384,6 +384,8 @@ static void panfrost_job_timedout(struct drm_sched_job *sched_job) job_read(pfdev, JS_TAIL_LO(js)), sched_job); + mutex_lock(&pfdev->reset_lock); + for (i = 0; i < NUM_JOB_SLOTS; i++) drm_sched_stop(&pfdev->js->queue[i].sched); @@ -406,6 +408,8 @@ static void panfrost_job_timedout(struct drm_sched_job *sched_job) /* restart scheduler after GPU is usable again */ for (i = 0; i < NUM_JOB_SLOTS; i++) drm_sched_start(&pfdev->js->queue[i].sched, true); + + mutex_unlock(&pfdev->reset_lock); } static const struct drm_sched_backend_ops panfrost_sched_ops = { |