Bug 82939

Summary: [BYT]igt/pm_rpm some subcases cause "WARNING: CPU: 1 PID: 18504 at drivers/gpu/drm/i915/intel_uncore.c:47 gen6_write32+0x64/0xbf [i915]()"
Product: DRI Reporter: Guo Jinxian <jinxianx.guo>
Component: DRM/IntelAssignee: Intel GFX Bugs mailing list <intel-gfx-bugs>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: high CC: imre.deak, intel-gfx-bugs
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg
none
fix drm_set_plane on/off while crtc is off
none
get rpm around cdclk get/put
none
fix rps interrupt race wrt. rps work when disabling rps
none
dmesg(latest nightly) none

Description Guo Jinxian 2014-08-22 08:59:15 UTC
Created attachment 105087 [details]
dmesg

==System Environment==
--------------------------
Regression: No
These cases always fail

Non-working platforms: BYT

==kernel==
--------------------------
origin/drm-intel-nightly: 257d90d13794c2eb545ab0d6c708f21e2a0378b6(fails)
    drm-intel-nightly: 2014y-08m-21d-10h-03m-09s integration manifest
origin/drm-intel-next-queued: 3a5f87c286515c54ff5c52c3e64d0c522b7570c0(causes system hang)
    drm: fix plane rotation when restoring fbdev configuration
origin/drm-intel-fixes: 1a125d8a2c22b11741fc47d4ffcf7a5ffa044dd3(fails)
    drm/i915: don't try to retrain a DP link on an inactive CRTC

==Bug detailed description==
-----------------------------
igt/pm_rpm some subcases cause "WARNING: CPU: 1 PID: 18504 at drivers/gpu/drm/i915/intel_uncore.c:47 gen6_write32+0x64/0xbf [i915]()"

Case list:
igt/pm_rpm/cursor
igt/pm_rpm/cursor-dpms
igt/pm_rpm/dpms-lpsp
igt/pm_rpm/dpms-mode-unset-lpsp
igt/pm_rpm/drm-resources-equal
igt/pm_rpm/fences
igt/pm_rpm/gem-execbuf
igt/pm_rpm/gem-mmap-cpu
igt/pm_rpm/gem-mmap-gtt
igt/pm_rpm/gem-pread
igt/pm_rpm/legacy-planes-dpms
igt/pm_rpm/modeset-lpsp
igt/pm_rpm/modeset-lpsp-stress
igt/pm_rpm/modeset-stress-extra-wait
igt/pm_rpm/pci-d3-state
igt/pm_rpm/rte
igt/pm_rpm/universal-planes-dpms

Output:
root@x-bytm02:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./pm_rpm --run-subtest cursor
IGT-Version: 1.7-g4d2f511 (x86_64) (Linux: 3.17.0-rc1_drm-intel-nightly_257d90_20140822+ x86_64)
Runtime PM support: 1
PC8 residency support: 0
Subtest cursor: SUCCESS
root@x-bytm02:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# dmesg -r|egrep ""<[1-4]>""|grep drm
<4>[ 1895.638603] WARNING: CPU: 1 PID: 18504 at drivers/gpu/drm/i915/intel_uncore.c:47 gen6_write32+0x64/0xbf [i915]()
<4>[ 1895.638608] Modules linked in: dm_mod snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_codec_generic iTCO_wdt iTCO_vendor_support snd_hda_intel snd_hda_controller snd_hda_codec snd_hwdep snd_pcm snd_timer r8169 pcspkr i2c_i801 lpc_ich snd mfd_core soundcore iosf_mbi battery wmi ac acpi_cpufreq uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev i915 button video drm_kms_helper drm cfbfillrect cfbimgblt cfbcopyarea
<4>[ 1895.638656] CPU: 1 PID: 18504 Comm: pm_rpm Tainted: G        W      3.17.0-rc1_drm-intel-nightly_257d90_20140822+ #1688
<4>[ 1895.638931]  [<ffffffffa0023917>] ? drm_modeset_lock+0x52/0xb3 [drm]
<4>[ 1895.638945]  [<ffffffffa0019154>] ? setplane_internal+0x262/0x2bc [drm]
<4>[ 1895.638959]  [<ffffffffa0019349>] ? drm_mode_cursor_common+0x19b/0x27d [drm]
<4>[ 1895.638974]  [<ffffffffa001bcba>] ? drm_mode_cursor_ioctl+0x31/0x36 [drm]
<4>[ 1895.638986]  [<ffffffffa0010908>] ? drm_ioctl+0x279/0x3bc [drm]
<4>[ 1895.639005]  [<ffffffffa001bc89>] ? drm_mode_setcrtc+0x48b/0x48b [drm]
<4>[ 1895.639097] WARNING: CPU: 1 PID: 18504 at drivers/gpu/drm/i915/intel_uncore.c:47 vlv_read32+0x20/0x14c [i915]()
<4>[ 1895.639101] Modules linked in: dm_mod snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_codec_generic iTCO_wdt iTCO_vendor_support snd_hda_intel snd_hda_controller snd_hda_codec snd_hwdep snd_pcm snd_timer r8169 pcspkr i2c_i801 lpc_ich snd mfd_core soundcore iosf_mbi battery wmi ac acpi_cpufreq uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev i915 button video drm_kms_helper drm cfbfillrect cfbimgblt cfbcopyarea
<4>[ 1895.639138] CPU: 1 PID: 18504 Comm: pm_rpm Tainted: G        W      3.17.0-rc1_drm-intel-nightly_257d90_20140822+ #1688
<4>[ 1895.639365]  [<ffffffffa0023917>] ? drm_modeset_lock+0x52/0xb3 [drm]
<4>[ 1895.639378]  [<ffffffffa0019154>] ? setplane_internal+0x262/0x2bc [drm]
<4>[ 1895.639392]  [<ffffffffa0019349>] ? drm_mode_cursor_common+0x19b/0x27d [drm]
<4>[ 1895.639406]  [<ffffffffa001bcba>] ? drm_mode_cursor_ioctl+0x31/0x36 [drm]
<4>[ 1895.639418]  [<ffffffffa0010908>] ? drm_ioctl+0x279/0x3bc [drm]
<4>[ 1895.639436]  [<ffffffffa001bc89>] ? drm_mode_setcrtc+0x48b/0x48b [drm]
<4>[ 1895.639532] WARNING: CPU: 1 PID: 18504 at drivers/gpu/drm/i915/intel_uncore.c:47 gen6_write32+0x64/0xbf [i915]()
<4>[ 1895.639554] Modules linked in: dm_mod snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_codec_generic iTCO_wdt iTCO_vendor_support snd_hda_intel snd_hda_controller snd_hda_codec snd_hwdep snd_pcm snd_timer r8169 pcspkr i2c_i801 lpc_ich snd mfd_core soundcore iosf_mbi battery wmi ac acpi_cpufreq uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev i915 button video drm_kms_helper drm cfbfillrect cfbimgblt cfbcopyarea
<4>[ 1895.639697] CPU: 1 PID: 18504 Comm: pm_rpm Tainted: G        W      3.17.0-rc1_drm-intel-nightly_257d90_20140822+ #1688
<4>[ 1895.639923]  [<ffffffffa0023917>] ? drm_modeset_lock+0x52/0xb3 [drm]
<4>[ 1895.639937]  [<ffffffffa0019154>] ? setplane_internal+0x262/0x2bc [drm]
<4>[ 1895.639950]  [<ffffffffa0019349>] ? drm_mode_cursor_common+0x19b/0x27d [drm]
<4>[ 1895.639979]  [<ffffffffa001bcba>] ? drm_mode_cursor_ioctl+0x31/0x36 [drm]
<4>[ 1895.640006]  [<ffffffffa0010908>] ? drm_ioctl+0x279/0x3bc [drm]
<4>[ 1895.640033]  [<ffffffffa001bc89>] ? drm_mode_setcrtc+0x48b/0x48b [drm]
<4>[ 1895.640118] WARNING: CPU: 1 PID: 18504 at drivers/gpu/drm/i915/intel_uncore.c:47 vlv_read32+0x20/0x14c [i915]()
<4>[ 1895.640141] Modules linked in: dm_mod snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_codec_generic iTCO_wdt iTCO_vendor_support snd_hda_intel snd_hda_controller snd_hda_codec snd_hwdep snd_pcm snd_timer r8169 pcspkr i2c_i801 lpc_ich snd mfd_core soundcore iosf_mbi battery wmi ac acpi_cpufreq uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev i915 button video drm_kms_helper drm cfbfillrect cfbimgblt cfbcopyarea
<4>[ 1895.640189] CPU: 1 PID: 18504 Comm: pm_rpm Tainted: G        W      3.17.0-rc1_drm-intel-nightly_257d90_20140822+ #1688
<4>[ 1895.640445]  [<ffffffffa0023917>] ? drm_modeset_lock+0x52/0xb3 [drm]
<4>[ 1895.640459]  [<ffffffffa0019154>] ? setplane_internal+0x262/0x2bc [drm]
<4>[ 1895.640473]  [<ffffffffa0019349>] ? drm_mode_cursor_common+0x19b/0x27d [drm]
<4>[ 1895.640787]  [<ffffffffa001bcba>] ? drm_mode_cursor_ioctl+0x31/0x36 [drm]
<4>[ 1895.640799]  [<ffffffffa0010908>] ? drm_ioctl+0x279/0x3bc [drm]
<4>[ 1895.640817]  [<ffffffffa001bc89>] ? drm_mode_setcrtc+0x48b/0x48b [drm]


==Reproduce steps==
---------------------------- 
1../pm_rpm --run-subtest cursor
Comment 1 Imre Deak 2014-10-30 15:01:19 UTC
Created attachment 108690 [details] [review]
fix drm_set_plane on/off while crtc is off

There were 3 separate issues I found, the attached 3 patches got rid of them, could you give it a try?
Comment 2 Imre Deak 2014-10-30 15:02:12 UTC
Created attachment 108691 [details] [review]
get rpm around cdclk get/put
Comment 3 Imre Deak 2014-10-30 15:02:58 UTC
Created attachment 108692 [details] [review]
fix rps interrupt race wrt. rps work when disabling rps
Comment 4 Guo Jinxian 2014-10-31 03:02:21 UTC
(In reply to Imre Deak from comment #3)
> Created attachment 108692 [details] [review] [review]
> fix rps interrupt race wrt. rps work when disabling rps

With the patches above, the failure unable to reproduce.

root@x-bytm02:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./pm_rpm --run-subtest cursor
IGT-Version: 1.8-gcba3088 (x86_64) (Linux: 3.18.0-rc2_kcloud_3479f9_20141031+ x86_64)
Runtime PM support: 1
PC8 residency support: 0
Subtest cursor: SUCCESS (8.684s)
root@x-bytm02:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# dmesg -r|egrep "<[1-4]>"|grep drm
Comment 5 Mika Kuoppala 2014-11-04 13:32:14 UTC
Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
Date:   Thu Oct 30 15:59:31 2014 -0200

    drm/i915: fix RPS on runtime suspend

is in drm-intel-nightly

Please retest.
Comment 6 lu hua 2014-11-05 08:08:58 UTC
Created attachment 108933 [details]
dmesg(latest nightly)

It still happens on latest -nightly kernel.
Comment 7 Jani Nikula 2014-11-21 07:54:51 UTC
Fixed by commits

commit 2837ac40698d0931727b957a40c8c8ea27c3bcb2
Author: Imre Deak <imre.deak@intel.com>
Date:   Wed Nov 19 16:25:38 2014 +0200

    drm/i915: vlv: increase timeout when setting idle GPU freq

commit 738c05c07d74769a1c5704636969b9b21cc96835
Author: Imre Deak <imre.deak@intel.com>
Date:   Wed Nov 19 16:25:37 2014 +0200

    drm/i915: vlv: fix cdclk setting during modeset while suspended

in current drm-intel-nightly. Please retest.
Comment 8 Guo Jinxian 2014-11-24 06:15:03 UTC
(In reply to Jani Nikula from comment #7)
> Fixed by commits
> 
> commit 2837ac40698d0931727b957a40c8c8ea27c3bcb2
> Author: Imre Deak <imre.deak@intel.com>
> Date:   Wed Nov 19 16:25:38 2014 +0200
> 
>     drm/i915: vlv: increase timeout when setting idle GPU freq
> 
> commit 738c05c07d74769a1c5704636969b9b21cc96835
> Author: Imre Deak <imre.deak@intel.com>
> Date:   Wed Nov 19 16:25:37 2014 +0200
> 
>     drm/i915: vlv: fix cdclk setting during modeset while suspended
> 
> in current drm-intel-nightly. Please retest.

Test passes on latest -nightly(0f8cb1fb8e01c53f9ad47344e9448d72df49fcf2)

root@x-bytm02:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./pm_rpm --run-subtest cursor
IGT-Version: 1.8-gd807891 (x86_64) (Linux: 3.18.0-rc5_drm-intel-nightly_0f8cb1_20141124+ x86_64)
Runtime PM support: 1
PC8 residency support: 0
Subtest cursor: SUCCESS (8.194s)
root@x-bytm02:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# dmesg -r|egrep "<[1-4]>"|grep drm
root@x-bytm02:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests#
Comment 9 Elizabeth 2017-10-06 14:36:36 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.