aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x
diff options
context:
space:
mode:
authorMikko Perttunen <mperttunen@nvidia.com>2021-03-29 16:38:33 +0300
committerThierry Reding <treding@nvidia.com>2021-03-31 17:42:13 +0200
commitaded42ada6eacfa11d349b158e993f66e4741aa7 (patch)
tree10cb6ca6abb3b17f6f0926b29070f31124def0a9 /drivers/gpu/host1x
parentgpu: host1x: Cleanup and refcounting for syncpoints (diff)
downloadlinux-dev-aded42ada6eacfa11d349b158e993f66e4741aa7.tar.xz
linux-dev-aded42ada6eacfa11d349b158e993f66e4741aa7.zip
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.c2
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);