linux-stable/drivers/gpu/drm
Chris Wilson cc98e6ce6a drm: Initialise drm_mm.head_node.allocated
commit 202b52b7fb ("drm: Track drm_mm nodes with an interval tree")
introduced a requirement that the special drm_mm.head_node was
initialised and marked as not being allocated. It is a very special node
that has no side but has a hole that represents the drm_mm address
space, and holds the list of nodes. Since it is not a real node, it is
not part of the node rbtree and we detect this as it being unallocated.
This presumed that drm_mm_init() was initialising it to zero. It happens
that i915 kzallocs its objects and so it was accidentally setting it,
but for generic use we cannot make that assumption.

[   22.981519] general protection fault: 0000 [#1] SMP
[   22.981521] Modules linked in: test_drm_mm(+) ctr ccm arc4 rt2800usb rt2x00usb rt2800lib rt2x00lib crc_ccitt mac80211 cmac rfcomm bnep snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_codec_generic snd_hda_intel dcdbas snd_hda_codec x86_pkg_temp_thermal intel_powerclamp btusb snd_hda_core coretemp crct10dif_pclmul cfg80211 btrtl btbcm btintel bluetooth crc32_pclmul ghash_clmulni_intel aesni_intel snd_pcm i2c_hid aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd snd_timer hid_multitouch snd joydev serio_raw lpc_ich mfd_core i2c_designware_platform i2c_designware_core 8250_dw binfmt_misc soundcore acpi_pad nls_iso8859_1 usbhid hid psmouse ahci libahci [last unloaded: test_drm_mm]
[   22.981544] CPU: 1 PID: 2088 Comm: drm_mm Tainted: G        W       4.9.0-rc7+ #234
[   22.981545] Hardware name: Dell Inc. XPS 13 9343/0310JH, BIOS A07 11/11/2015
[   22.981546] task: ffff88020c971cc0 task.stack: ffffc90001728000
[   22.981547] RIP: 0010:[<ffffffff814050f0>]  [<ffffffff814050f0>] drm_mm_interval_tree_add_node+0xa0/0xd0
[   22.981551] RSP: 0018:ffffc9000172ba98  EFLAGS: 00010202
[   22.981552] RAX: 0f0000c69cf63d80 RBX: ffff88020be00000 RCX: ffff88020be00000
[   22.981553] RDX: 0000000000000fff RSI: ffffc9000172bc48 RDI: ffffffff810ac4df
[   22.981553] RBP: ffffc9000172bb08 R08: ffffc9000172bc70 R09: 0000000000000fff
[   22.981554] R10: ffffffff810ac4d7 R11: 4dc04d8b4cffffe5 R12: 0000000000001000
[   22.981555] R13: ffffc9000172bbd0 R14: ffffc9000172bbe0 R15: 0000000002000000
[   22.981556] FS:  00007f80c9fab740(0000) GS:ffff88021f480000(0000) knlGS:0000000000000000
[   22.981557] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   22.981558] CR2: 00007f80c9fd5000 CR3: 000000020c191000 CR4: 00000000003406e0
[   22.981559] Stack:
[   22.981560]  ffffffff81405d09 ffff88020be00000 ffffc9000172bbe0 000000000172bb08
[   22.981562]  ffffffffffffffff 0000000000000000 0000000000000000 0000000000000000
[   22.981563]  0000000002000000 0000000002000000 ffffffffa02f3000 ffff88020be00000
[   22.981565] Call Trace:
[   22.981568]  [<ffffffff81405d09>] ? drm_mm_insert_node_generic+0x229/0x310
[   22.981570]  [<ffffffffa02f3000>] ? 0xffffffffa02f3000
[   22.981572]  [<ffffffffa02903c1>] __subtest_insert_range.constprop.7+0xd1/0x5b0 [test_drm_mm]
[   22.981575]  [<ffffffff81081222>] ? default_wake_function+0x12/0x20
[   22.981576]  [<ffffffff81096905>] ? __wake_up_common+0x55/0x90
[   22.981578]  [<ffffffff81085f42>] ? sched_clock_cpu+0x72/0xa0
[   22.981581]  [<ffffffff811308ad>] ? irq_work_queue+0xd/0x80
[   22.981582]  [<ffffffff810abcc4>] ? wake_up_klogd+0x34/0x40
[   22.981584]  [<ffffffff810ac19d>] ? console_unlock+0x4cd/0x530
[   22.981585]  [<ffffffff810ac4d7>] ? vprintk_emit+0x2d7/0x490
[   22.981587]  [<ffffffff810ac82f>] ? vprintk_default+0x1f/0x30
[   22.981589]  [<ffffffff81146e1c>] ? printk+0x4d/0x4f
[   22.981590]  [<ffffffffa02f3000>] ? 0xffffffffa02f3000
[   22.981592]  [<ffffffffa02908b5>] subtest_insert_range+0x15/0x80 [test_drm_mm]
[   22.981594]  [<ffffffffa02f3088>] test_drm_mm_init+0x88/0x1000 [test_drm_mm]
[   22.981597]  [<ffffffff8100043d>] do_one_initcall+0x3d/0x150
[   22.981600]  [<ffffffff8119dfbf>] ? kfree+0x13f/0x180
[   22.981602]  [<ffffffff811471f2>] do_init_module+0x60/0x1f1
[   22.981606]  [<ffffffff810db878>] load_module+0x2228/0x2790
[   22.981608]  [<ffffffff810d8590>] ? __symbol_put+0x40/0x40
[   22.981612]  [<ffffffff811c52b1>] ? kernel_read+0x41/0x60
[   22.981614]  [<ffffffff810dbfb6>] SYSC_finit_module+0x96/0xd0
[   22.981617]  [<ffffffff810dc00e>] SyS_finit_module+0xe/0x10
[   22.981620]  [<ffffffff816e7aa4>] entry_SYSCALL_64_fastpath+0x17/0x98
[   22.981622] Code: c7 41 30 00 00 00 00 48 89 e5 48 89 3a 48 c7 c2 20 4e 40 81 e8 b2 a1 f0 ff 5d c3 48 8d 56 78 45 31 d2 48 89 d6 eb 25 48 8b 51 58 <48> 39 50 38 73 04 48 89 50 38 4c 8b 58 28 4c 39 59 48 48 8d 50
[   22.981651] RIP  [<ffffffff814050f0>] drm_mm_interval_tree_add_node+0xa0/0xd0
[   22.981655]  RSP <ffffc9000172ba98>

Testcase: igt/drm_mm
Fixes: 202b52b7fb ("drm: Track drm_mm nodes with an interval tree")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.9-rc1+
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161130205126.31106-1-chris@chris-wilson.co.uk
2016-12-01 10:35:45 +01:00
..
amd drm/irq: Unexport drm_vblank_on/off 2016-11-15 23:33:48 +01:00
arc drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
arm Merge branch 'drm-tda998x-mali' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next 2016-11-17 08:55:26 +10:00
armada drm/armada: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:54:13 +01:00
ast drm/ast: free correct pointer in astfb_create() error paths 2016-11-14 07:45:16 +01:00
atmel-hlcdc drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
bochs drm/bochs: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:54:38 +01:00
bridge drm/bridge: adv7511: Enable the audio data and clock pads on adv7533 2016-11-29 09:48:54 +05:30
cirrus Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-11-11 09:28:44 +10:00
etnaviv drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
exynos drm/exynos: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:54:50 +01:00
fsl-dcu drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
gma500 drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 08:01:01 +01:00
hisilicon drm/hisilicon/hibmc: mark PM functions __maybe_unused 2016-11-25 07:58:55 +01:00
i2c Merge branch 'drm-tda998x-mali' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next 2016-11-17 08:55:26 +10:00
i810 drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
i915 drm: Nuke modifier[1-3] 2016-11-17 11:58:09 +01:00
imx drm/imx: Switch to drm_fb_cma_prepare_fb() helper 2016-11-15 08:25:06 +01:00
mediatek drm/irq: Unexport drm_vblank_count 2016-11-15 23:33:47 +01:00
mga
mgag200 Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-11-11 09:28:44 +10:00
msm drm: Nuke modifier[1-3] 2016-11-17 11:58:09 +01:00
nouveau Merge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-next 2016-11-17 10:08:29 +10:00
omapdrm drm/omapdrm: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:58:15 +01:00
panel
qxl drm/qxl: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:55:33 +01:00
r128
radeon drm/radeon: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:56:52 +01:00
rcar-du Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/media into drm-next 2016-11-16 09:39:21 +10:00
rockchip drm/rockchip: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:56:47 +01:00
savage drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
shmobile drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
sis drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
sti Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-11-11 09:28:44 +10:00
sun4i Merge tag 'drm-misc-next-2016-11-16' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2016-11-17 08:02:46 +10:00
tdfx drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
tegra drm/tegra: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:56:58 +01:00
tilcdc drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
ttm drm/ttm: fix ttm_bo_wait 2016-11-09 00:46:04 +05:30
udl drm/udl: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:57:59 +01:00
vc4 This pull request brings in fragment shader threading and ETC1 support 2016-11-17 09:43:56 +10:00
vgem dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
via drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
virtio drm/virtio: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:58:10 +01:00
vmwgfx drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
zte drm: zte: checking for NULL instead of IS_ERR() 2016-11-15 11:00:42 +01:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic.c drm: Introduce drm_framebuffer_assign() 2016-11-29 10:22:08 +01:00
drm_atomic_helper.c drm/atomic: Unconfuse the old_state mess in commmit_tail 2016-11-22 11:11:57 +01:00
drm_auth.c
drm_blend.c drm: RIP mode_config->rotation_property 2016-10-22 10:42:11 +02:00
drm_bridge.c
drm_bufs.c
drm_cache.c
drm_color_mgmt.c drm/color: document NULL values and default settings better 2016-11-15 22:39:48 +01:00
drm_connector.c drm: document standard connector properties 2016-11-18 09:45:07 +01:00
drm_context.c
drm_crtc.c drm/fence: add out-fences support 2016-11-16 14:36:27 +01:00
drm_crtc_helper.c
drm_crtc_helper_internal.h
drm_crtc_internal.h drm/fence: add fence timeline to drm_crtc 2016-11-16 10:42:48 +01:00
drm_debugfs.c drm/atomic: cleanup debugfs entries on un-registering the driver. 2016-11-21 13:22:08 -05:00
drm_debugfs_crc.c drm: fix sparse warnings on undeclared symbols in crc debugfs 2016-10-19 14:10:29 +03:00
drm_dma.c
drm_dp_aux_dev.c
drm_dp_dual_mode_helper.c drm: Print some debug/error info during DP dual mode detect 2016-10-26 15:57:11 -04:00
drm_dp_helper.c
drm_dp_mst_topology.c drm/dp/mst: Check peer device type before attempting EDID read 2016-10-26 18:53:44 +02:00
drm_drv.c drm: Nerf DRM_CONTROL nodes 2016-11-17 08:41:31 +01:00
drm_dumb_buffers.c drm: Consolidate dumb buffer docs 2016-11-15 12:51:49 +01:00
drm_edid.c drm/edid: Consider alternate cea timings to be the same VIC 2016-11-28 18:05:57 +02:00
drm_edid_load.c
drm_encoder.c drm: Fix locking cargo-cult in encoder/plane init/cleanup 2016-11-29 23:34:36 +01:00
drm_encoder_slave.c
drm_fb_cma_helper.c drm/fb_cma_helper: Add drm_fb_cma_prepare_fb() helper 2016-11-14 12:43:58 +01:00
drm_fb_helper.c drm: Protect fb_helper list manipulation with a mutex 2016-11-29 15:52:32 -05:00
drm_flip_work.c
drm_fops.c drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
drm_fourcc.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
drm_framebuffer.c drm: Nuke modifier[1-3] 2016-11-17 11:58:09 +01:00
drm_gem.c
drm_gem_cma_helper.c
drm_global.c
drm_hashtab.c
drm_info.c drm: Print device information again in debugfs 2016-10-17 16:20:53 +10:00
drm_internal.h drm: drm_irq.h header cleanup 2016-11-15 23:33:48 +01:00
drm_ioc32.c
drm_ioctl.c
drm_irq.c drm/irq: Unexport drm_vblank_on/off 2016-11-15 23:33:48 +01:00
drm_kms_helper_common.c
drm_legacy.h
drm_lock.c drm: Avoid NULL dereference for DRM_LEGACY debug message 2016-11-28 08:39:41 +01:00
drm_memory.c
drm_mipi_dsi.c
drm_mm.c drm: Initialise drm_mm.head_node.allocated 2016-12-01 10:35:45 +01:00
drm_mode_config.c drm/fence: add out-fences support 2016-11-16 14:36:27 +01:00
drm_mode_object.c
drm_modes.c Revert "drm: Add aspect ratio parsing in DRM layer" 2016-11-15 15:01:42 +01:00
drm_modeset_helper.c drm: also move DSI panels to the front of the connector list 2016-11-17 11:59:26 +01:00
drm_modeset_lock.c drm/doc: Fix indenting in drm_modeset_lock.c comment 2016-11-29 23:34:36 +01:00
drm_of.c drm: convert DT component matching to component_match_add_release() 2016-10-25 11:52:38 -04:00
drm_panel.c
drm_pci.c
drm_plane.c drm: Fix locking cargo-cult in encoder/plane init/cleanup 2016-11-29 23:34:36 +01:00
drm_plane_helper.c drm: add helpers to go from plane state to drm_rect 2016-11-08 16:38:03 -05:00
drm_platform.c
drm_prime.c
drm_print.c drm/print: Move kerneldoc next to definition 2016-11-15 12:55:24 +01:00
drm_probe_helper.c
drm_property.c drm: Use u64_to_user_ptr() helper for blob ioctls 2016-11-28 08:12:18 +01:00
drm_rect.c drm: helper macros to print composite types 2016-11-08 16:38:03 -05:00
drm_scatter.c
drm_simple_kms_helper.c
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vm.c
drm_vma_manager.c
Kconfig drm/fence: add in-fences support 2016-11-16 09:55:27 +01:00
Makefile drm: Extract drm_mode_config.[hc] 2016-11-15 15:23:29 +01:00