Skip to contentSkip to conversation

drm/i915: get/put runtime PM at i915_semaphore_status

PATCH Applied Paulo Zanoni 3 participants 3 messages Jul 9, 2014 – Jul 10, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: get/put runtime PM at i915_semaphore_status

From: Paulo Zanoni <[email protected]>

Otherwise we will print some WARNs when we read registers and the machine is suspended.

Testcase: igt/pm_rpm/debugfs-read

---
 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.

drivers/gpu/drm/i915/i915_debugfs.c +2 -0
index 0c665df..1ff56ec 100644
@@ -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;
 }
Signature · 1 line
2.0.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Paulo Zanoni

From: Paulo Zanoni <[email protected]>

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.

Quoted 4 lines

Testcase: igt/pm_rpm/debugfs-read

Quoted 31 lines
---
 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.

drivers/gpu/drm/i915/i915_debugfs.c +2 -0
index 0c665df..1ff56ec 100644
@@ -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;
 }
Signature · 1 line
2.0.0
Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center
#2 lore raw
Quoted 9 lines · Ben Widawsky
Quoted 4 lines · Paulo Zanoni

From: Paulo Zanoni <[email protected]>

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.

Quoted 7 lines
Quoted 5 lines

Testcase: igt/pm_rpm/debugfs-read

Queued for -next, thanks for the patch.
-Daniel

Quoted 39 lines
Quoted 32 lines
---
 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.

drivers/gpu/drm/i915/i915_debugfs.c +2 -0
index 0c665df..1ff56ec 100644
@@ -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;
 }
Signature · 1 line
2.0.0
Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch