* [PATCH] drm/i915: get/put runtime PM at i915_semaphore_status
@ 2014-07-09 17:31 Paulo Zanoni
2014-07-09 21:02 ` Ben Widawsky
0 siblings, 1 reply; 3+ messages in thread
From: Paulo Zanoni @ 2014-07-09 17:31 UTC (permalink / raw)
To: intel-gfx; +Cc: Ben Widawsky, Paulo Zanoni
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
Otherwise we will print some WARNs when we read registers and the
machine is suspended.
Testcase: igt/pm_rpm/debugfs-read
Cc: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 2 ++
1 file changed, 2 insertions(+)
I still dream with the day we will have a system that will run IGT on our
patches/series _before_ they are applied to the tree, and tell us in case some
testcase fails or gives us a WARN.
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 0c665df..1ff56ec 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2316,6 +2316,7 @@ static int i915_semaphore_status(struct seq_file *m, void *unused)
ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
return ret;
+ intel_runtime_pm_get(dev_priv);
if (IS_BROADWELL(dev)) {
struct page *page;
@@ -2365,6 +2366,7 @@ static int i915_semaphore_status(struct seq_file *m, void *unused)
}
seq_putc(m, '\n');
+ intel_runtime_pm_put(dev_priv);
mutex_unlock(&dev->struct_mutex);
return 0;
}
--
2.0.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: get/put runtime PM at i915_semaphore_status
2014-07-09 17:31 [PATCH] drm/i915: get/put runtime PM at i915_semaphore_status Paulo Zanoni
@ 2014-07-09 21:02 ` Ben Widawsky
2014-07-10 6:33 ` Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Ben Widawsky @ 2014-07-09 21:02 UTC (permalink / raw)
To: Paulo Zanoni; +Cc: intel-gfx, Paulo Zanoni
On Wed, Jul 09, 2014 at 02:31:57PM -0300, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> Otherwise we will print some WARNs when we read registers and the
> machine is suspended.
Do all register reads really require this? If so, shouldn't it work
similarly to forcewake? I didn't follow any of the PM mails, so feel
free to ignore if this has been discussed and addressed already.
>
> Testcase: igt/pm_rpm/debugfs-read
> Cc: Ben Widawsky <ben@bwidawsk.net>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> I still dream with the day we will have a system that will run IGT on our
> patches/series _before_ they are applied to the tree, and tell us in case some
> testcase fails or gives us a WARN.
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 0c665df..1ff56ec 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2316,6 +2316,7 @@ static int i915_semaphore_status(struct seq_file *m, void *unused)
> ret = mutex_lock_interruptible(&dev->struct_mutex);
> if (ret)
> return ret;
> + intel_runtime_pm_get(dev_priv);
>
> if (IS_BROADWELL(dev)) {
> struct page *page;
> @@ -2365,6 +2366,7 @@ static int i915_semaphore_status(struct seq_file *m, void *unused)
> }
> seq_putc(m, '\n');
>
> + intel_runtime_pm_put(dev_priv);
> mutex_unlock(&dev->struct_mutex);
> return 0;
> }
> --
> 2.0.0
>
--
Ben Widawsky, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: get/put runtime PM at i915_semaphore_status
2014-07-09 21:02 ` Ben Widawsky
@ 2014-07-10 6:33 ` Daniel Vetter
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2014-07-10 6:33 UTC (permalink / raw)
To: Ben Widawsky; +Cc: intel-gfx, Paulo Zanoni
On Wed, Jul 09, 2014 at 02:02:27PM -0700, Ben Widawsky wrote:
> On Wed, Jul 09, 2014 at 02:31:57PM -0300, Paulo Zanoni wrote:
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> >
> > Otherwise we will print some WARNs when we read registers and the
> > machine is suspended.
>
> Do all register reads really require this? If so, shouldn't it work
> similarly to forcewake? I didn't follow any of the PM mails, so feel
> free to ignore if this has been discussed and addressed already.
All need them, but wake-up can potentially sleep. Which means we can't
wake-up from the interrupt handler. Due to that I much prefer explicit
management of the runtime pm reference - it makes it clear that something
is going on and it's not just magic.
We've talked about grabbing a runtime pm ref unconditionally for all
debugfs files but for the sw state files (e.g. gem stuff) it's not
required. And the _get might hang and so could hamper debuggability. In
any case we have nice testcases so can automatically hit any issues like
this one here.
>
> >
> > Testcase: igt/pm_rpm/debugfs-read
> > Cc: Ben Widawsky <ben@bwidawsk.net>
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Queued for -next, thanks for the patch.
-Daniel
>
> > ---
> > drivers/gpu/drm/i915/i915_debugfs.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > I still dream with the day we will have a system that will run IGT on our
> > patches/series _before_ they are applied to the tree, and tell us in case some
> > testcase fails or gives us a WARN.
> >
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index 0c665df..1ff56ec 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -2316,6 +2316,7 @@ static int i915_semaphore_status(struct seq_file *m, void *unused)
> > ret = mutex_lock_interruptible(&dev->struct_mutex);
> > if (ret)
> > return ret;
> > + intel_runtime_pm_get(dev_priv);
> >
> > if (IS_BROADWELL(dev)) {
> > struct page *page;
> > @@ -2365,6 +2366,7 @@ static int i915_semaphore_status(struct seq_file *m, void *unused)
> > }
> > seq_putc(m, '\n');
> >
> > + intel_runtime_pm_put(dev_priv);
> > mutex_unlock(&dev->struct_mutex);
> > return 0;
> > }
> > --
> > 2.0.0
> >
>
> --
> Ben Widawsky, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-10 6:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-09 17:31 [PATCH] drm/i915: get/put runtime PM at i915_semaphore_status Paulo Zanoni
2014-07-09 21:02 ` Ben Widawsky
2014-07-10 6:33 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox