From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 3/3] drm/i915: close rps work vs. rps disable races Date: Sun, 4 Sep 2011 21:57:31 +0200 Message-ID: <20110904195731.GD2799@phenom.ffwll.local> References: <20110904084953.16cd10a2@bwidawsk.net> <1315150502-12537-1-git-send-email-daniel.vetter@ffwll.ch> <1315150502-12537-4-git-send-email-daniel.vetter@ffwll.ch> <20110904172330.GA16313@cloud01> <20110904191723.GA2799@phenom.ffwll.local> <20110904195008.GA17304@cloud01> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ew0-f49.google.com (mail-ew0-f49.google.com [209.85.215.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 635CE9E8C6 for ; Sun, 4 Sep 2011 12:57:13 -0700 (PDT) Received: by ewy3 with SMTP id 3so2344125ewy.36 for ; Sun, 04 Sep 2011 12:57:12 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20110904195008.GA17304@cloud01> 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: Ben Widawsky Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sun, Sep 04, 2011 at 07:50:08PM +0000, Ben Widawsky wrote: > So I would rework some of your comments a bit, and I also think it's > about time we create a central place to cancel workqueue items. Mostly > because I think this patch is subject to a deadlock with struct_mutex > (you're holding it when you call gen6_disable_rps(), but you're doing > cancel_work_sync on a workqueue which attempts to acquire struct_mutex. Oh dang, you're correct. This will deadlock. And the PMIMR is really just cosmetic. So putting the cancel_work_sync into intel_modeset_cleanup sounds like the right approach. And hey, I've already put other work cancelling stuff there in my last fury at fixing module unload, so it can't be that bad ;-) I'll try to write a better patch tomorrow. -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48