Daniel Vetter
0ba128fa68
Revert "drm: add a locked version of drm_is_current_master"
...
commit f54b3ca7ea1e5e02f481cf4ca54568e57bd66086 upstream.
This reverts commit 1815d9c86e3090477fbde066ff314a7e9721ee0f.
Unfortunately this inverts the locking hierarchy, so back to the
drawing board. Full lockdep splat below:
======================================================
WARNING: possible circular locking dependency detected
5.13.0-rc7-CI-CI_DRM_10254+ #1 Not tainted
------------------------------------------------------
kms_frontbuffer/1087 is trying to acquire lock:
ffff88810dcd01a8 (&dev->master_mutex){+.+.}-{3:3}, at: drm_is_current_master+0x1b/0x40
but task is already holding lock:
ffff88810dcd0488 (&dev->mode_config.mutex){+.+.}-{3:3}, at: drm_mode_getconnector+0x1c6/0x4a0
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (&dev->mode_config.mutex){+.+.}-{3:3}:
__mutex_lock+0xab/0x970
drm_client_modeset_probe+0x22e/0xca0
__drm_fb_helper_initial_config_and_unlock+0x42/0x540
intel_fbdev_initial_config+0xf/0x20 [i915]
async_run_entry_fn+0x28/0x130
process_one_work+0x26d/0x5c0
worker_thread+0x37/0x380
kthread+0x144/0x170
ret_from_fork+0x1f/0x30
-> #1 (&client->modeset_mutex){+.+.}-{3:3}:
__mutex_lock+0xab/0x970
drm_client_modeset_commit_locked+0x1c/0x180
drm_client_modeset_commit+0x1c/0x40
__drm_fb_helper_restore_fbdev_mode_unlocked+0x88/0xb0
drm_fb_helper_set_par+0x34/0x40
intel_fbdev_set_par+0x11/0x40 [i915]
fbcon_init+0x270/0x4f0
visual_init+0xc6/0x130
do_bind_con_driver+0x1e5/0x2d0
do_take_over_console+0x10e/0x180
do_fbcon_takeover+0x53/0xb0
register_framebuffer+0x22d/0x310
__drm_fb_helper_initial_config_and_unlock+0x36c/0x540
intel_fbdev_initial_config+0xf/0x20 [i915]
async_run_entry_fn+0x28/0x130
process_one_work+0x26d/0x5c0
worker_thread+0x37/0x380
kthread+0x144/0x170
ret_from_fork+0x1f/0x30
-> #0 (&dev->master_mutex){+.+.}-{3:3}:
__lock_acquire+0x151e/0x2590
lock_acquire+0xd1/0x3d0
__mutex_lock+0xab/0x970
drm_is_current_master+0x1b/0x40
drm_mode_getconnector+0x37e/0x4a0
drm_ioctl_kernel+0xa8/0xf0
drm_ioctl+0x1e8/0x390
__x64_sys_ioctl+0x6a/0xa0
do_syscall_64+0x39/0xb0
entry_SYSCALL_64_after_hwframe+0x44/0xae
other info that might help us debug this:
Chain exists of: &dev->master_mutex --> &client->modeset_mutex --> &dev->mode_config.mutex
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&dev->mode_config.mutex);
lock(&client->modeset_mutex);
lock(&dev->mode_config.mutex);
lock(&dev->master_mutex);
2021-06-30 08:47:30 -04:00
..
2021-06-30 08:47:16 -04:00
2020-06-10 09:02:03 +02:00
2021-05-11 14:47:26 +02:00
2020-09-23 09:52:24 +10:00
2020-12-30 11:52:56 +01:00
2021-05-11 14:47:22 +02:00
2020-07-02 20:25:51 +02:00
2020-08-11 11:58:31 +10:00
2021-05-14 09:50:01 +02:00
2021-03-30 14:31:55 +02:00
2020-11-23 10:01:32 +09:00
2020-09-08 14:41:40 +10:00
2021-03-04 11:37:36 +01:00
2021-03-07 12:34:11 +01:00
2020-08-06 14:27:31 -07:00
2020-09-11 10:54:17 +02:00
2021-06-10 13:39:19 +02:00
2021-04-16 11:43:20 +02:00
2020-10-12 20:26:14 +02:00
2021-03-04 11:37:49 +01:00
2021-06-16 12:01:44 +02:00
2021-03-04 11:37:46 +01:00
2021-06-03 09:00:36 +02:00
2020-08-27 11:17:52 +02:00
2021-06-16 12:01:44 +02:00
2020-12-30 11:53:53 +01:00
2021-06-30 08:47:16 -04:00
2020-12-30 11:53:13 +01:00
2021-05-14 09:50:22 +02:00
2021-05-14 09:50:01 +02:00
2020-07-23 10:06:22 +02:00
2021-05-14 09:50:05 +02:00
2020-04-03 17:11:41 +02:00
2021-06-30 08:47:16 -04:00
2021-03-04 11:37:38 +01:00
2021-03-04 11:38:28 +01:00
2020-08-23 17:36:59 -05:00
2021-03-04 11:38:27 +01:00
2020-09-01 13:02:33 +05:30
2020-06-10 09:05:18 +02:00
2020-09-08 14:41:40 +10:00
2021-05-14 09:50:22 +02:00
2021-06-23 14:42:49 +02:00
2021-06-18 10:00:04 +02:00
2020-08-21 15:17:05 +03:00
2021-05-14 09:50:21 +02:00
2021-03-17 17:06:19 +01:00
2020-10-21 06:59:07 +10:00
2020-12-30 11:52:56 +01:00
2021-03-17 17:06:19 +01:00
2020-10-26 11:43:31 +01:00
2020-09-14 09:12:24 +02:00
2021-06-30 08:47:17 -04:00
2020-09-11 10:47:19 +02:00
2020-08-23 17:36:59 -05:00
2021-03-07 12:34:04 +01:00
2021-05-11 14:47:26 +02:00
2020-10-17 11:18:18 -07:00
2021-04-21 13:00:52 +02:00
2021-05-14 09:50:26 +02:00
2020-08-06 14:27:31 -07:00
2021-01-27 11:54:55 +01:00
2020-07-02 20:25:51 +02:00
2020-07-02 15:26:00 +02:00
2020-07-02 15:26:00 +02:00
2021-06-30 08:47:30 -04:00
2020-05-14 02:10:52 +03:00
2020-08-26 19:11:41 +02:00
2020-06-23 19:53:27 +02:00
2020-08-23 17:36:59 -05:00
2020-09-10 08:17:48 +02:00
2020-05-27 14:31:42 +03:00
2020-05-26 13:31:01 +02:00
2020-08-17 13:41:50 -04:00
2020-09-01 13:38:34 +03:00
2020-07-13 13:29:20 -04:00
2020-07-02 15:26:00 +02:00
2020-08-25 11:00:02 +02:00
2020-09-01 09:45:44 +02:00
2020-06-25 15:47:14 -07:00
2020-04-03 17:11:41 +02:00
2020-12-30 11:54:19 +01:00
2020-10-27 11:20:36 +01:00
2021-05-14 09:50:01 +02:00
2020-09-21 10:45:08 +02:00
2020-12-30 11:54:29 +01:00
2020-06-19 09:20:21 +02:00
2020-04-21 08:15:03 +02:00
2021-03-04 11:37:36 +01:00
2020-07-02 15:26:00 +02:00
2020-05-26 13:33:08 +02:00
2020-06-19 13:33:40 +01:00
2020-09-09 11:45:18 +02:00
2020-09-10 08:17:48 +02:00
2020-05-19 22:31:31 +01:00
2021-03-17 17:06:19 +01:00
2020-09-08 10:43:30 +02:00
2020-11-20 05:20:48 +10:00
2020-10-28 12:27:41 +01:00
2020-05-05 14:01:53 -04:00
2020-09-21 10:45:08 +02:00
2021-03-17 17:06:18 +01:00
2021-06-16 12:01:39 +02:00
2020-05-29 12:58:11 +02:00
2020-07-02 15:26:00 +02:00
2020-07-02 15:26:00 +02:00
2020-09-21 10:45:08 +02:00
2020-08-11 11:58:31 +10:00
2020-07-10 20:21:45 +02:00
2020-06-23 15:46:40 +02:00
2020-07-02 15:26:00 +02:00
2020-08-17 13:41:50 -04:00
2021-03-04 11:38:27 +01:00
2020-08-11 11:58:31 +10:00
2021-05-11 14:47:22 +02:00
2020-08-16 17:12:18 +02:00
2020-07-02 15:26:00 +02:00
2020-08-25 11:00:02 +02:00
2020-10-27 11:21:04 +01:00
2021-05-14 09:50:23 +02:00
2020-06-02 10:59:11 -07:00
2021-01-27 11:54:55 +01:00
2020-06-03 10:24:23 +02:00
2020-08-06 11:55:43 -07:00
2020-09-14 22:37:31 +03:00
2020-06-24 15:45:51 +10:00
2020-05-20 20:03:45 +02:00
2021-03-30 14:31:51 +02:00
2020-09-09 16:39:48 +02:00