Bug 80081

Summary: [HSW Bisected]igt/pm_rpm/system-suspend cause " WARNING: CPU: 7 PID: 786 at drivers/gpu/drm/i915/i915_gem.c:1644 i915_gem_release_all_mmaps+0x28/0x7e [i915]()
Product: DRI Reporter: Guo Jinxian <jinxianx.guo>
Component: DRM/IntelAssignee: Mika Kuoppala <mika.kuoppala>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: highest CC: intel-gfx-bugs, przanoni, yi.sun
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg
none
dmesg none

Description Guo Jinxian 2014-06-16 07:40:34 UTC
Created attachment 101147 [details]
dmesg

==System Environment==
--------------------------
Regression: Yes. 
Good commit on -next-queued: e6a7e5d0fd778bc6cf295414b9937723091c9bb6

Non-working platforms: HSW

==kernel==
--------------------------
origin/drm-intel-nightly: b438e8793c6d18b0998d75cdf8115a5898ed21d1(fails)
    drm-intel-nightly: 2014y-06m-13d-22h-09m-12s integration manifest
origin/drm-intel-next-queued: 868d665b43473e230d560d5186535270a3d57a19(fails)
    drm/i915: Fix memory leak in intel_dsi_init() error path
origin/drm-intel-fixes: 223a6f2b975ab35d93270ea1d4fb6e0ac6b27fe6(fails)
    drm/i915/bdw: remove erroneous chv specific workarounds from bdw code

==Bug detailed description==
-----------------------------
igt/pm_rpm/system-suspend cause " WARNING: CPU: 7 PID: 786 at drivers/gpu/drm/i915/i915_gem.c:1644 i915_gem_release_all_mmaps+0x28/0x7e [i915]()"

Dmesg shows:
[  834.731242] WARNING: CPU: 7 PID: 786 at drivers/gpu/drm/i915/i915_gem.c:1644 i915_gem_release_all_mmaps+0x28/0x7e [i915]()
[  834.731243] Modules linked in: ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT iptable_mangle xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc ipv6 dm_mod snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec_hdmi iTCO_wdt iTCO_vendor_support firewire_ohci pcspkr serio_raw i2c_i801 firewire_core crc_itu_t lpc_ich snd_hda_intel mfd_core snd_hda_controller snd_hda_codec snd_hwdep snd_pcm snd_timer snd soundcore battery wmi acpi_cpufreq i915 video button drm_kms_helper drm
[  834.731259] CPU: 7 PID: 786 Comm: kworker/7:1 Not tainted 3.15.0-rc8_drm-intel-next-queued_868d66_20140616+ #3606
[  834.731260] Hardware name:                  /DZ87KLT75K, BIOS KLZ8711D.86A.0336.2013.0516.1957 05/16/2013
[  834.731263] Workqueue: pm pm_runtime_work
[  834.731264]  0000000000000000 0000000000000009 ffffffff817722c4 0000000000000000
[  834.731266]  ffffffff81036e54 ffff880255affca0 ffffffffa007f3ab ffff880255affcf8
[  834.731267]  ffff880250dd0000 ffff880256268898 ffff880250dd7908 ffff88025175a060
[  834.731269] Call Trace:
[  834.731273]  [<ffffffff817722c4>] ? dump_stack+0x41/0x51
[  834.731276]  [<ffffffff81036e54>] ? warn_slowpath_common+0x78/0x90
[  834.731281]  [<ffffffffa007f3ab>] ? i915_gem_release_all_mmaps+0x28/0x7e [i915]
[  834.731287]  [<ffffffffa007f3ab>] ? i915_gem_release_all_mmaps+0x28/0x7e [i915]
[  834.731291]  [<ffffffffa0065458>] ? intel_runtime_suspend+0xe2/0x812 [i915]
[  834.731295]  [<ffffffff81342af8>] ? pci_pm_runtime_suspend+0x60/0x119
[  834.731296]  [<ffffffff813cf058>] ? __rpm_callback+0x28/0x4c
[  834.731298]  [<ffffffff813cf0c7>] ? rpm_callback+0x4b/0x69
[  834.731299]  [<ffffffff813cf62c>] ? rpm_suspend+0x262/0x417
[  834.731304]  [<ffffffffa0070cf3>] ? intel_gen6_powersave_work+0xf0f/0xf1e [i915]
[  834.731306]  [<ffffffff813d03e3>] ? pm_runtime_work+0x65/0x7b
[  834.731308]  [<ffffffff8104aade>] ? process_one_work+0x1e2/0x363
[  834.731310]  [<ffffffff8104b385>] ? worker_thread+0x1c7/0x2bc
[  834.731312]  [<ffffffff8104b1be>] ? manage_workers.isra.23+0x1b5/0x1b5
[  834.731314]  [<ffffffff8104fb32>] ? kthread+0xc5/0xcd
[  834.731315]  [<ffffffff8104fa6d>] ? kthread_freezable_should_stop+0x40/0x40
[  834.731318]  [<ffffffff8177e0bc>] ? ret_from_fork+0x7c/0xb0
[  834.731319]  [<ffffffff8104fa6d>] ? kthread_freezable_should_stop+0x40/0x40


==Reproduce steps==
---------------------------- 
1. ./pm_rpm --run-subtest system-suspend
Comment 1 Guo Jinxian 2014-06-17 05:09:35 UTC
fe5b1886a78d92e0e4681e449725714e947dfc58 is the first bad commit
commit fe5b1886a78d92e0e4681e449725714e947dfc58
Author:     Imre Deak <imre.deak@intel.com>
AuthorDate: Mon May 12 18:35:05 2014 +0300
Commit:     Daniel Vetter <daniel.vetter@ffwll.ch>
CommitDate: Thu May 22 21:53:27 2014 +0200

    drm/i915: disable GT power saving early during system suspend

    Atm, we disable GT power saving during the end of the suspend sequence
    in i915_save_state(). Doing the disabling at that point seems arbitrary.
    One reason to disable it early though is to have a quiescent HW state
    before we do anything else (for example save registers). So move the
    disabling earlier, which also takes care canceling of the deferred RPS
    enabling work done by intel_disable_gt_powersave().

    Note that after the move we'll call intel_disable_gt_powersave() only
    in case modeset is enabled, but that's anyway the only case where we
    have it enabled in the first place.

    Signed-off-by: Imre Deak <imre.deak@intel.com>
    Reviewed-by: Robert Beckett <robert.beckett@intel.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Comment 2 Guo Jinxian 2014-06-17 05:11:32 UTC
The result on good commit was:

./pm_rpm --run-subtest system-suspend
IGT-Version: 1.7-g6c4b93f (x86_64) (Linux: 3.15.0-rc8_kcloud_07d80e_20140617+ x86_64)
Runtime PM support: 1
PC8 residency support: 0
rtcwake: wakeup from "mem" using /dev/rtc0 at Tue Jun 17 18:03:45 2014
Test assertion failure function system_suspend_subtest, file pm_rpm.c:1390:
Last errno: 5, Input/output error
Failed assertion: wait_for_suspended()
Subtest system-suspend: FAIL
Comment 3 Paulo Zanoni 2014-06-23 15:39:53 UTC
We recently silenced the WARN in question, but maybe we should have added it somewhere else?
Comment 4 Jani Nikula 2014-06-24 12:03:57 UTC
The below commit claims to fix this, please retest:

commit 6254b2042c794a8c2e14dc49b575a0708c823f88
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jun 16 08:57:44 2014 +0100

    drm/i915: Simplify i915_gem_release_all_mmaps()
Comment 5 Guo Jinxian 2014-06-25 08:24:09 UTC
(In reply to comment #4)
> The below commit claims to fix this, please retest:
> 
> commit 6254b2042c794a8c2e14dc49b575a0708c823f88
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Mon Jun 16 08:57:44 2014 +0100
> 
>     drm/i915: Simplify i915_gem_release_all_mmaps()

This bug unable to reproduce on latest -next-queued 9c33baa6b3bbb01c1a88dceba986b20e6642cf31

But I found another CallTrace below, I will report new bug for it.
[   64.318836] WARNING: CPU: 0 PID: 786 at drivers/gpu/drm/i915/i915_irq.c:209 gen6_enable_rps_interrupts+0x39/0x5c [i915]()
[   64.318844] Modules linked in: dm_mod snd_hda_codec_realtek iTCO_wdt snd_hda_codec_generic iTCO_vendor_support snd_hda_codec_hdmi serio_raw pcspkr i2c_i801 lpc_ich mfd_core snd_hda_intel snd_hda_controller snd_hda_codec snd_hwdep snd_pcm snd_timer snd soundcore battery wmi tpm_infineon tpm_tis tpm acpi_cpufreq i915 video button drm_kms_helper drm
[   64.318845] CPU: 0 PID: 786 Comm: kworker/0:1 Not tainted 3.15.0-rc8_kcloud_9c33ba_20140625+ #2
[   64.318846] Hardware name: ASUS All Series/Z87-EXPERT, BIOS 1008 05/17/2013
[   64.318851] Workqueue: events intel_gen6_powersave_work [i915]
[   64.318853]  0000000000000000 ffffffff8170a8d4 0000000000000000 ffffffff81033f78
[   64.318854]  ffffffffa0068408 ffff880251380000 ffff880251ac4000 0000000000040000
[   64.318854]  ffff880251388238 ffffffffa0068408 ffff880251380000 ffffffffa006e97c
[   64.318855] Call Trace:
[   64.318859]  [<ffffffff8170a8d4>] ? dump_stack+0x41/0x51
[   64.318861]  [<ffffffff81033f78>] ? warn_slowpath_common+0x6f/0x84
[   64.318867]  [<ffffffffa0068408>] ? gen6_enable_rps_interrupts+0x39/0x5c [i915]
[   64.318872]  [<ffffffffa0068408>] ? gen6_enable_rps_interrupts+0x39/0x5c [i915]
[   64.318877]  [<ffffffffa006e97c>] ? intel_gen6_powersave_work+0xe04/0xefe [i915]
[   64.318880]  [<ffffffff81044d0c>] ? process_one_work+0x1c1/0x2ca
[   64.318881]  [<ffffffff8104584d>] ? worker_thread+0x1c9/0x2ad
[   64.318882]  [<ffffffff81045684>] ? rescuer_thread+0x267/0x267
[   64.318883]  [<ffffffff81049dc2>] ? kthread+0xca/0xd2
[   64.318884]  [<ffffffff81049cf8>] ? kthread_create_on_node+0x15d/0x15d
[   64.318887]  [<ffffffff81714dbc>] ? ret_from_fork+0x7c/0xb0
[   64.318888]  [<ffffffff81049cf8>] ? kthread_create_on_node+0x15d/0x15d
Comment 6 Guo Jinxian 2014-06-27 06:39:01 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > The below commit claims to fix this, please retest:
> > 
> > commit 6254b2042c794a8c2e14dc49b575a0708c823f88
> > Author: Chris Wilson <chris@chris-wilson.co.uk>
> > Date:   Mon Jun 16 08:57:44 2014 +0100
> > 
> >     drm/i915: Simplify i915_gem_release_all_mmaps()
> 
> This bug unable to reproduce on latest -next-queued
> 9c33baa6b3bbb01c1a88dceba986b20e6642cf31
> 
> But I found another CallTrace below, I will report new bug for it.
> [   64.318836] WARNING: CPU: 0 PID: 786 at
> drivers/gpu/drm/i915/i915_irq.c:209 gen6_enable_rps_interrupts+0x39/0x5c
> [i915]()
> [   64.318844] Modules linked in: dm_mod snd_hda_codec_realtek iTCO_wdt
> snd_hda_codec_generic iTCO_vendor_support snd_hda_codec_hdmi serio_raw
> pcspkr i2c_i801 lpc_ich mfd_core snd_hda_intel snd_hda_controller
> snd_hda_codec snd_hwdep snd_pcm snd_timer snd soundcore battery wmi
> tpm_infineon tpm_tis tpm acpi_cpufreq i915 video button drm_kms_helper drm
> [   64.318845] CPU: 0 PID: 786 Comm: kworker/0:1 Not tainted
> 3.15.0-rc8_kcloud_9c33ba_20140625+ #2
> [   64.318846] Hardware name: ASUS All Series/Z87-EXPERT, BIOS 1008
> 05/17/2013
> [   64.318851] Workqueue: events intel_gen6_powersave_work [i915]
> [   64.318853]  0000000000000000 ffffffff8170a8d4 0000000000000000
> ffffffff81033f78
> [   64.318854]  ffffffffa0068408 ffff880251380000 ffff880251ac4000
> 0000000000040000
> [   64.318854]  ffff880251388238 ffffffffa0068408 ffff880251380000
> ffffffffa006e97c
> [   64.318855] Call Trace:
> [   64.318859]  [<ffffffff8170a8d4>] ? dump_stack+0x41/0x51
> [   64.318861]  [<ffffffff81033f78>] ? warn_slowpath_common+0x6f/0x84
> [   64.318867]  [<ffffffffa0068408>] ? gen6_enable_rps_interrupts+0x39/0x5c
> [i915]
> [   64.318872]  [<ffffffffa0068408>] ? gen6_enable_rps_interrupts+0x39/0x5c
> [i915]
> [   64.318877]  [<ffffffffa006e97c>] ? intel_gen6_powersave_work+0xe04/0xefe
> [i915]
> [   64.318880]  [<ffffffff81044d0c>] ? process_one_work+0x1c1/0x2ca
> [   64.318881]  [<ffffffff8104584d>] ? worker_thread+0x1c9/0x2ad
> [   64.318882]  [<ffffffff81045684>] ? rescuer_thread+0x267/0x267
> [   64.318883]  [<ffffffff81049dc2>] ? kthread+0xca/0xd2
> [   64.318884]  [<ffffffff81049cf8>] ? kthread_create_on_node+0x15d/0x15d
> [   64.318887]  [<ffffffff81714dbc>] ? ret_from_fork+0x7c/0xb0
> [   64.318888]  [<ffffffff81049cf8>] ? kthread_create_on_node+0x15d/0x15d

This Calltrace was tracked by bug 80517. Close this one.
Comment 7 Guo Jinxian 2014-07-23 06:18:01 UTC
Created attachment 103317 [details]
dmesg

This bug still able to reproduce on latest -fixes(a0d036b074b4a5a933e37fcb9bdd6b3cc80a0387)

[  298.347965] WARNING: CPU: 0 PID: 674 at drivers/gpu/drm/i915/i915_gem.c:1628 i915_gem_release_all_mmaps+0x28/0x7e [i915]()
[  298.347966] Modules linked in: dm_mod snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic iTCO_wdt iTCO_vendor_support ppdev pcspkr serio_raw i2c_i801 snd_hda_intel snd_hda_controller snd_hda_codec snd_hwdep snd_pcm firewire_ohci lpc_ich firewire_core crc_itu_t mfd_core snd_timer snd soundcore parport_pc parport tpm_tis tpm acpi_cpufreq i915 button video drm_kms_helper drm
[  298.347984] CPU: 0 PID: 674 Comm: kworker/0:1 Not tainted 3.16.0-rc6_drm-intel-fixes_a0d036_20140723+ #748
[  298.347986] Hardware name:                  /DQ67SW, BIOS SWQ6710H.86A.0060.2011.1220.1805 12/20/2011
[  298.347991] Workqueue: pm pm_runtime_work
[  298.347992]  0000000000000000 0000000000000009 ffffffff81780c0d 0000000000000000
[  298.347995]  ffffffff8103986c ffff880232bcbc90 ffffffffa007fe27 ffff880232bcbce8
[  298.347997]  ffff880002810000 ffff8802342ce898 ffff880002817980 ffff8802347fa860
[  298.348000] Call Trace:
[  298.348004]  [<ffffffff81780c0d>] ? dump_stack+0x41/0x51
[  298.348008]  [<ffffffff8103986c>] ? warn_slowpath_common+0x78/0x90
[  298.348016]  [<ffffffffa007fe27>] ? i915_gem_release_all_mmaps+0x28/0x7e [i915]
[  298.348024]  [<ffffffffa007fe27>] ? i915_gem_release_all_mmaps+0x28/0x7e [i915]
[  298.348029]  [<ffffffffa0066433>] ? intel_runtime_suspend+0xe1/0x812 [i915]
[  298.348033]  [<ffffffff81350d0f>] ? pci_pm_runtime_suspend+0x60/0x119
[  298.348035]  [<ffffffff813decbc>] ? __rpm_callback+0x28/0x4c
[  298.348038]  [<ffffffff813ded2b>] ? rpm_callback+0x4b/0x69
[  298.348040]  [<ffffffff813df290>] ? rpm_suspend+0x262/0x417
[  298.348047]  [<ffffffffa007178f>] ? intel_gen6_powersave_work+0xb5e/0xb6d [i915]
[  298.348050]  [<ffffffff813e0047>] ? pm_runtime_work+0x65/0x7b
[  298.348052]  [<ffffffff8104d636>] ? process_one_work+0x1e2/0x363
[  298.348054]  [<ffffffff8104de16>] ? worker_thread+0x2f2/0x3f1
[  298.348056]  [<ffffffff8104db24>] ? pool_mayday_timeout+0xf2/0xf2
[  298.348059]  [<ffffffff8105258e>] ? kthread+0xc5/0xcd
[  298.348062]  [<ffffffff810524c9>] ? kthread_freezable_should_stop+0x40/0x40
[  298.348064]  [<ffffffff817866ac>] ? ret_from_fork+0x7c/0xb0
[  298.348067]  [<ffffffff810524c9>] ? kthread_freezable_should_stop+0x40/0x40
Comment 8 Mika Kuoppala 2014-08-20 10:10:46 UTC
commit eedd10f45bdcb2a5b2afa35f845e080c3bc984f2
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jun 16 08:57:44 2014 +0100

    drm/i915: Simplify i915_gem_release_all_mmaps()

is now part of -fixes kernel. Please retest
Comment 9 Guo Jinxian 2014-08-21 07:49:48 UTC
(In reply to comment #8)
> commit eedd10f45bdcb2a5b2afa35f845e080c3bc984f2
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Mon Jun 16 08:57:44 2014 +0100
> 
>     drm/i915: Simplify i915_gem_release_all_mmaps()
> 
> is now part of -fixes kernel. Please retest

The result is skipped on latest -fixes(1a125d8a2c22b11741fc47d4ffcf7a5ffa044dd3). This bug unable to reproduce.

[root@x-bsw01 tests]# ./pm_rpm --run-subtest system-suspend
IGT-Version: 1.7-g4d2f511 (x86_64) (Linux: 3.17.0-rc1_drm-intel-fixes_1a125d_20140821+ x86_64)
Test requirement not met in function setup_environment, file pm_rpm.c:720:
Test requirement: !(drmSetMaster(drm_fd) == 0)
Can't become DRM master, please check if no other DRM client is running.
Last errno: 22, Invalid argument
Subtest system-suspend: SKIP
[root@x-bsw01 tests]# echo $?
77
[root@x-bsw01 tests]# dmesg -r|egrep "<[1-4]>"|grep drm
[root@x-bsw01 tests]#
Comment 10 Paulo Zanoni 2014-09-03 20:51:47 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > commit eedd10f45bdcb2a5b2afa35f845e080c3bc984f2
> > Author: Chris Wilson <chris@chris-wilson.co.uk>
> > Date:   Mon Jun 16 08:57:44 2014 +0100
> > 
> >     drm/i915: Simplify i915_gem_release_all_mmaps()
> > 
> > is now part of -fixes kernel. Please retest
> 
> The result is skipped on latest
> -fixes(1a125d8a2c22b11741fc47d4ffcf7a5ffa044dd3). This bug unable to
> reproduce.
> 
> [root@x-bsw01 tests]# ./pm_rpm --run-subtest system-suspend
> IGT-Version: 1.7-g4d2f511 (x86_64) (Linux:
> 3.17.0-rc1_drm-intel-fixes_1a125d_20140821+ x86_64)
> Test requirement not met in function setup_environment, file pm_rpm.c:720:
> Test requirement: !(drmSetMaster(drm_fd) == 0)
> Can't become DRM master, please check if no other DRM client is running.
> Last errno: 22, Invalid argument
> Subtest system-suspend: SKIP
> [root@x-bsw01 tests]# echo $?
> 77
> [root@x-bsw01 tests]# dmesg -r|egrep "<[1-4]>"|grep drm
> [root@x-bsw01 tests]#

The error message says you have other DRM clients running. Please retest.
Comment 11 Guo Jinxian 2014-09-05 06:50:12 UTC
Test passed on latest -nightly(8741309e3741a64c1f83ac1f0b8144452bb83441)

[root@x-hsw24 tests]# ./pm_rpm --run-subtest system-suspend
IGT-Version: 1.7-g0818875 (x86_64) (Linux: 3.17.0-rc2_drm-intel-nightly_874130_20140905+ x86_64)
Runtime PM support: 1
PC8 residency support: 0
rtcwake: wakeup from "mem" using /dev/rtc0 at Fri Sep  5 06:34:02 2014
Subtest system-suspend: SUCCESS
[root@x-hsw24 tests]# dmesg -r|egrep "<[1-4]>"|grep drm
[root@x-hsw24 tests]#
Comment 12 Paulo Zanoni 2014-09-05 13:17:34 UTC
(In reply to comment #11)
> Test passed on latest -nightly(8741309e3741a64c1f83ac1f0b8144452bb83441)
> 
> [root@x-hsw24 tests]# ./pm_rpm --run-subtest system-suspend
> IGT-Version: 1.7-g0818875 (x86_64) (Linux:
> 3.17.0-rc2_drm-intel-nightly_874130_20140905+ x86_64)
> Runtime PM support: 1
> PC8 residency support: 0
> rtcwake: wakeup from "mem" using /dev/rtc0 at Fri Sep  5 06:34:02 2014
> Subtest system-suspend: SUCCESS
> [root@x-hsw24 tests]# dmesg -r|egrep "<[1-4]>"|grep drm
> [root@x-hsw24 tests]#

Thanks for testing! Closing bug.
Comment 13 Guo Jinxian 2014-09-10 07:59:30 UTC
(In reply to comment #11)
> Test passed on latest -nightly(8741309e3741a64c1f83ac1f0b8144452bb83441)
> 
> [root@x-hsw24 tests]# ./pm_rpm --run-subtest system-suspend
> IGT-Version: 1.7-g0818875 (x86_64) (Linux:
> 3.17.0-rc2_drm-intel-nightly_874130_20140905+ x86_64)
> Runtime PM support: 1
> PC8 residency support: 0
> rtcwake: wakeup from "mem" using /dev/rtc0 at Fri Sep  5 06:34:02 2014
> Subtest system-suspend: SUCCESS
> [root@x-hsw24 tests]# dmesg -r|egrep "<[1-4]>"|grep drm
> [root@x-hsw24 tests]#

Verified.
Comment 14 Jari Tahvanainen 2016-11-22 08:27:00 UTC
Closing verified+fixed. commit b401796.

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.