Re: [PATCH v2] drm/panfrost: Move the GPU reset bits outside the timeout handler

2020-11-02 Thread Boris Brezillon
On Fri, 30 Oct 2020 14:29:32 + Robin Murphy wrote: > On 2020-10-30 10:53, Boris Brezillon wrote: > [...] > > + /* Schedule a reset if there's no reset in progress. */ > > + if (!atomic_cmpxchg(&pfdev->reset.pending, 0, 1)) > > Nit: this could just be a simple xchg with 1 - you don't ne

Re: [PATCH v2] drm/panfrost: Move the GPU reset bits outside the timeout handler

2020-10-30 Thread Robin Murphy
On 2020-10-30 10:53, Boris Brezillon wrote: [...] + /* Schedule a reset if there's no reset in progress. */ + if (!atomic_cmpxchg(&pfdev->reset.pending, 0, 1)) Nit: this could just be a simple xchg with 1 - you don't need the compare aspect, since setting it to true when it was alr

Re: [PATCH v2] drm/panfrost: Move the GPU reset bits outside the timeout handler

2020-10-30 Thread Steven Price
On 30/10/2020 10:53, Boris Brezillon wrote: We've fixed many races in panfrost_job_timedout() but some remain. Instead of trying to fix it again, let's simplify the logic and move the reset bits to a separate work scheduled when one of the queue reports a timeout. v2: - Use atomic_cmpxchg() to c

[PATCH v2] drm/panfrost: Move the GPU reset bits outside the timeout handler

2020-10-30 Thread Boris Brezillon
We've fixed many races in panfrost_job_timedout() but some remain. Instead of trying to fix it again, let's simplify the logic and move the reset bits to a separate work scheduled when one of the queue reports a timeout. v2: - Use atomic_cmpxchg() to conditionally schedule the reset work (Steven P