From: Daniel Vetter Subject: Re: [PATCH] drm/i915: implement HSW display sequences for package C8+ Date: Wed, 5 Jun 2013 22:35:43 +0200 Message-ID: <20130605203543.GM15743@phenom.ffwll.local> References: <1366130864-5471-1-git-send-email-przanoni@gmail.com> <20130417074716.GL27612@phenom.ffwll.local> <20130605193903.GI5004@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 375C3E5CE7 for ; Wed, 5 Jun 2013 13:35:50 -0700 (PDT) Received: by mail-ee0-f49.google.com with SMTP id b57so621279eek.22 for ; Wed, 05 Jun 2013 13:35:49 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130605193903.GI5004@intel.com> 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: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: intel-gfx , Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org On Wed, Jun 05, 2013 at 10:39:03PM +0300, Ville Syrj=E4l=E4 wrote: > On Wed, Jun 05, 2013 at 08:04:48PM +0200, Daniel Vetter wrote: > > On Wed, Jun 5, 2013 at 7:20 PM, Paulo Zanoni wrote: > > >> So all together I vote for the generic interface to be called some= thing > > >> like > > >> > > >> intel_aux_display_runtime_forbid/allow > > > > > > I changed to intel_aux_display_shutdown_forbid/allow, because we > > > forbid the shutdown, not the "runtime". > > = > > Just one quick comment: The idea was to be 100% consisten with the > > runtime pm api (I've dropped the pm_ part unfortunately), which is: > > = > > extern void pm_runtime_allow(struct device *dev); > > extern void pm_runtime_forbid(struct device *dev); > = > I've not seen those guys before, but they don't seem like something > we ought to be using. In fact it seems they're there solely for the > purpose of sysfs. They frob the runtime_auto boolean which has no ref > count protecting it, so someone writing to the sysfs "control" file > could undo what we just did from the driver, and vice versa. There's > still the usage_count though so the device should remain alive, but > then that's what _get()/_put() also modify. Yeah, I've been confused here. _get/_put seem to be the ones we actually want to emulate. > I do see quite a few pm_runtime_allow/forbid calls from drivers though, > which is confusing to say the least. Either I'm confused about the > purpose of these functions, or there has been a serious problem with = > driver review. I think it's to prevent runtime pm in driver init code, e.g. usb devices which crap out when autosuspended. Since presumable the driver will do the allow/forbid only once it should all work out. And root is allowed to break stuff by touching randomg things in sysfs ;-) -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch