Bug 80703 - [BSW]The infomation read from RC6 status register is wrong
Summary: [BSW]The infomation read from RC6 status register is wrong
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: Other All
: high normal
Assignee: Mika Kuoppala
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-30 07:00 UTC by Guo Jinxian
Modified: 2017-10-06 14:37 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
The infomation read from RC6 status register is wrong (124.71 KB, text/plain)
2014-06-30 07:00 UTC, Guo Jinxian
no flags Details
0001-drm-i915-Read-the-well-status-before-reading-control.patch (1.69 KB, text/plain)
2014-06-30 07:00 UTC, Guo Jinxian
no flags Details
i915/drm/chv: calculate rc6 residency correctly (1.52 KB, patch)
2014-07-07 15:47 UTC, Mika Kuoppala
no flags Details | Splinter Review
dmesg (124.31 KB, text/plain)
2014-07-08 07:57 UTC, Guo Jinxian
no flags Details
drm/i915/chv: calculate rc6 residency correctly (2.68 KB, patch)
2014-07-08 16:31 UTC, Mika Kuoppala
no flags Details | Splinter Review
dmesg (124.51 KB, text/plain)
2014-07-09 08:30 UTC, Guo Jinxian
no flags Details

Description Guo Jinxian 2014-06-30 07:00:01 UTC
Created attachment 101997 [details]
The infomation read from RC6 status register is wrong

==System Environment==
--------------------------
Regression: No. 
It's first time to run the test.

Non-working platforms: BYT

==kernel==
--------------------------
origin/drm-intel-nightly: 1087d4bf01e79523898c6c31615bf0c369e0039a(fails)
    drm-intel-nightly: 2014y-06m-25d-13h-11m-05s integration manifest
origin/drm-intel-next-queued: 91565c85b66db820f01894a971d39aaef60c4325(fails)
    drm/i915: Don't try to look up object for non-existent fb    
origin/drm-intel-fixes: 8525a235c96a548873c6c5644f50df32b31f04c6(fails)
    drm/i915: vlv_prepare_pll is only needed in case of non DSI interfaces

==Bug detailed description==
-----------------------------
[root@x-bsw01 tools]# ./intel_reg_read 0x130094
0x130094 : 0xA1

If run igt case pm_rc6_residency, the result shows below:
[root@x-bsw01 tests]# ./pm_rc6_residency
IGT-Version: 1.7-g67e29a3 (x86_64) (Linux: 3.16.0-rc2_kcloud_1305a9_20140630+ x86_64)
Test assertion failure function rc6_residency_check, file pm_rc6_residency.c:146:
Last errno: 0, Success
Failed assertion: diff >= (SLEEP_DURATION - RC6_FUDGE)
GPU was not in RC6 long enough. Check that the GPU is as idle as possible(ie. no X, running and running no other tests)
Subtest rc6-residency-check: FAIL
This machine doesn't support rc6pp
This machine doesn't support rc6p
This machine doesn't support rc6
The residency counter: 0.000000
Test requirement not met in function rc6_residency_counter, file pm_rc6_residency.c:130:
Last errno: 0, Success
Test requirement: (flag_support == 0)
This machine didn't entry any RC6 state.
Subtest rc6-residency-counter: SKIP


if apply the attached patch, we can see below debugfs information: 
[root@x-bsw01 ~]# cat /sys/kernel/debug/dri/64/i915_drpc_info 
Video Turbo Mode: no 
Turbo enabled: yes 
HW control enabled: yes 
SW control enabled: no 
RC6 Enabled: yes 
Render Power Well: Down 
Media Power Well: Down 
Render RC6 residency since boot: 210147482 
Media RC6 residency since boot: 210147747 
Forcewake Render Count = 0 
Forcewake Media Count = 0
Comment 1 Guo Jinxian 2014-06-30 07:00:47 UTC
Created attachment 101998 [details]
0001-drm-i915-Read-the-well-status-before-reading-control.patch
Comment 2 Deepak S 2014-06-30 13:49:39 UTC
We always do a forcewake before reading register via intel_reg_read. So "0x130094" always return Power Wells are UP.

Looks like register as changed, need to look at the spec and update the sysfs.
Meanwhile please use "i915_drpc_info" to get residency details.
Comment 3 Guo Jinxian 2014-07-01 02:18:34 UTC
Update
Non-working platforms: BSW
Comment 4 Mika Kuoppala 2014-07-07 15:47:58 UTC
Created attachment 102378 [details] [review]
i915/drm/chv: calculate rc6 residency correctly
Comment 5 Guo Jinxian 2014-07-08 07:57:15 UTC
Created attachment 102416 [details]
dmesg

(In reply to comment #4)
> Created attachment 102378 [details] [review] [review]
> i915/drm/chv: calculate rc6 residency correctly

On latest -next-queued() with the patch, the result shows below:

[root@x-bsw01 tools]# ./intel_reg_read 0x130094
0x130094 : 0xA1


[root@x-bsw01 tests]# ./pm_rc6_residency
IGT-Version: 1.7-g838f321 (x86_64) (Linux: 3.16.0-rc4_kcloud_97a14c_20140708+ x86_64)
Test assertion failure function rc6_residency_check, file pm_rc6_residency.c:143:
Last errno: 0, Success
Failed assertion: diff <= (SLEEP_DURATION + RC6_FUDGE)
Diff was too high. That is unpossible
Subtest rc6-residency-check: FAIL
This machine doesn't support rc6pp
This machine doesn't support rc6p
The residency counter: 9.600667
Test assertion failure function rc6_residency_counter, file pm_rc6_residency.c:131:
Last errno: 0, Success
Failed assertion: (flag_counter != 0) && (counter_result <=1)
Sysfs RC6 residency counter is inaccurate.
Subtest rc6-residency-counter: FAIL
Comment 6 Mika Kuoppala 2014-07-08 16:31:28 UTC
Created attachment 102446 [details] [review]
drm/i915/chv: calculate rc6 residency correctly

Updated patch, please test with pm_rc6_residency
Comment 7 Guo Jinxian 2014-07-09 08:30:58 UTC
Created attachment 102467 [details]
dmesg

(In reply to comment #6)
> Created attachment 102446 [details] [review] [review]
> drm/i915/chv: calculate rc6 residency correctly
> 
> Updated patch, please test with pm_rc6_residency

The test was passed with this patch.
Output:
[root@x-bsw01 tests]# ./pm_rc6_residency
IGT-Version: 1.7-g8d60b82 (x86_64) (Linux: 3.16.0-rc4_kcloud_7df4e1_20140709+ x86_64)
Subtest rc6-residency-check: SUCCESS
This machine doesn't support rc6pp
This machine doesn't support rc6p
The residency counter: 1.000000
This machine entry rc6 state.
Subtest rc6-residency-counter: SUCCESS
Comment 8 Daniel Vetter 2014-07-12 09:20:20 UTC
commit 542a6b205b184ec90e2108aaebaf8ba16128baec
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Date:   Wed Jul 9 14:55:56 2014 +0300

    drm/i915/chv: calculate rc6 residency correctly
Comment 9 Guo Jinxian 2014-07-15 08:23:38 UTC
Fixes on latest -nightly(2a38e1bcd4dc9523cd723291340226d139bece1b)

[root@x-bsw01 tests]# ./pm_rc6_residency
IGT-Version: 1.7-ge74dd22 (x86_64) (Linux: 3.16.0-rc5_drm-intel-nightly_2a38e1_20140715+ x86_64)
Subtest rc6-residency-check: SUCCESS
This machine doesn't support rc6pp
This machine doesn't support rc6p
The residency counter: 1.000000
This machine entry rc6 state.
Subtest rc6-residency-counter: SUCCESS
Comment 10 Elizabeth 2017-10-06 14:37:27 UTC
Closing old verified.


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.