[Intel-gfx] [PATCH 1/2] drm/i915: properly lock gt_fifo_count

Daniel Vetter daniel at ffwll.ch
Sun Nov 6 11:46:44 CET 2011


On Sun, Nov 06, 2011 at 08:39:46AM +0000, Chris Wilson wrote:
> On Sun,  6 Nov 2011 01:41:35 +0100, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> > Use a combination of atomic_t and a spinlocked slow-path to make most
> > writes fast.
> 
> What happened to the rule that this was protected by struct_mutex?
> Did you find a violation? Or is this step 1 in the hundred step plan to
> clarify and fix the locking around register access?

The real problem is the read side, which isn't really protected by
struct_mutex everywhere. And we can't change that because we want to
capture the error_state without taking struct_mutex. Somehow I've gotten a
bit overenthusiastic about all this and decided to start with that 5 year
plan to clean up our locking around register access.

After some more thinking this morning I've noticed that my trick is
fundamentally racy. Before I embarass myself even more I'll drop this
patch and just resend the read side locking fix so that the hangcheck
won't kill my machine anymore.
-Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list