Bug 89123

Summary: [SKL]igt/pm_rps tests fail
Product: DRI Reporter: lu hua <huax.lu>
Component: DRM/IntelAssignee: cprigent <christophe.prigent>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: christophe.prigent, intel-gfx-bugs
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: HSW i915 features: power/Other
Attachments:
Description Flags
dmesg none

Description lu hua 2015-02-13 05:21:40 UTC
Created attachment 113442 [details]
dmesg

==System Environment==
--------------------------
Regression: not sure

no-working platforms: SKL

==kernel==
--------------------------
drm-intel-nightly/b4442ee4e150506cebeee72249efc566c5f14bbe
commit b4442ee4e150506cebeee72249efc566c5f14bbe
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Feb 6 10:25:31 2015 +0100

    drm-intel-nightly: 2015y-02m-06d-09h-25m-00s UTC integration manifest

==Bug detailed description==
-----------------------------
It fails on SKL with -nightly kernel.

output:
IGT-Version: 1.9-g9846e7f (x86_64) (Linux: 3.19.0-rc7_drm-intel-nightly_b4442e_20150208+ x86_64)
(pm_rps:5289) CRITICAL: Test assertion failure function matchit, file pm_rps.c:165:
(pm_rps:5289) CRITICAL: Failed assertion: freqs1[CUR] == freqs2[CUR]
(pm_rps:5289) CRITICAL: error: 350 != 600
Subtest blocking: FAIL (35.257s)

==Reproduce steps==
---------------------------- 
1. ./pm_rps --run-subtest blocking
Comment 1 Jesse Barnes 2015-03-05 01:30:08 UTC
Ok I see this on my SKL too, adding an extra delay after the quiescent_gpu() calls in the test makes the failure go away though.

Akash's patches would likely help as well, since the GPU freq would drop down faster probably.

Can you try this series?
http://lists.freedesktop.org/archives/intel-gfx/2015-February/059556.html
Comment 2 lu hua 2015-03-09 06:25:36 UTC
(In reply to Jesse Barnes from comment #1)
> Ok I see this on my SKL too, adding an extra delay after the quiescent_gpu()
> calls in the test makes the failure go away though.
> 
> Akash's patches would likely help as well, since the GPU freq would drop
> down faster probably.
> 
> Can you try this series?
> http://lists.freedesktop.org/archives/intel-gfx/2015-February/059556.html

Apply these patches, it works well.

output:
IGT-Version: 1.9-g50158de (x86_64) (Linux: 4.0.0-rc2_kcloud_364c08_20150309+ x86_64)
Subtest blocking: SUCCESS (35.037s)

real    0m35.056s
user    0m0.570s
sys     0m1.878s
Comment 3 Jesse Barnes 2015-03-12 22:03:37 UTC
This test passes if run individually, but fails if min-max-config-idle is run first within the test.

Akash, can you take a look?  Maybe the turbo params are different enough on SKL that we need to adjust the tests.  I had to apply this kernel patch as a starting point:

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 288c9d2..3fe2164 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -6696,7 +6696,8 @@ static int chv_freq_opcode(struct drm_i915_private *dev_pr
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 {
        if (IS_GEN9(dev_priv->dev))
-               return (val * GT_FREQUENCY_MULTIPLIER) / GEN9_FREQ_SCALER;
+               return DIV_ROUND_CLOSEST(val * GT_FREQUENCY_MULTIPLIER,
+                       GEN9_FREQ_SCALER);
        else if (IS_CHERRYVIEW(dev_priv->dev))
                return chv_gpu_freq(dev_priv, val);
        else if (IS_VALLEYVIEW(dev_priv->dev))
@@ -6708,7 +6709,8 @@ int intel_gpu_freq(struct drm_i915_private *dev_priv, int 
 int intel_freq_opcode(struct drm_i915_private *dev_priv, int val)
 {
        if (IS_GEN9(dev_priv->dev))
-               return (val * GEN9_FREQ_SCALER) / GT_FREQUENCY_MULTIPLIER;
+               return DIV_ROUND_CLOSEST(val * GEN9_FREQ_SCALER,
+                       GT_FREQUENCY_MULTIPLIER);
        else if (IS_CHERRYVIEW(dev_priv->dev))
                return chv_freq_opcode(dev_priv, val);
Comment 4 Jesse Barnes 2015-03-12 22:04:18 UTC
*** Bug 89122 has been marked as a duplicate of this bug. ***
Comment 5 Akash Goel 2015-03-13 03:21:09 UTC
Actually earlier we had borrowed the SKL system but sorry last week only we relinquished that system to the Windows team.
Will have to rearrange for another SKL system.

Meanwhile, can an experiment be tried out, of disabling RC6 (just need to clear 0xA090/0xA210 registers though intel_reg_write).

There is a known issue on initial SKL stepping (like BDW) that Turbo doesn't work properly in conjunction with RC6 (Down threshold interrupts are missed).
I remember, I also did the same on my side for 'pm_rps' IGT test.
Comment 6 Jesse Barnes 2015-07-29 14:48:04 UTC
Assigning to QA to reproduce; if this is still an issue I guess Akash should handle it.
Comment 7 Humberto Israel Perez Rodriguez 2015-10-15 17:50:30 UTC
Reproduced on HSW with the latest configuration:

Configuration :
---------------------------------------------
kernel: 4.3.0-rc4-drm-intel-testing-2015-10-10
xorg-server-1.17.2
libdrm-2.4.65
xf86-video-intel-2.99.917
mesa-11.0.2
libva-1.6.1
intel-driver-1.6.1
cairo-1.14.2
IGT Version : 1.12-g1f9e055
Comment 8 Olivier Berthier 2015-10-16 12:15:00 UTC
Not reproduced on Sky Lake Y with the drm-intel-testing-2015-10-10 kernel and with the patches :
http://lists.freedesktop.org/archives/intel-gfx/2015-August/074657.html
http://lists.freedesktop.org/archives/intel-gfx/2015-August/074828.html.

Setup:
------
kernel: drm-intel-testing 2015-10-10 c38f2c24fb6484fc6900efa6f8d968e8ee964e9c
cairo: 1.14.2 93422b3cb5e0ef8104b8194c8873124ce2f5ea2d 
libdrm: 2.4.65 c3496167637e35cf8a52d5e7e53a412e79d80db0
intel-driver: 1.6.1 35858c69166b845c59ca32e19a3dbb0b758df209 
libva: 1.6.1 613eb962b45fbbd1526d751e88e0d8897af6c0e0
mesa: 11.0.3 914966befcd57764941405707d8f57d3e7e7f768 
xf86-video-intel: 2.99.917 baec802b21387d04aebb10ac29e719a1800c5aa0 
xserver: 1.17.2 2123f7682d522619f101b05fb75efa75dabbe371

intel-gpu-tools: origin/master, origin/HEAD bfea74a9f64a900bcb90f946b38746781017449f
Comment 9 Elio 2015-10-16 14:34:20 UTC
pm_rps@min-max-config-idle
is failing on BYT with following configuration
Kernel: http://vanaheimr.fr.intel.com/shared/out/kernels/drm-intel/WW42.1_4.3.0-rc4_c38f2c2/
 xorg-server-1.17.2
libdrm-2.4.65
xf86-video-intel2.99.917
mesa-11.0.2
libva-1.6.1
intel-driver 1.6.1
cairo 1.14.2
intel-gpu-tools-1.12
Comment 10 cprigent 2015-10-23 14:03:44 UTC
Reproduced on SKL-Y if we don't apply the patches:

Platform: SKY LAKE Y A0 
CPU : Intel(R) Core(TM) m5-6Y57 CPU @ 1.10GHz (family: 6, model: 78  stepping: 3)
MCP : SKL-Y  D1 2+2 (ou ULX-D1)
QDF : QJK9 
CPU : SKL D0
Chipset PCH: Sunrise Point LP C1       
CRB : SKY LAKE Y LPDDR3 RVP3 CRB FAB2
Reworks : All Mandatories + FBS02,FBS03, F23, O-02 & O-06
Software
BIOS : SKLSE2R1.R00.X097.B02.1509020030
ME FW : 11.0.0.1173
Ksc (EC FW): 1.19
Linux distribution: Ubuntu 14.04 LTS 64 bits
kernel 4.3.0-rc5-drm-intel-nightly+ (f14b17b) from git://anongit.freedesktop.org/drm-intel
commit f14b17b8639fb680c672d3d2f8d6414fcf0f82c4
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Oct 16 19:27:49 2015 +0200
drm-intel-nightly: 2015y-10m-16d-17h-27m-10s UTC integration manifest
Mesa master commit 6f3954618b0fe273af76af79ce9ec56566b79b2a from http://cgit.freedesktop.org/mesa/mesa/
xf86-video-intel - 2.99.917 from http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/
Libdrm - 2.4.65 from http://cgit.freedesktop.org/mesa/drm/
Libva - 1.6.1 from http://cgit.freedesktop.org/libva/
vaapi intel-driver - 1.6.1 from http://cgit.freedesktop.org/vaapi/intel-driver
Cairo - 1.14.2 from http://cgit.freedesktop.org/cairo
Xorg Xserver - 1.17.2 from http://cgit.freedesktop.org/xorg/xserver
Comment 11 cprigent 2015-11-01 13:06:56 UTC
Subcases are Pass with last setup:
igt@pm_rps@basic-api
igt@pm_rps@blocking
igt@pm_rps@min-max-config-idle
igt@pm_rps@min-max-config-loaded
igt@pm_rps@reset


Platform: SKY LAKE Y A0 
CPU : Intel(R) Core(TM) m5-6Y57 CPU @ 1.10GHz (family: 6, model: 78  stepping: 3)
MCP : SKL-Y  D1 2+2 (ou ULX-D1)
QDF : QJK9 
CPU : SKL D0
Chipset PCH: Sunrise Point LP C1       
CRB : SKY LAKE Y LPDDR3 RVP3 CRB FAB2
Reworks : All Mandatories + FBS02,FBS03, F23, O-02 & O-06
Software
BIOS : SKLSE2R1.R00.X097.B02.1509020030
ME FW : 11.0.0.1173
Ksc (EC FW): 1.19
Linux distribution: Ubuntu 14.04 LTS 64 bits
kernel 4.3.0-rc6-drm-intel-nightly+ (ab48d30) from git://anongit.freedesktop.org/drm-intel
commit ab48d308f2fe5a8ad3d2fd57d313e74995cf1c20 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Fri Oct 23 12:03:04 2015 +0200 drm-intel-nightly: 2015y-10m-23d-10h-02m-25s UTC integration manifest
Mesa 10.0.4 from http://cgit.freedesktop.org/mesa/mesa/
xf86-video-intel - 2.99.917 from http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/
Libdrm - 2.4.65 from http://cgit.freedesktop.org/mesa/drm/
Libva - 1.6.1 from http://cgit.freedesktop.org/libva/
vaapi intel-driver - 1.6.1 from http://cgit.freedesktop.org/vaapi/intel-driver
Cairo - 1.14.2 from http://cgit.freedesktop.org/cairo
Xorg Xserver - 1.17.2 from http://cgit.freedesktop.org/xorg/xserver
Comment 12 cprigent 2015-11-01 13:07:24 UTC
So closed as fixed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.