From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 1/2] drm/i915: properly lock gt_fifo_count Date: Sun, 6 Nov 2011 11:46:44 +0100 Message-ID: <20111106104644.GA2940@phenom.ffwll.local> References: <1320539464-6201-1-git-send-email-daniel.vetter@ffwll.ch> <1320540095-1346-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-fx0-f49.google.com (mail-fx0-f49.google.com [209.85.161.49]) by gabe.freedesktop.org (Postfix) with ESMTP id CD8679E80B for ; Sun, 6 Nov 2011 02:45:49 -0800 (PST) Received: by faaq17 with SMTP id q17so5475820faa.36 for ; Sun, 06 Nov 2011 02:45:48 -0800 (PST) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Chris Wilson Cc: Daniel Vetter , intel-gfx List-Id: intel-gfx@lists.freedesktop.org On Sun, Nov 06, 2011 at 08:39:46AM +0000, Chris Wilson wrote: > On Sun, 6 Nov 2011 01:41:35 +0100, Daniel Vetter 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@ffwll.ch Mobile: +41 (0)79 365 57 48