diff options
author | Mikko Perttunen <mperttunen@nvidia.com> | 2021-03-29 16:38:33 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2021-03-31 17:42:13 +0200 |
commit | aded42ada6eacfa11d349b158e993f66e4741aa7 (patch) | |
tree | 10cb6ca6abb3b17f6f0926b29070f31124def0a9 /drivers/gpu/host1x | |
parent | 2aed4f5ab04af922a7cf1b616701845c9ed2473f (diff) | |
download | linux-aded42ada6eacfa11d349b158e993f66e4741aa7.tar.bz2 |
gpu: host1x: Reset max value when freeing a syncpoint
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 <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r-- | drivers/gpu/host1x/syncpt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c index 7bb5de8c3d63..877c5ab40cbd 100644 --- a/drivers/gpu/host1x/syncpt.c +++ b/drivers/gpu/host1x/syncpt.c @@ -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); |