From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 3/3] drm/i915: fix infinite loop at gen6_update_ring_freq Date: Wed, 2 Apr 2014 09:26:42 +0200 Message-ID: <20140402072642.GM7225@phenom.ffwll.local> References: <1396391989-2244-1-git-send-email-przanoni@gmail.com> <1396391989-2244-4-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-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by gabe.freedesktop.org (Postfix) with ESMTP id DA90488284 for ; Wed, 2 Apr 2014 00:26:47 -0700 (PDT) Received: by mail-wi0-f173.google.com with SMTP id z2so4756156wiv.0 for ; Wed, 02 Apr 2014 00:26:45 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1396391989-2244-4-git-send-email-przanoni@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Paulo Zanoni Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org On Tue, Apr 01, 2014 at 07:39:49PM -0300, Paulo Zanoni wrote: > From: Paulo Zanoni > > If I boot my Broadwell machine to X on a system with Mesa Gallium > llvmpipe instead of i965, then kill X and try to run pm_pc8.c, when we > disable PC8 and call gen6_update_ring_freq(), we will get stuck on an > infinite loop because the frequencies are zero and the variables are > unsigned. This happens because we never ran any batch, so we did not > enable RC6, so the variables are zero. If I run gem_exec_nop before > running pm_pc8, everything works as expected because gem_exec_nop > makes RC6 be enabled. > > This commit should prevent the infinite loop, which IMHO is already a > good reason to be merged, but it is not the proper fix to the "RC6 is > not being enabled" problem. > > Signed-off-by: Paulo Zanoni This will be fixed (I hope at least) once we have the in-kernel 3d state emission stuff. But there's still a race when we go into runtime suspend right after coming out of system resume. I think we need to grab a runtime pm reference when we launch the delayed rps work and drop it once that has run. Or at least we need to have a flush_delayed_work in the runtime pm suspend function. There's probably piles more stuff like this. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch