Skip to content
Commit 0bb29aaa authored by Steven Price's avatar Steven Price
Browse files

drm/panfrost: Fix race between timeout and closure



If a GPU timeout is still being processed at the same time as the drm
node is closed then the job can end up being freed after the MMU context
has been torn down (but the job might still have been hanging on to
memory). This ends with a warning from the kernel (and some potential
use-after-free bugs):

  WARNING: CPU: 1 PID: 485 at drivers/gpu/drm/drm_mm.c:999 panfrost_postclose+0x28/0x34 [panfrost]
  Memory manager not clean during takedown.

Synchronise with the delayed_work which handles the timeouts in
panfrost_job_close() to prevent this happening.

Signed-off-by: Steven Price's avatarSteven Price <steven.price@arm.com>
---
This potentially should be fixed in the drm scheduler, however I'm not
sure how to do this cleanly. The above 'hack' waits for any timeouts,
even if they are unrelated to the entity being closed. Ideally we only
care about timeouts from jobs related to the entity we're destroying.
Alternative patches welcome.
parent 5144eead
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment