gpu: host1x: Use HW-equivalent syncpoint expiration check
authorMikko Perttunen <mperttunen@nvidia.com>
Mon, 29 Mar 2021 13:38:31 +0000 (16:38 +0300)
committerThierry Reding <treding@nvidia.com>
Tue, 30 Mar 2021 17:53:24 +0000 (19:53 +0200)
commitf63b42cbc86e12f7d960d1fdaaf93b4373c06c65
tree3da429111aa8f70ef7f67faba766c2e54dab6973
parentecfb888ade427e2da437b48cafd8fc824e80c909
gpu: host1x: Use HW-equivalent syncpoint expiration check

Make syncpoint expiration checks always use the same logic used by
the hardware. This ensures that there are no race conditions that
could occur because of the hardware triggering a syncpoint interrupt
and then the driver disagreeing.

One situation where this could occur is if a job incremented a
syncpoint too many times -- then the hardware would trigger an
interrupt, but the driver would assume that a syncpoint value
greater than the syncpoint's max value is in the future, and not
clean up the job.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/host1x/syncpt.c