linux_dsm_epyc7002/drivers/gpu/drm/msm
Stephen Boyd 2c043eeffe drm/msm/disp/dpu: Use proper define for drm_encoder_init() 'encoder_type'
We got a bug report that this function oopses when trying to do a kasprintf().

PC is at string+0x2c/0x60
LR is at vsnprintf+0x28c/0x4ec
pc : [<ffffff80088d35d8>] lr : [<ffffff80088d5fc4>] pstate: a0c00049
sp : ffffff80095fb540
x29: ffffff80095fb540 x28: ffffff8008ad42bc
x27: 00000000ffffffd8 x26: 0000000000000000
x25: ffffff8008c216c8 x24: 0000000000000000
x23: 0000000000000000 x22: ffffff80095fb720
x21: 0000000000000000 x20: ffffff80095fb720
x19: ffffff80095fb6f0 x18: 000000000000000a
x17: 00000000b42ba473 x16: ffffff800805bbe8
x15: 00000000000a157d x14: 000000000000000c
x13: 0000000000000000 x12: 0000ffff0000000f
x11: 0000000000000003 x10: 0000000000000001
x9 : 0000000000000040 x8 : 000000000000001c
x7 : ffffffffffffffff x6 : 0000000000000000
x5 : 0000000000000228 x4 : 0000000000000000
x3 : ffff0a00ffffff04 x2 : 0000000000007961
x1 : 0000000000000000 x0 : 0000000000000000
Process kworker/3:1 (pid: 61, stack limit = 0xffffff80095f8000)
Call trace:
Exception stack(0xffffff80095fb400 to 0xffffff80095fb540)
b400: 0000000000000000 0000000000000000 0000000000007961 ffff0a00ffffff04
b420: 0000000000000000 0000000000000228 0000000000000000 ffffffffffffffff
b440: 000000000000001c 0000000000000040 0000000000000001 0000000000000003
b460: 0000ffff0000000f 0000000000000000 000000000000000c 00000000000a157d
b480: ffffff800805bbe8 00000000b42ba473 000000000000000a ffffff80095fb6f0
b4a0: ffffff80095fb720 0000000000000000 ffffff80095fb720 0000000000000000
b4c0: 0000000000000000 ffffff8008c216c8 0000000000000000 00000000ffffffd8
b4e0: ffffff8008ad42bc ffffff80095fb540 ffffff80088d5fc4 ffffff80095fb540
b500: ffffff80088d35d8 00000000a0c00049 ffffff80095fb550 ffffff80080d06a4
b520: ffffffffffffffff ffffff80088d5e0c ffffff80095fb540 ffffff80088d35d8
[<ffffff80088d35d8>] string+0x2c/0x60
[<ffffff80088d5fc4>] vsnprintf+0x28c/0x4ec
[<ffffff80083973b8>] kvasprintf+0x68/0x100
[<ffffff800839755c>] kasprintf+0x60/0x80
[<ffffff800849cc24>] drm_encoder_init+0x134/0x164
[<ffffff80084d9a7c>] dpu_encoder_init+0x60/0x94
[<ffffff80084eced0>] _dpu_kms_drm_obj_init+0xa0/0x424
[<ffffff80084ed870>] dpu_kms_hw_init+0x61c/0x6bc
[<ffffff80084f7614>] msm_drm_bind+0x380/0x67c
[<ffffff80085114e4>] try_to_bring_up_master+0x228/0x264
[<ffffff80085116e8>] component_master_add_with_match+0x90/0xc0
[<ffffff80084f722c>] msm_pdev_probe+0x260/0x2c8
[<ffffff800851a910>] platform_drv_probe+0x58/0xa8
[<ffffff80085185c8>] driver_probe_device+0x2d8/0x40c
[<ffffff8008518928>] __device_attach_driver+0xd4/0x10c
[<ffffff800851644c>] bus_for_each_drv+0xb4/0xd0
[<ffffff8008518230>] __device_attach+0xd0/0x160
[<ffffff8008518984>] device_initial_probe+0x24/0x30
[<ffffff800851744c>] bus_probe_device+0x38/0x98
[<ffffff8008517aac>] deferred_probe_work_func+0x144/0x148
[<ffffff80080c8654>] process_one_work+0x218/0x3bc
[<ffffff80080c883c>] process_scheduled_works+0x44/0x48
[<ffffff80080c95bc>] worker_thread+0x288/0x32c
[<ffffff80080cea30>] kthread+0x134/0x13c
[<ffffff8008084750>] ret_from_fork+0x10/0x18
Code: 910003fd 2a0403e6 eb0400ff 54000060 (38646845)

Looking at the code I see that drm_encoder_init() is called from the DPU
code with 'DRM_MODE_CONNECTOR_DSI' passed in as the 'encoder_type'
argument (follow from _dpu_kms_initialize_dsi()). That corresponds to
the integer 16. That is then indexed into drm_encoder_enum_list in
drm_encoder_init() to look up the name of the encoder. If you're still
following along, that's an encoder not a connector! We really want to
use DRM_MODE_ENCODER_DSI (integer 6) instead of DRM_MODE_CONNECTOR_DSI
here, or we'll go out of bounds of the encoder array. Pass the right
thing and everything is fine.

Cc: Jeykumar Sankaran <jsanka@codeaurora.org>
Cc: Jordan Crouse <jcrouse@codeaurora.org>
Cc: Sean Paul <seanpaul@chromium.org>
Fixes: 25fdd5933e (drm/msm: Add SDM845 DPU support)
Tested-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>

Signed-off-by: Rob Clark <robdclark@gmail.com>
2018-10-03 20:24:50 -04:00
..
adreno drm/msm: a6xx: fix spelling mistake: "initalization" -> "initialization" 2018-08-10 18:49:18 -04:00
disp drm/msm/disp/dpu: Use proper define for drm_encoder_init() 'encoder_type' 2018-10-03 20:24:50 -04:00
dsi drm/msm: Don't fail bind if nothing connected to dsi 2018-10-03 20:24:50 -04:00
edp drm/msm: update generated headers 2018-08-10 18:49:18 -04:00
hdmi drm/msm: update generated headers 2018-08-10 18:49:18 -04:00
Kconfig drm/msm/gpu: Capture the GPU state on a GPU hang 2018-07-30 08:49:56 -04:00
Makefile drm/msm: Add A6XX device support 2018-08-10 18:49:18 -04:00
msm_atomic.c drm: extract drm_atomic_uapi.c 2018-09-09 14:19:18 +02:00
msm_debugfs.c drm/msm/gpu: Capture the GPU state on a GPU hang 2018-07-30 08:49:56 -04:00
msm_debugfs.h drm/msm: Remove msm_debugfs_cleanup() 2017-03-08 11:24:45 +01:00
msm_drv.c drm/msm: Add a helper function to parse clock names 2018-08-10 18:49:18 -04:00
msm_drv.h drm/msm: Add a helper function to parse clock names 2018-08-10 18:49:18 -04:00
msm_fb.c drm/msm: Add modifier to mdp_get_format arguments 2018-06-03 16:48:59 -04:00
msm_fbdev.c drm/msm: don't deref error pointer in the msm_fbdev_create error path 2018-06-03 16:49:00 -04:00
msm_fence.c drm/msm: Remove unecessary dma_fence_ops 2018-08-17 11:22:25 +02:00
msm_fence.h drm/msm: strip out msm_fence_cb 2018-03-19 06:33:35 -04:00
msm_gem_prime.c drm/msm: Expose our reservation object when exporting a dmabuf. 2017-05-27 13:48:26 -04:00
msm_gem_shrinker.c drm/msm: Separate locking of buffer resources from struct_mutex 2017-06-17 08:03:07 -04:00
msm_gem_submit.c drm/msm: add sudo flag to submit ioctl 2018-02-20 10:41:20 -05:00
msm_gem_vma.c drm/msm: Pass the correct aperture end to drm_mm_init 2018-02-20 10:41:22 -05:00
msm_gem.c gpu: drm: msm: Change return type to vm_fault_t 2018-08-03 09:53:36 -04:00
msm_gem.h drm/msm: add sudo flag to submit ioctl 2018-02-20 10:41:20 -05:00
msm_gpu.c drm/msm: Add A6XX device support 2018-08-10 18:49:18 -04:00
msm_gpu.h drm/msm: Add a helper function to parse clock names 2018-08-10 18:49:18 -04:00
msm_iommu.c drm/msm: pm runtime support for iommu 2017-04-08 06:59:31 -04:00
msm_kms.h drm/msm: Add SDM845 DPU support 2018-07-26 10:45:04 -04:00
msm_mmu.h drm/msm: let gpu wire up it's own fault handler 2017-02-06 11:28:42 -05:00
msm_perf.c drm/msm: Remove msm_debugfs_cleanup() 2017-03-08 11:24:45 +01:00
msm_rd.c Linux 4.14-rc7 2017-11-02 12:40:41 +10:00
msm_ringbuffer.c drm/msm: Replace gem_object deprecated functions 2018-02-20 10:41:21 -05:00
msm_ringbuffer.h drm/msm: Implement preemption for A5XX targets 2017-10-28 11:01:38 -04:00
msm_submitqueue.c drm/msm: Support multiple ringbuffers 2017-10-28 11:01:36 -04:00
NOTES drm/msm: add mdp5/apq8x74 2014-01-09 14:44:06 -05:00