From: Daniel Vetter Subject: Re: [PATCH 06/43] drm/i915: protect force_wake_(get|put) with the gt_lock Date: Wed, 4 Jan 2012 19:12:57 +0100 Message-ID: <20120104181257.GI8004@phenom.ffwll.local> References: <1323867460-5486-1-git-send-email-daniel.vetter@ffwll.ch> <1323867460-5486-6-git-send-email-daniel.vetter@ffwll.ch> <86zke4mxg2.fsf@sumi.keithp.com> <86wr98mqw3.fsf@sumi.keithp.com> <86obukmkdq.fsf@sumi.keithp.com> <86zke3l5fj.fsf@sumi.keithp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ww0-f41.google.com (mail-ww0-f41.google.com [74.125.82.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 76F599E85E for ; Wed, 4 Jan 2012 10:10:59 -0800 (PST) Received: by wgbdt12 with SMTP id dt12so26126606wgb.0 for ; Wed, 04 Jan 2012 10:10:58 -0800 (PST) Content-Disposition: inline In-Reply-To: <86zke3l5fj.fsf@sumi.keithp.com> 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: Keith Packard Cc: Daniel Vetter , intel-gfx List-Id: intel-gfx@lists.freedesktop.org On Wed, Jan 04, 2012 at 09:54:08AM -0800, Keith Packard wrote: > On Wed, 4 Jan 2012 18:11:18 +0100, Daniel Vetter wrote: > > > Ah, I think I see you're concern: Between the time we reset the gpu > > and the time we fix up the forcewake state somebody might sneak in and > > see an inconstency between our tracking and the actual hw state, hence > > reading garbage. Correct? > > Indeed. Plus, holding the spinlock across the whole operation also means > only taking it once, rather than twice. Spinlocks aren't free. > > If we change the locking from struct_mutex to the spinlock, we should > actually make it work, independent of what access we have today. The "Correct?" was just to check my understanding of your concern, I still think its invalid. You've cut away the second part of my mail where I explain why and I don't see you responding to that here. Also micro-optimizing the gpu reset code sounds a bit strange. -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48