Bug 95004

Summary: [bsw] drv_module_reload_basic intel_user_framebuffer_leak with !FBDEV
Product: DRI Reporter: Chris Wilson <chris>
Component: DRM/IntelAssignee: Maarten Lankhorst <bugs>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: high CC: intel-gfx-bugs
Version: XOrg git   
Hardware: Other   
OS: All   
Whiteboard: PatchMerged
i915 platform: BSW/CHT i915 features: GEM/Other

Description Chris Wilson 2016-04-18 21:55:29 UTC
[   12.668941] ------------[ cut here ]------------
[   12.669012] WARNING: CPU: 0 PID: 926 at drivers/gpu/drm/drm_crtc.c:5939 drm_mode_config_cleanup+0x204/0x230
[   12.669046] Modules linked in: i915(-) intel_gtt drm_kms_helper
[   12.669121] CPU: 0 PID: 926 Comm: rmmod Not tainted 4.6.0-rc4+ #209
[   12.669147] Hardware name:                  /NUC5CPYB, BIOS PYBSWCEL.86A.0027.2015.0507.1758 05/07/2015
[   12.669178]  0000000000000000 ffff88007addfcd8 ffffffff812841a8 0000000000000000
[   12.669240]  0000000000000000 ffff88007addfd18 ffffffff81072a8b 0000173375d22000
[   12.669308]  ffff880275751c58 ffff880275751800 ffff880275751b18 0000000000000000
[   12.669366] Call Trace:
[   12.669402]  [<ffffffff812841a8>] dump_stack+0x4d/0x65
[   12.669435]  [<ffffffff81072a8b>] __warn+0xcb/0xf0
[   12.669466]  [<ffffffff81072b7d>] warn_slowpath_null+0x1d/0x20
[   12.669497]  [<ffffffff813435f4>] drm_mode_config_cleanup+0x204/0x230
[   12.669703]  [<ffffffffa00b11b8>] intel_modeset_cleanup+0x88/0xb0 [i915]
[   12.669895]  [<ffffffffa00e9e49>] i915_driver_unload+0x69/0x1b0 [i915]
[   12.669929]  [<ffffffff81339de9>] drm_dev_unregister+0x29/0xb0
[   12.669960]  [<ffffffff8133a4c3>] drm_put_dev+0x23/0x60
[   12.670128]  [<ffffffffa002a195>] i915_pci_remove+0x15/0x20 [i915]
[   12.670175]  [<ffffffff812b5309>] pci_device_remove+0x39/0xc0
[   12.670217]  [<ffffffff8135a1f1>] __device_release_driver+0xa1/0x160
[   12.670258]  [<ffffffff8135ae26>] driver_detach+0xa6/0xb0
[   12.670297]  [<ffffffff81359bd5>] bus_remove_driver+0x55/0xd0
[   12.670339]  [<ffffffff8135b5bc>] driver_unregister+0x2c/0x50
[   12.670379]  [<ffffffff812b4181>] pci_unregister_driver+0x21/0x90
[   12.670420]  [<ffffffff8133bb84>] drm_pci_exit+0x94/0xb0
[   12.670619]  [<ffffffffa00ea5d1>] i915_exit+0x20/0x181 [i915]
[   12.670669]  [<ffffffff810d9ccc>] SyS_delete_module+0x19c/0x1f0
[   12.670715]  [<ffffffff8148385b>] entry_SYSCALL_64_fastpath+0x13/0x8f
[   12.670852] ---[ end trace f7177b2caa14eb03 ]---
[   12.670937] ------------[ cut here ]------------
[   12.671215] WARNING: CPU: 0 PID: 926 at drivers/gpu/drm/i915/i915_gem.c:3820 i915_gem_free_object+0x2f3/0x310 [i915]
[   12.671282] WARN_ON(obj->frontbuffer_bits)
[   12.671318] Modules linked in: i915(-) intel_gtt drm_kms_helper
[   12.671458] CPU: 0 PID: 926 Comm: rmmod Tainted: G        W       4.6.0-rc4+ #209
[   12.671507] Hardware name:                  /NUC5CPYB, BIOS PYBSWCEL.86A.0027.2015.0507.1758 05/07/2015
[   12.671558]  0000000000000000 ffff88007addfbe0 ffffffff812841a8 ffff88007addfc30
[   12.671645]  0000000000000000 ffff88007addfc20 ffffffff81072a8b 00000eec7addfc18
[   12.671721]  ffff88027513bf80 ffff88027513c000 ffff8802758d0000 ffff88027513c0c0
[   12.671795] Call Trace:
[   12.671839]  [<ffffffff812841a8>] dump_stack+0x4d/0x65
[   12.671883]  [<ffffffff81072a8b>] __warn+0xcb/0xf0
[   12.671925]  [<ffffffff81072aff>] warn_slowpath_fmt+0x4f/0x60
[   12.672114]  [<ffffffffa0066693>] i915_gem_free_object+0x2f3/0x310 [i915]
[   12.672160]  [<ffffffff81334fb0>] drm_gem_object_free+0x30/0x50
[   12.672359]  [<ffffffffa009d7e2>] intel_user_framebuffer_destroy+0x82/0xc0 [i915]
[   12.672418]  [<ffffffff81340b65>] drm_framebuffer_free+0x55/0x60
[   12.672458]  [<ffffffff81343591>] drm_mode_config_cleanup+0x1a1/0x230
[   12.672656]  [<ffffffffa00b11b8>] intel_modeset_cleanup+0x88/0xb0 [i915]
[   12.672859]  [<ffffffffa00e9e49>] i915_driver_unload+0x69/0x1b0 [i915]
[   12.672906]  [<ffffffff81339de9>] drm_dev_unregister+0x29/0xb0
[   12.672949]  [<ffffffff8133a4c3>] drm_put_dev+0x23/0x60
[   12.673114]  [<ffffffffa002a195>] i915_pci_remove+0x15/0x20 [i915]
[   12.673157]  [<ffffffff812b5309>] pci_device_remove+0x39/0xc0
[   12.673198]  [<ffffffff8135a1f1>] __device_release_driver+0xa1/0x160
[   12.673238]  [<ffffffff8135ae26>] driver_detach+0xa6/0xb0
[   12.673279]  [<ffffffff81359bd5>] bus_remove_driver+0x55/0xd0
[   12.673319]  [<ffffffff8135b5bc>] driver_unregister+0x2c/0x50
[   12.673359]  [<ffffffff812b4181>] pci_unregister_driver+0x21/0x90
[   12.673400]  [<ffffffff8133bb84>] drm_pci_exit+0x94/0xb0
[   12.673601]  [<ffffffffa00ea5d1>] i915_exit+0x20/0x181 [i915]
[   12.673646]  [<ffffffff810d9ccc>] SyS_delete_module+0x19c/0x1f0
[   12.673689]  [<ffffffff8148385b>] entry_SYSCALL_64_fastpath+0x13/0x8f
[   12.673797] ---[ end trace f7177b2caa14eb04 ]---
[   12.673835] ------------[ cut here ]------------
[   12.674039] WARNING: CPU: 0 PID: 926 at drivers/gpu/drm/i915/i915_gem.c:3827 i915_gem_free_object+0x2c6/0x310 [i915]
[   12.674094] WARN_ON(obj->pages_pin_count)
[   12.674112] Modules linked in: i915(-) intel_gtt drm_kms_helper
[   12.674231] CPU: 0 PID: 926 Comm: rmmod Tainted: G        W       4.6.0-rc4+ #209
[   12.674280] Hardware name:                  /NUC5CPYB, BIOS PYBSWCEL.86A.0027.2015.0507.1758 05/07/2015
[   12.674329]  0000000000000000 ffff88007addfbe0 ffffffff812841a8 ffff88007addfc30
[   12.674408]  0000000000000000 ffff88007addfc20 ffffffff81072a8b 00000ef37addfc18
[   12.674485]  ffff88027513bf80 ffff88027513c000 ffff8802758d0000 ffff88027513c0c0
[   12.674562] Call Trace:
[   12.674603]  [<ffffffff812841a8>] dump_stack+0x4d/0x65
[   12.674644]  [<ffffffff81072a8b>] __warn+0xcb/0xf0
[   12.674684]  [<ffffffff81072aff>] warn_slowpath_fmt+0x4f/0x60
[   12.674872]  [<ffffffffa0066666>] i915_gem_free_object+0x2c6/0x310 [i915]
[   12.674916]  [<ffffffff81334fb0>] drm_gem_object_free+0x30/0x50
[   12.675124]  [<ffffffffa009d7e2>] intel_user_framebuffer_destroy+0x82/0xc0 [i915]
[   12.675182]  [<ffffffff81340b65>] drm_framebuffer_free+0x55/0x60
[   12.675222]  [<ffffffff81343591>] drm_mode_config_cleanup+0x1a1/0x230
[   12.675419]  [<ffffffffa00b11b8>] intel_modeset_cleanup+0x88/0xb0 [i915]
[   12.675626]  [<ffffffffa00e9e49>] i915_driver_unload+0x69/0x1b0 [i915]
[   12.675672]  [<ffffffff81339de9>] drm_dev_unregister+0x29/0xb0
[   12.675712]  [<ffffffff8133a4c3>] drm_put_dev+0x23/0x60
[   12.675875]  [<ffffffffa002a195>] i915_pci_remove+0x15/0x20 [i915]
[   12.675921]  [<ffffffff812b5309>] pci_device_remove+0x39/0xc0
[   12.675960]  [<ffffffff8135a1f1>] __device_release_driver+0xa1/0x160
[   12.676000]  [<ffffffff8135ae26>] driver_detach+0xa6/0xb0
[   12.676040]  [<ffffffff81359bd5>] bus_remove_driver+0x55/0xd0
[   12.676084]  [<ffffffff8135b5bc>] driver_unregister+0x2c/0x50
[   12.676127]  [<ffffffff812b4181>] pci_unregister_driver+0x21/0x90
[   12.676169]  [<ffffffff8133bb84>] drm_pci_exit+0x94/0xb0
[   12.676368]  [<ffffffffa00ea5d1>] i915_exit+0x20/0x181 [i915]
[   12.676424]  [<ffffffff810d9ccc>] SyS_delete_module+0x19c/0x1f0
[   12.676474]  [<ffffffff8148385b>] entry_SYSCALL_64_fastpath+0x13/0x8f
[   12.676582] ---[ end trace f7177b2caa14eb05 ]---
Comment 1 Daniel Vetter 2016-05-04 15:29:00 UTC
BAT fail should be P1.
Comment 2 Daniel Vetter 2016-05-10 11:26:09 UTC
Is this still happening, or all fixed now with the fbdev refcounting fixes?
Comment 3 yann 2016-05-10 16:00:59 UTC
Chris, can you confirm it is fixed ?
If you don't have time to re-test, please share your configuration (HW & SW) and I will assign a QA member to re-test for you.
Comment 4 Jari Tahvanainen 2016-09-05 11:58:32 UTC
This failure has not been visible on CI BSW during August+September. Proposing this to be closed/worksforme (or fixed). Please comment if you disagree.
Comment 5 Chris Wilson 2016-09-08 10:57:54 UTC
Still visible on -nightly.
Comment 6 Jani Saarinen 2016-09-08 15:38:11 UTC
Chris, is there something we could help do to get this visible also on CI?
What BSW system you have?
Comment 7 Chris Wilson 2016-09-08 16:28:02 UTC
[   12.669147] Hardware name:                  /NUC5CPYB, BIOS PYBSWCEL.86A.0027.2015.0507.1758 05/07/2015

Handy :)

You have to disable fbdev, and atm it has an actual display plugged in!

CRTC info
---------
CRTC 26: pipe: A, active=yes, (size=1920x1080), dither=no, bpp=24
	fb: 51, pos: 0x0, size: 1920x1080
	encoder 39: type: DP B, connectors:
		connector 40: type: DP-1, status: connected, mode:
		id 0:"1920x1080" freq 60 clock 148499 hdisp 1920 hss 2008 hse 2052 htot 2200 vdisp 1080 vss 1084 vse 1089 vtot 1125 type 0x40 flags 0x5
	cursor visible? no, position (0, 0), size 0x0, addr 0x00000000, active? no
	No scalers available on this platform
	--Plane id 23: type=PRI, crtc_pos=   0x   0, crtc_size=1920x1080, src_pos=0.0000x0.0000, src_size=1920.0000x1080.0000, format=XR24 little-endian (0x34325258), rotation=0 (0x00000001)
	--Plane id 25: type=CUR, crtc_pos=   0x   0, crtc_size=   0x   0, src_pos=0.0000x0.0000, src_size=0.0000x0.0000, format=N/A, rotation=0 (0x00000001)
	--Plane id 27: type=OVL, crtc_pos=   0x   0, crtc_size=   0x   0, src_pos=0.0000x0.0000, src_size=0.0000x0.0000, format=N/A, rotation=0 (0x00000001)
	--Plane id 28: type=OVL, crtc_pos=   0x   0, crtc_size=   0x   0, src_pos=0.0000x0.0000, src_size=0.0000x0.0000, format=N/A, rotation=0 (0x00000001)
	underrun reporting: cpu=no pch=yes 
CRTC 31: pipe: B, active=no, (size=0x0), dither=no, bpp=0
	underrun reporting: cpu=no pch=yes 
CRTC 36: pipe: C, active=no, (size=0x0), dither=no, bpp=0
	underrun reporting: cpu=no pch=yes 

Connector info
--------------
connector 40: type DP-1, status: connected
	name: 
	physical dimensions: 0x0mm
	subpixel order: Unknown
	CEA rev: 0
	DPCD rev: 11
	audio support: no
	modes:
connector 44: type HDMI-A-1, status: disconnected
	audio support: no
	modes:
connector 47: type DP-2, status: disconnected
	DPCD rev: 0
	audio support: no
	modes:
connector 49: type HDMI-A-2, status: disconnected
	audio support: no
	modes:
root@braswell:/home/ickle# cat /sys/kernel/debug/dri/1/i915_display_info 
CRTC info
---------
CRTC 26: pipe: A, active=yes, (size=1920x1080), dither=no, bpp=24
	fb: 51, pos: 0x0, size: 1920x1080
	encoder 39: type: DP B, connectors:
		connector 40: type: DP-1, status: connected, mode:
		id 0:"1920x1080" freq 60 clock 148499 hdisp 1920 hss 2008 hse 2052 htot 2200 vdisp 1080 vss 1084 vse 1089 vtot 1125 type 0x40 flags 0x5
	cursor visible? no, position (0, 0), size 0x0, addr 0x00000000, active? no
	No scalers available on this platform
	--Plane id 23: type=PRI, crtc_pos=   0x   0, crtc_size=1920x1080, src_pos=0.0000x0.0000, src_size=1920.0000x1080.0000, format=XR24 little-endian (0x34325258), rotation=0 (0x00000001)
	--Plane id 25: type=CUR, crtc_pos=   0x   0, crtc_size=   0x   0, src_pos=0.0000x0.0000, src_size=0.0000x0.0000, format=N/A, rotation=0 (0x00000001)
	--Plane id 27: type=OVL, crtc_pos=   0x   0, crtc_size=   0x   0, src_pos=0.0000x0.0000, src_size=0.0000x0.0000, format=N/A, rotation=0 (0x00000001)
	--Plane id 28: type=OVL, crtc_pos=   0x   0, crtc_size=   0x   0, src_pos=0.0000x0.0000, src_size=0.0000x0.0000, format=N/A, rotation=0 (0x00000001)
	underrun reporting: cpu=no pch=yes 
CRTC 31: pipe: B, active=no, (size=0x0), dither=no, bpp=0
	underrun reporting: cpu=no pch=yes 
CRTC 36: pipe: C, active=no, (size=0x0), dither=no, bpp=0
	underrun reporting: cpu=no pch=yes 

Connector info
--------------
connector 40: type DP-1, status: connected
	name: 
	physical dimensions: 0x0mm
	subpixel order: Unknown
	CEA rev: 0
	DPCD rev: 11
	audio support: no
	modes:
connector 44: type HDMI-A-1, status: disconnected
	audio support: no
	modes:
connector 47: type DP-2, status: disconnected
	DPCD rev: 0
	audio support: no
	modes:
connector 49: type HDMI-A-2, status: disconnected
	audio support: no
	modes:
Comment 8 Jari Tahvanainen 2016-10-03 10:22:03 UTC
Reducing priority since failure cannot be seen with default .config. 
In order to see the failure one needs to disable fbdev and then execute drv_module_reload_basic
- CONFIG_DRM_FBDEV_EMULATION=n
- Default: CONFIG_DRM_FBDEV_EMULATION=y
Comment 9 Chris Wilson 2017-02-03 11:21:47 UTC
Mostly fixed by

commit a667fb402c1e856209bf9e77ba41fc1cf356b867
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Thu Dec 15 15:29:44 2016 +0100

    drm/i915: Disable all crtcs during driver unload, v2.

still a small residual leak that Maarten has another patch for.
Comment 10 Ricardo 2017-05-09 17:49:38 UTC
Maarten any update on patches pending?
Comment 11 Maarten Lankhorst 2017-05-10 09:40:49 UTC
Yeah this bug is completely fixed with the following commit to plug the leaks.

commit 9b2104f423de5c148749a07e8197dbab4c449877
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Tue Feb 21 14:51:40 2017 +0100

    drm/atomic: Make disable_all helper fully disable the crtc.

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.