Skip to contentSkip to conversation

drm/i915/bdw: cancel the SW turbo tasks before runtime suspending

PATCH In review Paulo Zanoni 3 participants 5 messages Sep 4, 2014 – Sep 17, 2014

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

PATCH 1/1 drm/i915/bdw: cancel the SW turbo tasks before runtime suspending

From: Paulo Zanoni <[email protected]>

If we don't cancel them, we may end up running them while the device is runtime suspended, which will trigger lots and lots of WARNs on dmesg.

Regression introduced by:
commit c76bb61a71083b2d90504cc6d0dda2047c5d63ca

Author: Daisy Sun <[email protected]>
Date:   Mon Aug 11 11:08:38 2014 -0700

drm/i915/bdw: BDW Software Turbo

Testcase: igt/pm_rpm/gem-execbuf (you may have to run it a few times)

---
 drivers/gpu/drm/i915/i915_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +4 -0
index 8ff3755..4ce217b 100644
@@ -1448,6 +1448,10 @@ static int intel_runtime_suspend(struct device *device)
 	 * intel_mark_idle().
 	 */
 	cancel_work_sync(&dev_priv->rps.work);
+	if (dev_priv->rps.is_bdw_sw_turbo) {
+		del_timer_sync(&dev_priv->rps.sw_turbo.flip_timer);
+		cancel_work_sync(&dev_priv->rps.sw_turbo.work_max_freq);
+	}
 	intel_runtime_pm_disable_interrupts(dev);
 
 	ret = intel_suspend_complete(dev_priv);
Signature · 1 line
2.1.0
#1 lore raw
Quoted 6 lines · Paulo Zanoni

From: Paulo Zanoni <[email protected]>

If we don't cancel them, we may end up running them while the device is runtime suspended, which will trigger lots and lots of WARNs on dmesg.

Quoted 8 lines

Regression introduced by:
commit c76bb61a71083b2d90504cc6d0dda2047c5d63ca

Author: Daisy Sun <[email protected]>
Date:   Mon Aug 11 11:08:38 2014 -0700

drm/i915/bdw: BDW Software Turbo

Testcase: igt/pm_rpm/gem-execbuf (you may have to run it a few times)

Please don't forget to cc relevant people when you fix a regression. -Daniel

Quoted 26 lines
---
 drivers/gpu/drm/i915/i915_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +4 -0
index 8ff3755..4ce217b 100644
@@ -1448,6 +1448,10 @@ static int intel_runtime_suspend(struct device *device)
 	 * intel_mark_idle().
 	 */
 	cancel_work_sync(&dev_priv->rps.work);
+	if (dev_priv->rps.is_bdw_sw_turbo) {
+		del_timer_sync(&dev_priv->rps.sw_turbo.flip_timer);
+		cancel_work_sync(&dev_priv->rps.sw_turbo.work_max_freq);
+	}
 	intel_runtime_pm_disable_interrupts(dev);
 
 	ret = intel_suspend_complete(dev_priv);
Signature · 6 lines
2.1.0

_______________________________________________
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
#2 lore raw
In reply to Paulo Zanoni

(adding Daisy Sun to the conversation)

2014-09-04 18:07 GMT-03:00 Paulo Zanoni <[email protected]>:

Quoted 36 lines

From: Paulo Zanoni <[email protected]>

If we don't cancel them, we may end up running them while the device is runtime suspended, which will trigger lots and lots of WARNs on dmesg.

Regression introduced by:
commit c76bb61a71083b2d90504cc6d0dda2047c5d63ca

Author: Daisy Sun <[email protected]>
Date:   Mon Aug 11 11:08:38 2014 -0700

drm/i915/bdw: BDW Software Turbo

Testcase: igt/pm_rpm/gem-execbuf (you may have to run it a few times)

---
 drivers/gpu/drm/i915/i915_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +4 -1
index 8ff3755..4ce217b 100644
@@ -1448,6 +1448,10 @@ static int intel_runtime_suspend(struct device *device)
         * intel_mark_idle().
         */
        cancel_work_sync(&dev_priv->rps.work);
+       if (dev_priv->rps.is_bdw_sw_turbo) {
+               del_timer_sync(&dev_priv->rps.sw_turbo.flip_timer);
+               cancel_work_sync(&dev_priv->rps.sw_turbo.work_max_freq);
+       }
        intel_runtime_pm_disable_interrupts(dev);
 
        ret = intel_suspend_complete(dev_priv);
--

2.1.0

Signature · 1 line
Paulo Zanoni
#3 lore raw

Need to reset the flip_received flag at the end of this block, indicate that the flip interrupt will stop working.

+ if (dev_priv->rps.is_bdw_sw_turbo) {
+ del_timer_sync(&dev_priv->rps.sw_turbo.flip_timer);
+ cancel_work_sync(&dev_priv->rps.sw_turbo.work_max_freq);
+ atomic_set(&dev_priv->rps.sw_turbo.flip_received, false);
+ }

- Daisy

Quoted 41 lines · Paulo Zanoni

(adding Daisy Sun to the conversation)

2014-09-04 18:07 GMT-03:00 Paulo Zanoni <[email protected]>:

Quoted 36 lines

From: Paulo Zanoni <[email protected]>

If we don't cancel them, we may end up running them while the device is runtime suspended, which will trigger lots and lots of WARNs on dmesg.

Regression introduced by:
commit c76bb61a71083b2d90504cc6d0dda2047c5d63ca

Author: Daisy Sun <[email protected]>
Date:   Mon Aug 11 11:08:38 2014 -0700

drm/i915/bdw: BDW Software Turbo

Testcase: igt/pm_rpm/gem-execbuf (you may have to run it a few times)

---
  drivers/gpu/drm/i915/i915_drv.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +4 -1
index 8ff3755..4ce217b 100644
@@ -1448,6 +1448,10 @@ static int intel_runtime_suspend(struct device *device)
          * intel_mark_idle().
          */
         cancel_work_sync(&dev_priv->rps.work);
+       if (dev_priv->rps.is_bdw_sw_turbo) {
+               del_timer_sync(&dev_priv->rps.sw_turbo.flip_timer);
+               cancel_work_sync(&dev_priv->rps.sw_turbo.work_max_freq);
+       }
         intel_runtime_pm_disable_interrupts(dev);
 
         ret = intel_suspend_complete(dev_priv);
--

2.1.0

#4 lore raw

PATCH 1/1 drm/i915/bdw: cancel the SW turbo tasks before runtime suspending

From: Paulo Zanoni <[email protected]>

If we don't cancel them, we may end up running them while the device is runtime suspended, which will trigger lots and lots of WARNs on dmesg.

Regression introduced by:
commit c76bb61a71083b2d90504cc6d0dda2047c5d63ca

Author: Daisy Sun <[email protected]>
Date:   Mon Aug 11 11:08:38 2014 -0700

drm/i915/bdw: BDW Software Turbo

v2: Also set flip_received to false (Daisy)

Testcase: igt/pm_rpm/gem-execbuf (you may have to run it a few times)

---
 drivers/gpu/drm/i915/i915_drv.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +5 -0
index b8bd008..857f0f9 100644
@@ -1447,6 +1447,11 @@ static int intel_runtime_suspend(struct device *device)
 	 * intel_mark_idle().
 	 */
 	cancel_work_sync(&dev_priv->rps.work);
+	if (dev_priv->rps.is_bdw_sw_turbo) {
+		del_timer_sync(&dev_priv->rps.sw_turbo.flip_timer);
+		cancel_work_sync(&dev_priv->rps.sw_turbo.work_max_freq);
+		atomic_set(&dev_priv->rps.sw_turbo.flip_received, false);
+	}
 	intel_runtime_pm_disable_interrupts(dev);
 
 	ret = intel_suspend_complete(dev_priv);
Signature · 1 line
2.1.0