From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: change CRTC assertion on LCPLL disable Date: Fri, 6 Dec 2013 23:37:24 +0100 Message-ID: <20131206223724.GP27344@phenom.ffwll.local> References: <1386368941-2262-1-git-send-email-przanoni@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by gabe.freedesktop.org (Postfix) with ESMTP id A11DAFAE86 for ; Fri, 6 Dec 2013 14:36:36 -0800 (PST) Received: by mail-ee0-f43.google.com with SMTP id c13so543369eek.16 for ; Fri, 06 Dec 2013 14:36:35 -0800 (PST) Content-Disposition: inline In-Reply-To: <1386368941-2262-1-git-send-email-przanoni@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Paulo Zanoni Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org On Fri, Dec 06, 2013 at 08:29:01PM -0200, Paulo Zanoni wrote: > From: Paulo Zanoni > > Currently, PC8 is enabled at modeset_global_resources, which is called > after intel_modeset_update_state. Due to this, there's a small race > condition on the case where we start enabling PC8, then do a modeset > while PC8 is still being enabled. The racing condition triggers a WARN > because intel_modeset_update_state will mark the CRTC as enabled, then > the thread that's still enabling PC8 might look at the data structure > and think that PC8 is being enabled while a pipe is enabled. Despite > the WARN, this is not really a bug since we'll wait for the > PC8-enabling thread to finish when we call modeset_global_resources. > > The spec says the CRTC cannot be enabled when we disable LCPLL, so we > had a check for crtc->base.enabled. If we change to crtc->active we > will still prevent disabling LCPLL while the CRTC is enabled, and we > will also prevent the WARN above. > > This is a replacement for the previous patch named > "drm/i915: get/put PC8 when we get/put a CRTC" > > Testcase: igt/pm_pc8/modeset-lpsp-stress-no-wait > Signed-off-by: Paulo Zanoni Queued for -next, thanks for the patch. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch