Skip to content

Commit

Permalink
gpu: host1x: Reset max value when freeing a syncpoint
Browse files Browse the repository at this point in the history
With job recovery becoming optional, syncpoints may have a mismatch
between their value and max value when freed. As such, when freeing,
set the max value to the current value of the syncpoint so that it
is in a sane state for the next user.

Signed-off-by: Mikko Perttunen <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
  • Loading branch information
cyndis authored and thierryreding committed Mar 31, 2021
1 parent 2aed4f5 commit aded42a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/host1x/syncpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ static void syncpt_release(struct kref *ref)
{
struct host1x_syncpt *sp = container_of(ref, struct host1x_syncpt, ref);

atomic_set(&sp->max_val, host1x_syncpt_read(sp));

mutex_lock(&sp->host->syncpt_mutex);

host1x_syncpt_base_free(sp->base);
Expand Down

0 comments on commit aded42a

Please sign in to comment.