From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH] drm/i915: make rc6 in sysfs functions conditional Date: Sun, 1 Jul 2012 09:50:34 -0700 Message-ID: <20120701095034.52e0940f@bwidawsk.net> References: <1341113980-6211-1-git-send-email-mhuntxu+intelgfx@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id B91209E75B for ; Sun, 1 Jul 2012 09:52:24 -0700 (PDT) In-Reply-To: <1341113980-6211-1-git-send-email-mhuntxu+intelgfx@gmail.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: Hunt Xu Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sun, 1 Jul 2012 11:39:40 +0800 Hunt Xu wrote: > Commit 0136db586c028f71e7cc21cc183064ff0d5919c8 merges rc6 information > into the power group. However, when compiled with CONFIG_PM not set, > modprobing i915 would taint since power_group_name is defined as NULL. > > This patch makes these rc6 in sysfs functions conditional upon the > definition of the CONFIG_PM macro to avoid the above-mentioned problem. > Thanks for the patch, the only problem is we want this information even when CONFIG_PM is not set as we currently don't control our rc6 state based on that. Unfortunately it also doesn't make too much sense to have CONFIG_PM control the rc6 info. Do you have any other ideas to make this work? > Signed-off-by: Hunt Xu > ---y, > drivers/gpu/drm/i915/i915_sysfs.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c > index 79f8344..6d4b001 100644 > --- a/drivers/gpu/drm/i915/i915_sysfs.c > +++ b/drivers/gpu/drm/i915/i915_sysfs.c > @@ -31,6 +31,7 @@ > #include > #include "i915_drv.h" > > +#ifdef CONFIG_PM > static u32 calc_residency(struct drm_device *dev, const u32 reg) > { > struct drm_i915_private *dev_priv = dev->dev_private; > @@ -109,3 +110,14 @@ void i915_teardown_sysfs(struct drm_device *dev) > { > sysfs_unmerge_group(&dev->primary->kdev.kobj, &rc6_attr_group); > } > +#else > +void i915_setup_sysfs(struct drm_device *dev) > +{ > + return; > +} > + > +void i915_teardown_sysfs(struct drm_device *dev) > +{ > + return; > +} > +#endif /* CONFIG_PM */ -- Ben Widawsky, Intel Open Source Technology Center