i915: WARN_ON(val > dev_priv->rps.max_freq_softlimit)
Subsystems (2)
Michael Auchter
Reviewed-by Chris WilsonTesting out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0() WARN_ON(val > dev_priv->rps.max_freq_softlimit) Modules linked in: CPU: 0 PID: 989 Comm: kworker/0:2 Not tainted 3.19.0-rc6 #31 Hardware name: LENOVO 20A7002WUS/20A7002WUS, BIOS GRET38WW (1.15 ) 05/29/2014 Workqueue: events intel_gen6_powersave_work 0000000000000000 ffffffff81a82dd0 ffffffff817f099e ffff88021451bd28 ffffffff8107d107 ffff8802148e0000 0000000000000022 ffff8802148e86f0 ffff88021498f000 0000000000040000 ffffffff8107d185 ffffffff81a83448 Call Trace: [<ffffffff817f099e>] ? dump_stack+0x40/0x50 [<ffffffff8107d107>] ? warn_slowpath_common+0x77/0xb0 [<ffffffff8107d185>] ? warn_slowpath_fmt+0x45/0x50 [<ffffffff813c6ff1>] ? gen6_set_rps+0x371/0x3c0 [<ffffffff813caa10>] ? intel_gen6_powersave_work+0x780/0x1180 [<ffffffff81090c50>] ? process_one_work+0x130/0x350 [<ffffffff81091274>] ? worker_thread+0x114/0x450 [<ffffffff81091160>] ? rescuer_thread+0x2f0/0x2f0 [<ffffffff810954ec>] ? kthread+0xbc/0xe0 [<ffffffff81095430>] ? kthread_create_on_node+0x170/0x170 [<ffffffff817f86ac>] ? ret_from_fork+0x7c/0xb0 [<ffffffff81095430>] ? kthread_create_on_node+0x170/0x170 ---[ end trace c3ac159c87b9b234 ]---
I bisected this back to:
commit 93ee29203f506582cca2bcec5f05041526d9ab0a
Author: Tom O'Rourke <Tom.O'[email protected]> Date: Wed Nov 19 14:21:52 2014 -0800
drm/i915: Use efficient frequency for HSW/BDW
Added gen6_init_rps_frequencies() to initialize the rps frequency values. This function replaces parse_rp_state_cap(). In addition to reading RPn, RP0, and RP1 from RP_STATE_CAP register, the new function reads efficient frequency (aka RPe) from pcode for Haswell and Broadwell and sets the turbo softlimits. The turbo minimum frequency softlimit is set to RPe for Haswell and Broadwell and to RPn otherwise.
For RPe, the efficiency is based on the frequency/power ratio (MHz/W); this is considering GT power and not package power. The efficent frequency is the highest frequency for which the frequency/power ratio is within some threshold of the highest frequency/power ratio. A fixed decrease in frequency results in smaller decrease in power at frequencies less than RPe than at frequencies above RPe.
v2: Following suggestions from Chris Wilson and Daniel Vetter to extend and rename parse_rp_state_cap and to open-code a poorly named function.
I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when gen6_set_rps() is called with rps.min_freq_softlimit that warning is hit.
Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 68 lines · Michael Auchter
Testing out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0() WARN_ON(val > dev_priv->rps.max_freq_softlimit) Modules linked in: CPU: 0 PID: 989 Comm: kworker/0:2 Not tainted 3.19.0-rc6 #31 Hardware name: LENOVO 20A7002WUS/20A7002WUS, BIOS GRET38WW (1.15 ) 05/29/2014 Workqueue: events intel_gen6_powersave_work 0000000000000000 ffffffff81a82dd0 ffffffff817f099e ffff88021451bd28 ffffffff8107d107 ffff8802148e0000 0000000000000022 ffff8802148e86f0 ffff88021498f000 0000000000040000 ffffffff8107d185 ffffffff81a83448 Call Trace: [<ffffffff817f099e>] ? dump_stack+0x40/0x50 [<ffffffff8107d107>] ? warn_slowpath_common+0x77/0xb0 [<ffffffff8107d185>] ? warn_slowpath_fmt+0x45/0x50 [<ffffffff813c6ff1>] ? gen6_set_rps+0x371/0x3c0 [<ffffffff813caa10>] ? intel_gen6_powersave_work+0x780/0x1180 [<ffffffff81090c50>] ? process_one_work+0x130/0x350 [<ffffffff81091274>] ? worker_thread+0x114/0x450 [<ffffffff81091160>] ? rescuer_thread+0x2f0/0x2f0 [<ffffffff810954ec>] ? kthread+0xbc/0xe0 [<ffffffff81095430>] ? kthread_create_on_node+0x170/0x170 [<ffffffff817f86ac>] ? ret_from_fork+0x7c/0xb0 [<ffffffff81095430>] ? kthread_create_on_node+0x170/0x170 ---[ end trace c3ac159c87b9b234 ]---I bisected this back to:
commit
93ee29203f506582cca2bcec5f05041526d9ab0aAuthor: Tom O'Rourke <Tom.O'[email protected]> Date: Wed Nov 19 14:21:52 2014 -0800drm/i915: Use efficient frequency for HSW/BDW
Added
gen6_init_rps_frequencies()to initialize the rps frequency values. This function replacesparse_rp_state_cap(). In addition to reading RPn, RP0, and RP1 fromRP_STATE_CAPregister, the new function reads efficient frequency (aka RPe) from pcode for Haswell and Broadwell and sets the turbo softlimits. The turbo minimum frequency softlimit is set to RPe for Haswell and Broadwell and to RPn otherwise.For RPe, the efficiency is based on the frequency/power ratio (MHz/W); this is considering GT power and not package power. The efficent frequency is the highest frequency for which the frequency/power ratio is within some threshold of the highest frequency/power ratio. A fixed decrease in frequency results in smaller decrease in power at frequencies less than RPe than at frequencies above RPe.
v2: Following suggestions from Chris Wilson and Daniel Vetter to extend and rename
parse_rp_state_capand to open-code a poorly named function.Signed-off-by Tom O'Rourke <Tom.O'[email protected]>Reviewed-by Chris Wilson <[email protected]>[danvet: Remove unused variables.]Signed-off-by Daniel Vetter <[email protected]>I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
Quoted 7 lines
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when
gen6_set_rps()is called with rps.min_freq_softlimit that warning is hit.Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
Sounds like the rpe value on your firmware is rather bogus, and we probably need to sanity-check it. Tom?
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 5 lines · Michael Auchter
Testing out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0()
WARN_ON(val > dev_priv->rps.max_freq_softlimit)
[snip]
Quoted 5 lines
I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
Quoted 7 lines
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when
gen6_set_rps()is called with rps.min_freq_softlimit that warning is hit.Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
Very fishy indeed. Moral of this story, never trust hw.
drivers/gpu/drm/i915/intel_pm.c +4 -1
@@ -4007,7 +4007,10 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) &ddcc_status);if (0 == ret) dev_priv->rps.efficient_freq = - (ddcc_status >>8 ) &0xff ; +clamp_t (u8, + (ddcc_status >>8 ) &0xff , + dev_priv->rps.min_freq, + dev_priv->rps.max_freq); }/* Preserve min/max settings in case of re-init */
But really it is probably just best to disable the query for hsw:
drivers/gpu/drm/i915/intel_pm.c +1 -1
@@ -4001,7 +4001,7 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) dev_priv->rps.max_freq = dev_priv->rps.rp0_freq; dev_priv->rps.efficient_freq = dev_priv->rps.rp1_freq; -if (IS_HASWELL (dev) ||IS_BROADWELL (dev)) { +if (IS_BROADWELL (dev)) { ret =sandybridge_pcode_read (dev_priv,HSW_PCODE_DYNAMIC_DUTY_CYCLE_CONTROL , &ddcc_status);
Paranoia says we do both.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 29 lines · Chris Wilson
Quoted 5 lines · Michael Auchter
Testing out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0()
WARN_ON(val > dev_priv->rps.max_freq_softlimit)[snip]
Quoted 5 lines
I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
Quoted 7 lines
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when
gen6_set_rps()is called with rps.min_freq_softlimit that warning is hit.Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
Very fishy indeed. Moral of this story, never trust hw.
drivers/gpu/drm/i915/intel_pm.c +0
-0
drivers/gpu/drm/i915/intel_pm.c static void gen6_init_rps_frequencies(struct drm_device *dev) · line 4013
Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c +4
-1@@ -4007,7 +4007,10 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) &ddcc_status);if (0 == ret) dev_priv->rps.efficient_freq = - (ddcc_status >>8 ) &0xff ; +clamp_t (u8, + (ddcc_status >>8 ) &0xff , + dev_priv->rps.min_freq, + dev_priv->rps.max_freq);
Maybe better to fall back to rp1_freq if this is bogus?
Quoted 29 lines
drivers/gpu/drm/i915/intel_pm.c +0
-0}/* Preserve min/max settings in case of re-init */ But really it is probably just best to disable the query for hsw:
drivers/gpu/drm/i915/intel_pm.c +1
-1@@ -4001,7 +4001,7 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) dev_priv->rps.max_freq = dev_priv->rps.rp0_freq; dev_priv->rps.efficient_freq = dev_priv->rps.rp1_freq; -if (IS_HASWELL (dev) ||IS_BROADWELL (dev)) { +if (IS_BROADWELL (dev)) { ret =sandybridge_pcode_read (dev_priv,HSW_PCODE_DYNAMIC_DUTY_CYCLE_CONTROL , &ddcc_status);Paranoia says we do both.
-ChrisSignature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · Chris Wilson
Quoted 5 lines · Michael Auchter
Testing out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0()
WARN_ON(val > dev_priv->rps.max_freq_softlimit)[snip]
Quoted 5 lines
I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
Quoted 7 lines
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when
gen6_set_rps()is called with rps.min_freq_softlimit that warning is hit.Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
Very fishy indeed. Moral of this story, never trust hw.
Quoted 16 lines
drivers/gpu/drm/i915/intel_pm.c static void gen6_init_rps_frequencies(struct drm_device *dev) · line 4013
Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +4
-1@@ -4007,7 +4007,10 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) &ddcc_status);if (0 == ret) dev_priv->rps.efficient_freq = - (ddcc_status >>8 ) &0xff ; +clamp_t (u8, + (ddcc_status >>8 ) &0xff , + dev_priv->rps.min_freq, + dev_priv->rps.max_freq);Maybe better to fall back to
rp1_freqif this is bogus?
[TOR:] Michael, Thank you for bringing this problem to our attention.
Yes, this function needs some range checking to maintain RPn <= RPe <= RP0.
A value of 34 seems too high for RPe.
What values does the Carbon X1 (Haswell) have for RPn and RP0?
I agree with Ville that a bogus value from the pcode read should not be used. Simple clamping would set the min_freq to RP0; probably incorrect.
Tom O'Rourke
Quoted 23 lines
Quoted 23 lines
drivers/gpu/drm/i915/intel_pm.c +0
-0}/* Preserve min/max settings in case of re-init */ But really it is probably just best to disable the query for hsw:
drivers/gpu/drm/i915/intel_pm.c +1
-1@@ -4001,7 +4001,7 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) dev_priv->rps.max_freq = dev_priv->rps.rp0_freq; dev_priv->rps.efficient_freq = dev_priv->rps.rp1_freq; -if (IS_HASWELL (dev) ||IS_BROADWELL (dev)) { +if (IS_BROADWELL (dev)) { ret =sandybridge_pcode_read (dev_priv,HSW_PCODE_DYNAMIC_DUTY_CYCLE_CONTROL , &ddcc_status);Paranoia says we do both.
-Chris
Quoted 10 lines
Quoted 6 lines
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 42 lines · Tom
Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · Chris Wilson
Quoted 5 lines · Michael Auchter
Testing out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0()
WARN_ON(val > dev_priv->rps.max_freq_softlimit)[snip]
Quoted 5 lines
I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
Quoted 7 lines
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when
gen6_set_rps()is called with rps.min_freq_softlimit that warning is hit.Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
Very fishy indeed. Moral of this story, never trust hw.
Quoted 16 lines
drivers/gpu/drm/i915/intel_pm.c static void gen6_init_rps_frequencies(struct drm_device *dev) · line 4013
Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +4
-1@@ -4007,7 +4007,10 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) &ddcc_status);if (0 == ret) dev_priv->rps.efficient_freq = - (ddcc_status >>8 ) &0xff ; +clamp_t (u8, + (ddcc_status >>8 ) &0xff , + dev_priv->rps.min_freq, + dev_priv->rps.max_freq);Maybe better to fall back to
rp1_freqif this is bogus?
Quoted 7 lines
[TOR:] Michael, Thank you for bringing this problem to our attention.
Yes, this function needs some range checking to maintain RPn <= RPe <= RP0.
A value of 34 seems too high for RPe.
What values does the Carbon X1 (Haswell) have for RPn and RP0?
RPn is 4, and RP0 is 22.
Quoted 4 lines
I agree with Ville that a bogus value from the pcode read should not be used. Simple clamping would set the
min_freqto RP0; probably incorrect.
Quoted 35 lines
Tom O'Rourke
Quoted 33 lines
Quoted 29 lines
drivers/gpu/drm/i915/intel_pm.c +0
-0}/* Preserve min/max settings in case of re-init */ But really it is probably just best to disable the query for hsw:
drivers/gpu/drm/i915/intel_pm.c +1
-1@@ -4001,7 +4001,7 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) dev_priv->rps.max_freq = dev_priv->rps.rp0_freq; dev_priv->rps.efficient_freq = dev_priv->rps.rp1_freq; -if (IS_HASWELL (dev) ||IS_BROADWELL (dev)) { +if (IS_BROADWELL (dev)) { ret =sandybridge_pcode_read (dev_priv,HSW_PCODE_DYNAMIC_DUTY_CYCLE_CONTROL , &ddcc_status);Paranoia says we do both.
-ChrisSignature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 42 lines · Tom
Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · Chris Wilson
Quoted 5 lines · Michael Auchter
Testing out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0()
WARN_ON(val > dev_priv->rps.max_freq_softlimit)[snip]
Quoted 5 lines
I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
Quoted 7 lines
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when
gen6_set_rps()is called with rps.min_freq_softlimit that warning is hit.Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
Very fishy indeed. Moral of this story, never trust hw.
Quoted 16 lines
drivers/gpu/drm/i915/intel_pm.c static void gen6_init_rps_frequencies(struct drm_device *dev) · line 4013
Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +4
-1@@ -4007,7 +4007,10 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) &ddcc_status);if (0 == ret) dev_priv->rps.efficient_freq = - (ddcc_status >>8 ) &0xff ; +clamp_t (u8, + (ddcc_status >>8 ) &0xff , + dev_priv->rps.min_freq, + dev_priv->rps.max_freq);Maybe better to fall back to
rp1_freqif this is bogus?
Quoted 7 lines
[TOR:] Michael, Thank you for bringing this problem to our attention.
Yes, this function needs some range checking to maintain RPn <= RPe <= RP0.
A value of 34 seems too high for RPe.
What values does the Carbon X1 (Haswell) have for RPn and RP0?
4 & 22, already in Micheal's original bug report.
Tom, can you pls polish the clamping into a proper patch with m-l references?
Micheal, can you please test the first hunk from Chris (the one that adds the clamp) to make sure it does indeed address the WARN_ON you're seeing?
Thanks, Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 51 lines · Daniel Vetter
Quoted 42 lines · Tom
Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · Chris Wilson
Quoted 5 lines · Michael Auchter
Testing out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0()
WARN_ON(val > dev_priv->rps.max_freq_softlimit)[snip]
Quoted 5 lines
I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
Quoted 7 lines
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when
gen6_set_rps()is called with rps.min_freq_softlimit that warning is hit.Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
Very fishy indeed. Moral of this story, never trust hw.
Quoted 16 lines
drivers/gpu/drm/i915/intel_pm.c static void gen6_init_rps_frequencies(struct drm_device *dev) · line 4013
Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +4
-1@@ -4007,7 +4007,10 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) &ddcc_status);if (0 == ret) dev_priv->rps.efficient_freq = - (ddcc_status >>8 ) &0xff ; +clamp_t (u8, + (ddcc_status >>8 ) &0xff , + dev_priv->rps.min_freq, + dev_priv->rps.max_freq);Maybe better to fall back to
rp1_freqif this is bogus?Quoted 7 lines
[TOR:] Michael, Thank you for bringing this problem to our attention.
Yes, this function needs some range checking to maintain RPn <= RPe <= RP0.
A value of 34 seems too high for RPe.
What values does the Carbon X1 (Haswell) have for RPn and RP0?
Quoted 7 lines
4 & 22, already in Micheal's original bug report.
Tom, can you pls polish the clamping into a proper patch with m-l references?
Micheal, can you please test the first hunk from Chris (the one that adds the clamp) to make sure it does indeed address the
WARN_ONyou're seeing?
The clamp suggested by Chris does indeed fix the WARN_ON.
In the case where RPe is greater than RP0, RPe will now be clamped to RP0. Is this likely to result in increased power consumption?
At a quick glance on my laptop it does not (idling around 5W before and after) but Ville had suggested earlier to fall back to RP1, which would be more consistent with previous kernels.
Thanks again for the quick responses,
Michael
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 49 lines · Michael Auchter
Quoted 48 lines · Daniel Vetter
Quoted 47 lines · Tom
Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · Chris Wilson
Quoted 5 lines · Michael Auchter
Testing out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0()
WARN_ON(val > dev_priv->rps.max_freq_softlimit)[snip]
Quoted 5 lines
I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
Quoted 7 lines
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when
gen6_set_rps()is called with rps.min_freq_softlimit that warning is hit.Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
Very fishy indeed. Moral of this story, never trust hw.
Quoted 16 lines
drivers/gpu/drm/i915/intel_pm.c static void gen6_init_rps_frequencies(struct drm_device *dev) · line 4013
Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +4
-1@@ -4007,7 +4007,10 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) &ddcc_status);if (0 == ret) dev_priv->rps.efficient_freq = - (ddcc_status >>8 ) &0xff ; +clamp_t (u8, + (ddcc_status >>8 ) &0xff , + dev_priv->rps.min_freq, + dev_priv->rps.max_freq);Maybe better to fall back to
rp1_freqif this is bogus?[TOR:] Michael, Thank you for bringing this problem to our attention.
Yes, this function needs some range checking to maintain RPn <= RPe <= RP0.
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
A value of 34 seems too high for RPe.
What values does the Carbon X1 (Haswell) have for RPn and RP0?4 & 22, already in Micheal's original bug report.
Tom, can you pls polish the clamping into a proper patch with m-l references?
[TOR:] Yes, I will submit a polished patch with proper range checking.
Quoted 9 lines
Quoted 3 lines
Micheal, can you please test the first hunk from Chris (the one that adds the clamp) to make sure it does indeed address the
WARN_ONyou're seeing?The clamp suggested by Chris does indeed fix the
WARN_ON.In the case where RPe is greater than RP0, RPe will now be clamped to RP0. Is this likely to result in increased power consumption?
Quoted 6 lines
At a quick glance on my laptop it does not (idling around 5W before and after) but Ville had suggested earlier to fall back to RP1, which would be more consistent with previous kernels.
Thanks again for the quick responses,
Michael
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 65 lines · Michael Auchter
Quoted 51 lines · Daniel Vetter
Quoted 42 lines · Tom
Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · Chris Wilson
Quoted 5 lines · Michael Auchter
Testing out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0()
WARN_ON(val > dev_priv->rps.max_freq_softlimit)[snip]
Quoted 5 lines
I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
Quoted 7 lines
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when
gen6_set_rps()is called with rps.min_freq_softlimit that warning is hit.Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
Very fishy indeed. Moral of this story, never trust hw.
Quoted 16 lines
drivers/gpu/drm/i915/intel_pm.c static void gen6_init_rps_frequencies(struct drm_device *dev) · line 4013
Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +4
-1@@ -4007,7 +4007,10 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) &ddcc_status);if (0 == ret) dev_priv->rps.efficient_freq = - (ddcc_status >>8 ) &0xff ; +clamp_t (u8, + (ddcc_status >>8 ) &0xff , + dev_priv->rps.min_freq, + dev_priv->rps.max_freq);Maybe better to fall back to
rp1_freqif this is bogus?Quoted 7 lines
[TOR:] Michael, Thank you for bringing this problem to our attention.
Yes, this function needs some range checking to maintain RPn <= RPe <= RP0.
A value of 34 seems too high for RPe.
What values does the Carbon X1 (Haswell) have for RPn and RP0?Quoted 7 lines
4 & 22, already in Micheal's original bug report.
Tom, can you pls polish the clamping into a proper patch with m-l references?
Micheal, can you please test the first hunk from Chris (the one that adds the clamp) to make sure it does indeed address the
WARN_ONyou're seeing?The clamp suggested by Chris does indeed fix the
WARN_ON.In the case where RPe is greater than RP0, RPe will now be clamped to RP0. Is this likely to result in increased power consumption?
Quoted 6 lines
At a quick glance on my laptop it does not (idling around 5W before and after) but Ville had suggested earlier to fall back to RP1, which would be more consistent with previous kernels.
Thanks again for the quick responses,
Michael
[TOR:] Michael, I discussed this report with a pcode architect here.
The RPe value is clamped to the [RPn, RP0] range by pcode before returning the value to the driver on Broadwell but not on Haswell.
On Haswell, an efficient frequency value above RP0 is not a garbage value and could result from a relatively flat efficiency curve. In this situation, leakage power would dominate the efficiency curve such that running at lower frequencies may not save power overall. Higher leakage power may result from a higher package temperature.
Running at RP0 may actually save power compared to RP1 by allowing more time in RC6.
Thanks,
Tom O'Rourke
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 78 lines · Tom
Quoted 65 lines · Michael Auchter
Quoted 51 lines · Daniel Vetter
Quoted 42 lines · Tom
Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · Chris Wilson
Quoted 5 lines · Michael Auchter
Testing out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0()
WARN_ON(val > dev_priv->rps.max_freq_softlimit)[snip]
Quoted 5 lines
I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
Quoted 7 lines
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when
gen6_set_rps()is called with rps.min_freq_softlimit that warning is hit.Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
Very fishy indeed. Moral of this story, never trust hw.
Quoted 16 lines
drivers/gpu/drm/i915/intel_pm.c static void gen6_init_rps_frequencies(struct drm_device *dev) · line 4013
Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +4
-1@@ -4007,7 +4007,10 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) &ddcc_status);if (0 == ret) dev_priv->rps.efficient_freq = - (ddcc_status >>8 ) &0xff ; +clamp_t (u8, + (ddcc_status >>8 ) &0xff , + dev_priv->rps.min_freq, + dev_priv->rps.max_freq);Maybe better to fall back to
rp1_freqif this is bogus?Quoted 7 lines
[TOR:] Michael, Thank you for bringing this problem to our attention.
Yes, this function needs some range checking to maintain RPn <= RPe <= RP0.
A value of 34 seems too high for RPe.
What values does the Carbon X1 (Haswell) have for RPn and RP0?Quoted 7 lines
4 & 22, already in Micheal's original bug report.
Tom, can you pls polish the clamping into a proper patch with m-l references?
Micheal, can you please test the first hunk from Chris (the one that adds the clamp) to make sure it does indeed address the
WARN_ONyou're seeing?The clamp suggested by Chris does indeed fix the
WARN_ON.In the case where RPe is greater than RP0, RPe will now be clamped to RP0. Is this likely to result in increased power consumption?
Quoted 6 lines
At a quick glance on my laptop it does not (idling around 5W before and after) but Ville had suggested earlier to fall back to RP1, which would be more consistent with previous kernels.
Thanks again for the quick responses,
Michael[TOR:] Michael, I discussed this report with a pcode architect here.
The RPe value is clamped to the [RPn, RP0] range by pcode before returning the value to the driver on Broadwell but not on Haswell.
Quoted 8 lines
On Haswell, an efficient frequency value above RP0 is not a garbage value and could result from a relatively flat efficiency curve. In this situation, leakage power would dominate the efficiency curve such that running at lower frequencies may not save power overall. Higher leakage power may result from a higher package temperature.
Running at RP0 may actually save power compared to RP1 by allowing more time in RC6.
Hm, I'd just go with clamping since that's what bdw does too. So Chris diff essentially.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 85 lines · Daniel Vetter
Quoted 84 lines · Tom
Quoted 65 lines · Michael Auchter
Quoted 51 lines · Daniel Vetter
Quoted 42 lines · Tom
Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · Chris Wilson
Quoted 5 lines · Michael Auchter
Testing out 3.19-rc6 on my 2014 Thinkpad X1 Carbon (Haswell) resulted in this WARN at boot (and pretty frequently afterwards):
WARNING: CPU: 0 PID: 989 at drivers/gpu/drm/i915/intel_pm.c:4377 gen6_set_rps+0x371/0x3c0()
WARN_ON(val > dev_priv->rps.max_freq_softlimit)[snip]
Quoted 5 lines
I'm not at all familiar with this hardware, but I took a quick look into what changed with this commit for my laptop. Before the commit, rps.min_freq_softlimit is 4 (from rps.min_freq) and rps.max_freq_softlimit is 22.
Quoted 7 lines
After the commit, rps.min_freq_softlimit is set to the rps.efficient_freq value read from pcode, which is 34 on my laptop. So later when
gen6_set_rps()is called with rps.min_freq_softlimit that warning is hit.Any thoughts? It certainly seems fishy that this commit causes rps.min_freq_softlimit to be greater than rps.max_freq_softlimit.
Very fishy indeed. Moral of this story, never trust hw.
Quoted 16 lines
drivers/gpu/drm/i915/intel_pm.c static void gen6_init_rps_frequencies(struct drm_device *dev) · line 4013
Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +4
-1@@ -4007,7 +4007,10 @@ static void gen6_init_rps_frequencies(struct drm_device *dev) &ddcc_status);if (0 == ret) dev_priv->rps.efficient_freq = - (ddcc_status >>8 ) &0xff ; +clamp_t (u8, + (ddcc_status >>8 ) &0xff , + dev_priv->rps.min_freq, + dev_priv->rps.max_freq);Maybe better to fall back to
rp1_freqif this is bogus?Quoted 7 lines
[TOR:] Michael, Thank you for bringing this problem to our attention.
Yes, this function needs some range checking to maintain RPn <= RPe <= RP0.
A value of 34 seems too high for RPe.
What values does the Carbon X1 (Haswell) have for RPn and RP0?Quoted 7 lines
4 & 22, already in Micheal's original bug report.
Tom, can you pls polish the clamping into a proper patch with m-l references?
Micheal, can you please test the first hunk from Chris (the one that adds the clamp) to make sure it does indeed address the
WARN_ONyou're seeing?The clamp suggested by Chris does indeed fix the
WARN_ON.In the case where RPe is greater than RP0, RPe will now be clamped to RP0. Is this likely to result in increased power consumption?
Quoted 6 lines
At a quick glance on my laptop it does not (idling around 5W before and after) but Ville had suggested earlier to fall back to RP1, which would be more consistent with previous kernels.
Thanks again for the quick responses,
Michael[TOR:] Michael, I discussed this report with a pcode architect here.
The RPe value is clamped to the [RPn, RP0] range by pcode before returning the value to the driver on Broadwell but not on Haswell.
On Haswell, an efficient frequency value above RP0 is not a garbage value and could result from a relatively flat efficiency curve. In this situation, leakage power would dominate the efficiency curve such that running at lower frequencies may not save power overall. Higher leakage power may result from a higher package temperature.
Quoted 6 lines
Quoted 2 lines
Running at RP0 may actually save power compared to RP1 by allowing more time in RC6.
Hm, I'd just go with clamping since that's what bdw does too. So Chris diff essentially.
-Daniel
[TOR:] Yes, we should go with clamping, essentially the diff from Chris. I am trying to provide an explanation of why that is the right thing to do.
Thanks,
Tom
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx