intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] drm/i915: make rc6 in sysfs functions conditional
       [not found] <1341113980-6211-1-git-send-email-mhuntxu+intelgfx@gmail.com>
@ 2012-07-01 16:50 ` Ben Widawsky
  2012-08-06 17:45   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Widawsky @ 2012-07-01 16:50 UTC (permalink / raw)
  To: Hunt Xu; +Cc: intel-gfx

On Sun,  1 Jul 2012 11:39:40 +0800
Hunt Xu <mhuntxu@gmail.com> 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 <mhuntxu+intelgfx@gmail.com>
> ---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 <linux/sysfs.h>
>  #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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: make rc6 in sysfs functions conditional
  2012-07-01 16:50 ` [PATCH] drm/i915: make rc6 in sysfs functions conditional Ben Widawsky
@ 2012-08-06 17:45   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2012-08-06 17:45 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: intel-gfx

On Sun, Jul 01, 2012 at 09:50:34AM -0700, Ben Widawsky wrote:
> On Sun,  1 Jul 2012 11:39:40 +0800
> Hunt Xu <mhuntxu@gmail.com> 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?

I've picked this one up for -fixes, cc stable, becaus it fixes an OOPS for
compiled-in i915.ko and CONFIG_PM=n. Thanks for the patch.
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] drm/i915: make rc6 in sysfs functions conditional
@ 2012-07-01  3:45 Hunt Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Hunt Xu @ 2012-07-01  3:45 UTC (permalink / raw)
  To: intel-gfx

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.

Signed-off-by: Hunt Xu <mhuntxu@gmail.com>
---
 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 <linux/sysfs.h>
 #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 */
-- 
1.7.11.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-06 17:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1341113980-6211-1-git-send-email-mhuntxu+intelgfx@gmail.com>
2012-07-01 16:50 ` [PATCH] drm/i915: make rc6 in sysfs functions conditional Ben Widawsky
2012-08-06 17:45   ` Daniel Vetter
2012-07-01  3:45 Hunt Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).