Skip to contentSkip to conversation

drm/i915: Fix mismatched INIT power domain disabling during suspend

PATCH In review Imre Deak 4 participants 7 messages Oct 13, 2016 – Oct 14, 2016

Subsystems (2)
lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 1/1 drm/i915: Fix mismatched INIT power domain disabling during suspend

Currently the display INIT power domain disabling/enabling happens in a mismatched way in the suspend/resume_early hooks respectively. This can leave display power wells incorrectly disabled in the resume hook if the suspend sequence is aborted for some reason resulting in the suspend/resume hooks getting called but the suspend_late/resume_early hooks being skipped. In particular this change fixes "Unclaimed read from register 0x1e1204" on BYT/BSW triggered from i915_drm_resume()-> intel_pps_unlock_regs_wa() when suspending with /sys/power/pm_test set to devices.

Cc Ville Syrjälä <[email protected]>
Cc David Weinehall <[email protected]>
---
 drivers/gpu/drm/i915/i915_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -2
index e9b3bfc..5adabac 100644
@@ -1430,8 +1430,6 @@ static int i915_drm_suspend(struct drm_device *dev)
 
 	dev_priv->suspend_count++;
 
-	intel_display_set_init_power(dev_priv, false);
-
 	intel_csr_ucode_suspend(dev_priv);
 
 out:
@@ -1449,6 +1447,8 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
 
 	disable_rpm_wakeref_asserts(dev_priv);
 
+	intel_display_set_init_power(dev_priv, false);
+
 	fw_csr = !IS_BROXTON(dev_priv) &&
 		suspend_to_idle(dev_priv) && dev_priv->csr.dmc_payload;
 	/*
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#1 lore raw
Quoted 10 lines · Imre Deak

Currently the display INIT power domain disabling/enabling happens in a mismatched way in the suspend/resume_early hooks respectively. This can leave display power wells incorrectly disabled in the resume hook if the suspend sequence is aborted for some reason resulting in the suspend/resume hooks getting called but the suspend_late/resume_early hooks being skipped. In particular this change fixes "Unclaimed read from register 0x1e1204" on BYT/BSW triggered from i915_drm_resume()-> intel_pps_unlock_regs_wa() when suspending with /sys/power/pm_test set to devices.

Quoted 3 lines
Cc Ville Syrjälä <[email protected]>
Cc David Weinehall <[email protected]>
Fixes ?
Quoted 26 lines
---
 drivers/gpu/drm/i915/i915_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -2
index e9b3bfc..5adabac 100644
@@ -1430,8 +1430,6 @@ static int i915_drm_suspend(struct drm_device *dev)
 
 	dev_priv->suspend_count++;
 
-	intel_display_set_init_power(dev_priv, false);
-
 	intel_csr_ucode_suspend(dev_priv);
 
 out:
@@ -1449,6 +1447,8 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
 
 	disable_rpm_wakeref_asserts(dev_priv);
 
+	intel_display_set_init_power(dev_priv, false);
+
 	fw_csr = !IS_BROXTON(dev_priv) &&
 		suspend_to_idle(dev_priv) && dev_priv->csr.dmc_payload;
 	/*
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#2 lore raw
Quoted 11 lines · Jani Nikula
Quoted 10 lines · Imre Deak

Currently the display INIT power domain disabling/enabling happens in a mismatched way in the suspend/resume_early hooks respectively. This can leave display power wells incorrectly disabled in the resume hook if the suspend sequence is aborted for some reason resulting in the suspend/resume hooks getting called but the suspend_late/resume_early hooks being skipped. In particular this change fixes "Unclaimed read from register 0x1e1204" on BYT/BSW triggered from i915_drm_resume()-> intel_pps_unlock_regs_wa() when suspending with /sys/power/pm_test set to devices.

Quoted 5 lines
Quoted 3 lines
Cc Ville Syrjälä <[email protected]>
Cc David Weinehall <[email protected]>
Fixes ?
Fixes 85e90679335f ("drm/i915: disable power wells on suspend")
Quoted 1 line

It matters only for an error path which is rare (another device needs to fail suspending between its suspend and suspend_late steps) and pm_test. So I'd say this isn't for fixes or stable.

--Imre

Quoted 29 lines
Quoted 29 lines

---
 drivers/gpu/drm/i915/i915_drv.c | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index e9b3bfc..5adabac 100644
@@ -1430,8 +1430,6 @@ static int i915_drm_suspend(struct drm_device
 *dev)


  dev_priv->suspend_count++;

drivers/gpu/drm/i915/i915_drv.c +0 -2
-	intel_display_set_init_power(dev_priv, false);
-

  intel_csr_ucode_suspend(dev_priv);

 out:

drivers/gpu/drm/i915/i915_drv.c +0 -0
@@ -1449,6 +1447,8 @@ static int i915_drm_suspend_late(struct
 drm_device *dev, bool hibernation)


  disable_rpm_wakeref_asserts(dev_priv);

drivers/gpu/drm/i915/i915_drv.c +2 -0
+	intel_display_set_init_power(dev_priv, false);
+

  fw_csr = !IS_BROXTON(dev_priv) && suspend_to_idle(dev_priv) && dev_priv-

Quoted 3 lines
Quoted 2 lines
Quoted 1 line

csr.dmc_payload;

  /*

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#3 lore raw
In reply to Imre Deak
Quoted 31 lines · Imre Deak

Currently the display INIT power domain disabling/enabling happens in a mismatched way in the suspend/resume_early hooks respectively. This can leave display power wells incorrectly disabled in the resume hook if the suspend sequence is aborted for some reason resulting in the suspend/resume hooks getting called but the suspend_late/resume_early hooks being skipped. In particular this change fixes "Unclaimed read from register 0x1e1204" on BYT/BSW triggered from i915_drm_resume()-> intel_pps_unlock_regs_wa() when suspending with /sys/power/pm_test set to devices.

Cc Ville Syrjälä <[email protected]>
Cc David Weinehall <[email protected]>
---
 drivers/gpu/drm/i915/i915_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -2
index e9b3bfc..5adabac 100644
@@ -1430,8 +1430,6 @@ static int i915_drm_suspend(struct drm_device *dev)
 
 	dev_priv->suspend_count++;
 
-	intel_display_set_init_power(dev_priv, false);
-
 	intel_csr_ucode_suspend(dev_priv);
 
 out:

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation) · line 1451

Quoted 5 lines
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -1449,6 +1447,8 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
 
 	disable_rpm_wakeref_asserts(dev_priv);
 
+	intel_display_set_init_power(dev_priv, false);
+

Makes sense in most cases.

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation) · line 1453

Quoted 2 lines
drivers/gpu/drm/i915/i915_drv.c +0 -0
 	fw_csr = !IS_BROXTON(dev_priv) &&
 		suspend_to_idle(dev_priv) && dev_priv->csr.dmc_payload;

However this part is quite confusing. We do the init_power_put unconditionally, but the init_power_get is done from the init_hw() which is conditional on this supend_to_idle special casing. So it seems quite assymmetrical, and I can no longer claim to understand it.

Quoted 3 lines
drivers/gpu/drm/i915/i915_drv.c +0 -0
 	/*
Signature · 1 line
2.5.0
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#4 lore raw
Quoted 41 lines · Ville Syrjälä
Quoted 34 lines · Imre Deak

Currently the display INIT power domain disabling/enabling happens in a mismatched way in the suspend/resume_early hooks respectively. This can leave display power wells incorrectly disabled in the resume hook if the suspend sequence is aborted for some reason resulting in the suspend/resume hooks getting called but the suspend_late/resume_early hooks being skipped. In particular this change fixes "Unclaimed read from register 0x1e1204" on BYT/BSW triggered from i915_drm_resume()-> intel_pps_unlock_regs_wa() when suspending with /sys/power/pm_test set to devices.

Cc Ville Syrjälä <[email protected]>
Cc David Weinehall <[email protected]>

---
 drivers/gpu/drm/i915/i915_drv.c | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -0
index e9b3bfc..5adabac 100644
@@ -1430,8 +1430,6 @@ static int i915_drm_suspend(struct drm_device *dev)


  dev_priv->suspend_count++;

drivers/gpu/drm/i915/i915_drv.c +0 -2
-	intel_display_set_init_power(dev_priv, false);
-

  intel_csr_ucode_suspend(dev_priv);

 out:

drivers/gpu/drm/i915/i915_drv.c +0 -0
@@ -1449,6 +1447,8 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)


  disable_rpm_wakeref_asserts(dev_priv);

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation) · line 1451

Quoted 2 lines
drivers/gpu/drm/i915/i915_drv.c +2 -0
+	intel_display_set_init_power(dev_priv, false);
+

Makes sense in most cases.

Quoted 7 lines
Quoted 2 lines

  fw_csr = !IS_BROXTON(dev_priv) && suspend_to_idle(dev_priv) && dev_priv->csr.dmc_payload;

However this part is quite confusing. We do the init_power_put unconditionally, but the init_power_get is done from the init_hw() which is conditional on this supend_to_idle special casing. So it seems quite assymmetrical, and I can no longer claim to understand it.

Yep, that's a problem of its own for the suspend-to-idle case, enabling the INIT domain should be also unconditional and happen from this function. I suppose this happened to work so far since it only applies to SKL where nothing depended on the INIT domain, everything takes its own domain ref. Will look into fixing this.

--Imre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

✗ Fi.CI.BAT: warning for drm/i915: Fix mismatched INIT power domain disabling during suspend

In reply to Imre Deak
== Series Details ==

== Series Details ==

Series: drm/i915: Fix mismatched INIT power domain disabling during suspend
URL : https://patchwork.freedesktop.org/series/13723/
State : warning

== Summary ==

Series 13723v1 drm/i915: Fix mismatched INIT power domain disabling during suspend
https://patchwork.freedesktop.org/api/1.0/series/13723/revisions/1/mbox/

Test drv_module_reload_basic:

                skip       -> PASS       (fi-skl-6770hq)
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-a:
                pass       -> DMESG-WARN (fi-ilk-650)
fi-bdw-5557u     total:246  pass:231  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:246  pass:204  dwarn:0   dfail:0   fail:0   skip:42 
fi-bxt-t5700     total:246  pass:216  dwarn:0   dfail:0   fail:0   skip:30 
fi-byt-j1900     total:246  pass:212  dwarn:2   dfail:0   fail:1   skip:31 
fi-byt-n2820     total:246  pass:210  dwarn:0   dfail:0   fail:1   skip:35 
fi-hsw-4770      total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-hsw-4770r     total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-ilk-650       total:246  pass:183  dwarn:1   dfail:0   fail:2   skip:60 
fi-ivb-3520m     total:246  pass:221  dwarn:0   dfail:0   fail:0   skip:25 
fi-ivb-3770      total:246  pass:221  dwarn:0   dfail:0   fail:0   skip:25 
fi-kbl-7200u     total:246  pass:222  dwarn:0   dfail:0   fail:0   skip:24 
fi-skl-6260u     total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:246  pass:223  dwarn:0   dfail:0   fail:0   skip:23 
fi-skl-6700k     total:246  pass:221  dwarn:1   dfail:0   fail:0   skip:24 
fi-skl-6770hq    total:246  pass:230  dwarn:1   dfail:0   fail:1   skip:14 
fi-snb-2520m     total:246  pass:210  dwarn:0   dfail:0   fail:0   skip:36 
fi-snb-2600      total:246  pass:209  dwarn:0   dfail:0   fail:0   skip:37 

Results at /archive/results/CI_IGT_test/Patchwork_2715/

fc23e80caa1a394f92ca132b2d19ac926bd2c803 drm-intel-nightly: 2016y-10m-14d-09h-02m-51s UTC integration manifest 6a2e371 drm/i915: Fix mismatched INIT power domain disabling during suspend

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

author
#6 lore raw

Re: ✗ Fi.CI.BAT: warning for drm/i915: Fix mismatched INIT power domain disabling during suspend

Quoted 14 lines · Patchwork

== Series Details ==

Series: drm/i915: Fix mismatched INIT power domain disabling during suspend
URL   : https://patchwork.freedesktop.org/series/13723/
State : warning

== Summary ==

Series 13723v1 drm/i915: Fix mismatched INIT power domain disabling during suspend
https://patchwork.freedesktop.org/api/1.0/series/13723/revisions/1/mb
ox/

Quoted 5 lines

Test drv_module_reload_basic:
                skip       -> PASS       (fi-skl-6770hq) Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-a:
                pass       -> DMESG-WARN (fi-ilk-650)

[  469.277956] [drm:intel_dp_check_link_status [i915]] DP C: channel EQ not ok, retraining [  469.278371] [drm:intel_dp_set_signal_levels [i915]] Using signal levels 00000000
[  469.278414] [drm:intel_dp_set_signal_levels [i915]] Using vswing level 0
[  469.278455] [drm:intel_dp_set_signal_levels [i915]] Using pre-emphasis level 0
[  469.278499] [drm:intel_dp_program_link_training_pattern [i915]] Using DP training pattern TPS1 [  469.279490] [drm:intel_dp_set_signal_levels [i915]] Using signal levels 02000000
[  469.279533] [drm:intel_dp_set_signal_levels [i915]] Using vswing level 1
[  469.279575] [drm:intel_dp_set_signal_levels [i915]] Using pre-emphasis level 0
[  469.280337] [drm:intel_dp_start_link_train [i915]] clock recovery OK
[  469.280354] [drm:intel_dp_program_link_training_pattern [i915]] Using DP training pattern TPS2 [  469.281372] [drm:intel_dp_start_link_train [i915]] Channel EQ done. DP Training successful [  469.281869] [drm:drm_edid_to_eld] ELD monitor LEN LT2452pwC
[  469.281871] [drm:drm_edid_to_eld] ELD size 36, SAD count 1
[  469.281915] [drm:intel_pch_fifo_underrun_irq_handler [i915]] *ERROR* PCH transcoder B FIFO underrun [  469.281979] [drm:intel_cpu_fifo_underrun_irq_handler [i915]] *ERROR* CPU pipe B FIFO underrun

This happened earlier on the same machine, Ville is looking into suppressing the errors during link retraining.

Thanks for the review, pushed the patch to -dinq.

Quoted 36 lines

fi-bdw-
5557u     total:246  pass:231  dwarn:0   dfail:0   fail:0   skip:15 fi-bsw-
n3050     total:246  pass:204  dwarn:0   dfail:0   fail:0   skip:42 fi-bxt-
t5700     total:246  pass:216  dwarn:0   dfail:0   fail:0   skip:30 fi-byt-
j1900     total:246  pass:212  dwarn:2   dfail:0   fail:1   skip:31 fi-byt-
n2820     total:246  pass:210  dwarn:0   dfail:0   fail:1   skip:35 fi-hsw-
4770      total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 fi-hsw-
4770r     total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 fi-ilk-
650       total:246  pass:183  dwarn:1   dfail:0   fail:2   skip:60 fi-ivb-
3520m     total:246  pass:221  dwarn:0   dfail:0   fail:0   skip:25 fi-ivb-
3770      total:246  pass:221  dwarn:0   dfail:0   fail:0   skip:25 fi-kbl-
7200u     total:246  pass:222  dwarn:0   dfail:0   fail:0   skip:24 fi-skl-
6260u     total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 fi-skl-
6700hq    total:246  pass:223  dwarn:0   dfail:0   fail:0   skip:23 fi-skl-
6700k     total:246  pass:221  dwarn:1   dfail:0   fail:0   skip:24 fi-skl-
6770hq    total:246  pass:230  dwarn:1   dfail:0   fail:1   skip:14 fi-snb-
2520m     total:246  pass:210  dwarn:0   dfail:0   fail:0   skip:36 fi-snb-
2600      total:246  pass:209  dwarn:0   dfail:0   fail:0   skip:37

Quoted 7 lines

Results at /archive/results/CI_IGT_test/Patchwork_2715/

fc23e80caa1a394f92ca132b2d19ac926bd2c803 drm-intel-nightly: 2016y- 10m-14d-09h-02m-51s UTC integration manifest
6a2e371 drm/i915: Fix mismatched INIT power domain disabling during suspend

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx