drm: use drm_global_mutex for ATOMIC ioctls on RT kernel
<2>[ 75.517991][ T323] kernel BUG at kernel/locking/rtmutex.c:1740! <0>[ 76.518134][ T323] Internal error: Oops - BUG: 0 [#1] PREEMPT_RT SMP <4>[ 76.518158][ T323] Modules linked in: <4>[ 76.518168][ T323] CPU: 1 PID: 323 Comm: composer@2.1-se Not tainted 5.10.110-rt53 #183 <4>[ 76.518177][ T323] Hardware name: Rockchip rk3326 evb board (DT) <4>[ 76.518183][ T323] pstate: 80400085 (Nzcv daIf +PAN -UAO -TCO BTYPE=--) <4>[ 76.518191][ T323] pc : rt_mutex_slowlock_locked+0x230/0x26c <4>[ 76.518211][ T323] lr : rt_mutex_slowlock_locked+0xb4/0x26c <4>[ 76.518220][ T323] sp : ffffffc0148c3970 <4>[ 76.518223][ T323] x29: ffffffc0148c3970 x28: 000000000000000c <4>[ 76.518232][ T323] x27: 0000000000000002 x26: 0000000000000001 <4>[ 76.518240][ T323] x25: 0000000000000000 x24: 0000000000000000 <4>[ 76.518247][ T323] x23: 0000000000000000 x22: ffffff8007803480 <4>[ 76.518255][ T323] x21: ffffffc0148c3bb8 x20: ffffffc0148c39c8 <4>[ 76.518264][ T323] x19: ffffff8005cb80a8 x18: 0000000000000000 <4>[ 76.518272][ T323] x17: 000000000000005e x16: 0000000000000010 <4>[ 76.518280][ T323] x15: ffffffc010627e2c x14: ffffffc0113d6f98 <4>[ 76.518288][ T323] x13: 0000000000000000 x12: 0000000000000001 <4>[ 76.518295][ T323] x11: 0000000000000000 x10: 0000000000000234 <4>[ 76.518303][ T323] x9 : 0000000000000233 x8 : ffffffc012ffbbf0 <4>[ 76.518311][ T323] x7 : 0000000000000001 x6 : ffffffc01135522c <4>[ 76.518319][ T323] x5 : 0000000000000000 x4 : 0000000000000001 <4>[ 76.518327][ T323] x3 : 0000000000000000 x2 : 0000000000000000 <4>[ 76.518334][ T323] x1 : ffffffc01135522c x0 : 00000000ffffffdd <4>[ 76.518343][ T323] Call trace: <4>[ 76.518346][ T323] rt_mutex_slowlock_locked+0x230/0x26c <4>[ 76.518355][ T323] ww_mutex_lock_interruptible+0xf0/0x1c8 <4>[ 76.518364][ T323] modeset_lock+0xd8/0x1b4 <4>[ 76.518373][ T323] drm_modeset_lock+0x1c/0x34 <4>[ 76.518379][ T323] drm_atomic_get_crtc_state+0x4c/0xfc <4>[ 76.518386][ T323] drm_atomic_get_plane_state+0x100/0x140 <4>[ 76.518393][ T323] drm_atomic_set_property+0x204/0x7c4 <4>[ 76.518403][ T323] drm_mode_atomic_ioctl+0x4d4/0x86c <4>[ 76.518411][ T323] drm_ioctl+0x248/0x3b0 <4>[ 76.518419][ T323] drm_compat_ioctl+0xd4/0xe8 <4>[ 76.518429][ T323] __arm64_compat_sys_ioctl+0x104/0x158 <4>[ 76.518439][ T323] el0_svc_common+0xc0/0x240 <4>[ 76.518451][ T323] do_el0_svc_compat+0x1c/0x48 <4>[ 76.518460][ T323] el0_svc_compat+0x20/0x30 <4>[ 76.518468][ T323] el0_sync_compat_handler+0x78/0xb4 <4>[ 76.518475][ T323] el0_sync_compat+0x1a8/0x1c0 Signed-off-by: Liang Chen <cl@rock-chips.com> Change-Id: I9731b0f721aa3a708eb3fa23f08f7959cbcf860f
This commit is contained in:
@@ -784,6 +784,16 @@ long drm_ioctl_kernel(struct file *file, drm_ioctl_t *func, void *kdata,
|
||||
if (unlikely(retcode))
|
||||
return retcode;
|
||||
|
||||
#ifdef CONFIG_PREEMPT_RT
|
||||
if (func == drm_mode_atomic_ioctl) {
|
||||
mutex_lock(&drm_global_mutex);
|
||||
retcode = func(dev, kdata, file_priv);
|
||||
mutex_unlock(&drm_global_mutex);
|
||||
|
||||
return retcode;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Enforce sane locking for modern driver ioctls. */
|
||||
if (likely(!drm_core_check_feature(dev, DRIVER_LEGACY)) ||
|
||||
(flags & DRM_UNLOCKED))
|
||||
|
||||
Reference in New Issue
Block a user