From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Finish enabling rps before use by sysfs or debugfs Date: Thu, 10 Oct 2013 14:25:16 +0200 Message-ID: <20131010122516.GX8303@phenom.ffwll.local> References: <1379368603-18577-1-git-send-email-Tom.O'Rourke@intel.com> <20130916221230.GK32145@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f42.google.com (mail-ee0-f42.google.com [74.125.83.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 50691E6A03 for ; Thu, 10 Oct 2013 05:24:57 -0700 (PDT) Received: by mail-ee0-f42.google.com with SMTP id b45so1115914eek.29 for ; Thu, 10 Oct 2013 05:24:56 -0700 (PDT) Content-Disposition: inline In-Reply-To: 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: Tom.O'Rourke@intel.com Cc: intel-gfx List-Id: intel-gfx@lists.freedesktop.org On Tue, Sep 17, 2013 at 06:05:27PM +0200, Daniel Vetter wrote: > On Tue, Sep 17, 2013 at 12:12 AM, Daniel Vetter wrote: > > On Mon, Sep 16, 2013 at 02:56:43PM -0700, Tom.O'Rourke@intel.com wrote: > >> From: Tom O'Rourke > >> > >> Enabling rps (turbo setup) was put in a work queue because it may > >> take quite awhile. This change flushes the work queue to initialize > >> rps values before use by sysfs or debugfs. Specifically, > >> rps.delayed_resume_work is flushed before using rps.hw_max, > >> rps.max_delay, rps.min_delay, or rps.cur_delay. > >> > >> This change fixes a problem in sysfs where show functions using > >> uninitialized values show incorrect values and store functions > >> using uninitialized values in range checks incorrectly fail to > >> store valid input values. This change also addresses similar use > >> before initialized problems in debugfs. > >> > >> Change-Id: Ib9c4f2066b65013094cb9278fc17958a964836e7 > >> Signed-off-by: Tom O'Rourke > > > > I think we can exercise this by going through a suspend/resume cycle and > > racing concurrent reads/writes of the sysfs files in a 2nd process. With > > the igt_fork and igt_system_suspend_autoresume helpers in our kernel > > testsuite repro this should be a really quick testcase to write ... > > > > I'd go for a generic "read all sysfs files" approach to increase the > > chances of catching other similar fallout in the future. > > To clarify: I'd like to see a testcase for this so that we can make > sure it keeps working. I guess we unfortunately can't test for > functional correctness by just resuming since we won't see > uninitialized data. But at least we can test for the > flush_delayed_work deadlock implications, which have bitten us badly > in the past on numerous occasions. And maybe we can provoke hangs if > we adjust the rps values while the setup hasn't completed yet, so > might also give us weak coverage there. I've stitched something together with little enthusiasm ... *insert maintainer rant* Patch merged. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch