linux/drivers/gpu/drm/vc4
Hans Verkuil 24bb206f32 drm/vc4/vc4_bo.c: always set bo->resv
The bo->resv pointer could be NULL, leading to kernel oopses
like the one below.

This patch ensures that bo->resv is always set in vc4_create_object
ensuring that it is never NULL.

Thanks to Eric Anholt for pointing to the correct solution.

[   19.738487] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[   19.746805] pgd = ffff8000275fc000
[   19.750319] [00000000] *pgd=0000000000000000
[   19.754715] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[   19.760369] Modules linked in: smsc95xx usbnet vc4 drm_kms_helper drm pwm_bcm2835 i2c_bcm2835 bcm2835_rng rng_core bcm2835_dma virt_dma
[   19.772767] CPU: 0 PID: 1297 Comm: Xorg Not tainted 4.12.0-rc1-rpi3 #58
[   19.779476] Hardware name: Raspberry Pi 3 Model B (DT)
[   19.784688] task: ffff800028268000 task.stack: ffff800026c08000
[   19.790705] PC is at ww_mutex_lock_interruptible+0x14/0xc0
[   19.796329] LR is at vc4_submit_cl_ioctl+0x4fc/0x998 [vc4]
...
[   20.240855] [<ffff0000088975f4>] ww_mutex_lock_interruptible+0x14/0xc0
[   20.247528] [<ffff0000009b3ea4>] vc4_submit_cl_ioctl+0x4fc/0x998 [vc4]
[   20.254372] [<ffff0000008f75f8>] drm_ioctl+0x180/0x438 [drm]
[   20.260120] [<ffff00000821383c>] do_vfs_ioctl+0xa4/0x7d0
[   20.265510] [<ffff000008213fe4>] SyS_ioctl+0x7c/0x98
[   20.270550] [<ffff000008082f30>] el0_svc_naked+0x24/0x28
[   20.275941] Code: d2800002 d5384103 910003fd f9800011 (c85ffc04)
[   20.282527] ---[ end trace 1f6bd640ff32ae12 ]---

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/14e68768-6c92-2d74-92fd-196dbc50d8f7@xs4all.nl
2017-06-12 16:48:03 -07:00
..
Kconfig drm/vc4: Switch DSI to the panel-bridge layer, and support bridges. 2017-06-05 15:07:37 +05:30
Makefile drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_bo.c drm/vc4/vc4_bo.c: always set bo->resv 2017-06-12 16:48:03 -07:00
vc4_crtc.c drm/vc4: use drm_for_each_connector_iter() 2017-05-26 02:12:44 -03:00
vc4_debugfs.c drm/vc4: Add DSI driver 2017-02-01 12:51:23 -08:00
vc4_dpi.c drm/vc4: Switch DPI to using the panel-bridge helper. 2017-06-05 15:21:26 +05:30
vc4_drv.c drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_drv.h drm/vc4: Fix comment in vc4_drv.h 2017-05-31 10:50:54 -07:00
vc4_dsi.c drm/vc4: Switch DSI to the panel-bridge layer, and support bridges. 2017-06-05 15:07:37 +05:30
vc4_fence.c drm/vc4: Expose dma-buf fences for V3D rendering. 2017-04-13 11:00:28 -07:00
vc4_gem.c drm: drop drm_[cm]alloc* helpers 2017-05-18 17:22:39 +02:00
vc4_hdmi.c drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_hvs.c drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_irq.c drm/vc4: Allow using more than 256MB of CMA memory. 2017-04-18 14:32:20 -07:00
vc4_kms.c drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_packet.h drm/vc4: Add support for drawing 3D frames. 2015-12-07 20:05:10 -08:00
vc4_plane.c drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_qpu_defines.h drm/vc4: Fix definition of QPU_R_MS_REV_FLAGS 2016-07-15 15:19:52 -07:00
vc4_regs.h drm/vc4: Add HDMI audio support 2017-03-16 10:33:30 -07:00
vc4_render_cl.c drm/vc4: Allow using more than 256MB of CMA memory. 2017-04-18 14:32:20 -07:00
vc4_trace_points.c drm/vc4: Add support for drawing 3D frames. 2015-12-07 20:05:10 -08:00
vc4_trace.h drm/vc4: Add support for drawing 3D frames. 2015-12-07 20:05:10 -08:00
vc4_v3d.c drm/vc4: Mark the device as active when enabling runtime PM. 2017-06-02 13:00:47 -07:00
vc4_validate_shaders.c drm/vc4: Extend and edit documentation for output from the RST 2017-02-28 12:51:49 -08:00
vc4_validate.c drm/vc4: fix spelling mistake: "dimesions" -> "dimensions" 2017-05-16 09:42:20 -07:00
vc4_vec.c drm/vc4: Extend and edit documentation for output from the RST 2017-02-28 12:51:49 -08:00