From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 2/3] drm/i915: close PM interrupt masking races in the rps work func Date: Sun, 4 Sep 2011 23:51:52 -0700 Message-ID: <20110904235152.36175596@bwidawsk.net> References: <20110904084953.16cd10a2@bwidawsk.net> <1315150502-12537-1-git-send-email-daniel.vetter@ffwll.ch> <1315150502-12537-3-git-send-email-daniel.vetter@ffwll.ch> <20110904100817.16c6c4cc@bwidawsk.net> <20110904192648.GB2799@phenom.ffwll.local> <20110904195657.GB17304@cloud01> <20110904201030.GE2799@phenom.ffwll.local> <20110904213856.GA18071@cloud01> <20110905063807.GA2921@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 975E6A1C54 for ; Sun, 4 Sep 2011 23:51:37 -0700 (PDT) In-Reply-To: <20110905063807.GA2921@phenom.ffwll.local> 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: Daniel Vetter Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, 5 Sep 2011 08:38:07 +0200 Daniel Vetter wrote: > On Sun, Sep 04, 2011 at 09:38:56PM +0000, Ben Widawsky wrote: > > Oops, you're totally right, I think I meant: > > - I915_WRITE(GEN6_PMIMR, pm_imr & ~pm_iir); > > + I915_WRITE(GEN6_PMIMR, dev_priv->pm_iir); > > Imo still racy without the irqsafe rps_lock around it. gcc is free to > compile that into a separate load and store which the irq handler can > get in between and change dev_priv->pm_iir and PMIMR. The race is now > only one instruction wide, though ;-) > -Daniel You are absolutely correct. The modification to GEN6_PMIMR must be within the protection of rps_lock. Ben