linux/drivers/gpu/drm
Matthew Brost 12a9917e9e drm/i915/guc: Fix recursive lock in GuC submission
Use __release_guc_id (lock held) rather than release_guc_id (acquires
lock), add lockdep annotations.

213.280129] i915: Running i915_perf_live_selftests/live_noa_gpr
[ 213.283459] ============================================
[ 213.283462] WARNING: possible recursive locking detected
{{[ 213.283466] 5.15.0-rc6+ #18 Tainted: G U W }}
[ 213.283470] --------------------------------------------
[ 213.283472] kworker/u24:0/8 is trying to acquire lock:
[ 213.283475] ffff8ffc4f6cc1e8 (&guc->submission_state.lock){....}-{2:2}, at: destroyed_worker_func+0x2df/0x350 [i915]
{{[ 213.283618] }}
{{ but task is already holding lock:}}
[ 213.283621] ffff8ffc4f6cc1e8 (&guc->submission_state.lock){....}-{2:2}, at: destroyed_worker_func+0x4f/0x350 [i915]
{{[ 213.283720] }}
{{ other info that might help us debug this:}}
[ 213.283724] Possible unsafe locking scenario:[ 213.283727] CPU0
[ 213.283728] ----
[ 213.283730] lock(&guc->submission_state.lock);
[ 213.283734] lock(&guc->submission_state.lock);
{{[ 213.283737] }}
{{ *** DEADLOCK ***}}[ 213.283740] May be due to missing lock nesting notation[ 213.283744] 3 locks held by kworker/u24:0/8:
[ 213.283747] #0: ffff8ffb80059d38 ((wq_completion)events_unbound){..}-{0:0}, at: process_one_work+0x1f3/0x550
[ 213.283757] #1: ffffb509000e3e78 ((work_completion)(&guc->submission_state.destroyed_worker)){..}-{0:0}, at: process_one_work+0x1f3/0x550
[ 213.283766] #2: ffff8ffc4f6cc1e8 (&guc->submission_state.lock){....}-{2:2}, at: destroyed_worker_func+0x4f/0x350 [i915]
{{[ 213.283860] }}
{{ stack backtrace:}}
[ 213.283863] CPU: 8 PID: 8 Comm: kworker/u24:0 Tainted: G U W 5.15.0-rc6+ #18
[ 213.283868] Hardware name: ASUS System Product Name/PRIME B560M-A AC, BIOS 0403 01/26/2021
[ 213.283873] Workqueue: events_unbound destroyed_worker_func [i915]
[ 213.283957] Call Trace:
[ 213.283960] dump_stack_lvl+0x57/0x72
[ 213.283966] __lock_acquire.cold+0x191/0x2d3
[ 213.283972] lock_acquire+0xb5/0x2b0
[ 213.283978] ? destroyed_worker_func+0x2df/0x350 [i915]
[ 213.284059] ? destroyed_worker_func+0x2d7/0x350 [i915]
[ 213.284139] ? lock_release+0xb9/0x280
[ 213.284143] _raw_spin_lock_irqsave+0x48/0x60
[ 213.284148] ? destroyed_worker_func+0x2df/0x350 [i915]
[ 213.284226] destroyed_worker_func+0x2df/0x350 [i915]
[ 213.284310] process_one_work+0x270/0x550
[ 213.284315] worker_thread+0x52/0x3b0
[ 213.284319] ? process_one_work+0x550/0x550
[ 213.284322] kthread+0x135/0x160
[ 213.284326] ? set_kthread_struct+0x40/0x40
[ 213.284331] ret_from_fork+0x1f/0x30

and a bit later in the trace:

{{ 227.499864] do_raw_spin_lock+0x94/0xa0}}
[ 227.499868] _raw_spin_lock_irqsave+0x50/0x60
[ 227.499871] ? guc_flush_destroyed_contexts+0x4f/0xf0 [i915]
[ 227.499995] guc_flush_destroyed_contexts+0x4f/0xf0 [i915]
[ 227.500104] intel_guc_submission_reset_prepare+0x99/0x4b0 [i915]
[ 227.500209] ? mark_held_locks+0x49/0x70
[ 227.500212] intel_uc_reset_prepare+0x46/0x50 [i915]
[ 227.500320] reset_prepare+0x78/0x90 [i915]
[ 227.500412] __intel_gt_set_wedged.part.0+0x13/0xe0 [i915]
[ 227.500485] intel_gt_set_wedged.part.0+0x54/0x100 [i915]
[ 227.500556] intel_gt_set_wedged_on_fini+0x1a/0x30 [i915]
[ 227.500622] intel_gt_driver_unregister+0x1e/0x60 [i915]
[ 227.500694] i915_driver_remove+0x4a/0xf0 [i915]
[ 227.500767] i915_pci_probe+0x84/0x170 [i915]
[ 227.500838] local_pci_probe+0x42/0x80
[ 227.500842] pci_device_probe+0xd9/0x190
[ 227.500844] really_probe+0x1f2/0x3f0
[ 227.500847] __driver_probe_device+0xfe/0x180
[ 227.500848] driver_probe_device+0x1e/0x90
[ 227.500850] __driver_attach+0xc4/0x1d0
[ 227.500851] ? __device_attach_driver+0xe0/0xe0
[ 227.500853] ? __device_attach_driver+0xe0/0xe0
[ 227.500854] bus_for_each_dev+0x64/0x90
[ 227.500856] bus_add_driver+0x12e/0x1f0
[ 227.500857] driver_register+0x8f/0xe0
[ 227.500859] i915_init+0x1d/0x8f [i915]
[ 227.500934] ? 0xffffffffc144a000
[ 227.500936] do_one_initcall+0x58/0x2d0
[ 227.500938] ? rcu_read_lock_sched_held+0x3f/0x80
[ 227.500940] ? kmem_cache_alloc_trace+0x238/0x2d0
[ 227.500944] do_init_module+0x5c/0x270
[ 227.500946] __do_sys_finit_module+0x95/0xe0
[ 227.500949] do_syscall_64+0x38/0x90
[ 227.500951] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 227.500953] RIP: 0033:0x7ffa59d2ae0d
[ 227.500954] Code: c8 0c 00 0f 05 eb a9 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 3b 80 0c 00 f7 d8 64 89 01 48
[ 227.500955] RSP: 002b:00007fff320bbf48 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 227.500956] RAX: ffffffffffffffda RBX: 00000000022ea710 RCX: 00007ffa59d2ae0d
[ 227.500957] RDX: 0000000000000000 RSI: 00000000022e1d90 RDI: 0000000000000004
[ 227.500958] RBP: 0000000000000020 R08: 00007ffa59df3a60 R09: 0000000000000070
[ 227.500958] R10: 00000000022e1d90 R11: 0000000000000246 R12: 00000000022e1d90
[ 227.500959] R13: 00000000022e58e0 R14: 0000000000000043 R15: 00000000022e42c0

v2:
 (CI build)
  - Fix build error

Fixes: 1a52faed31 ("drm/i915/guc: Take GT PM ref when deregistering context")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211020192147.8048-1-matthew.brost@intel.com
2021-10-22 14:54:59 -07:00
..
amd drm-misc-next for v5.16: 2021-10-11 12:39:15 +10:00
arm drm/arm: malidp: Use fourcc_mod_is_vendor() helper 2021-08-16 12:18:46 +02:00
armada
aspeed
ast drm/ast: Use managed interfaces for framebuffer write combining 2021-09-23 09:26:09 +02:00
atmel-hlcdc drm/atmel-hlcdc: Convert to Linux IRQ interfaces 2021-08-10 20:00:58 +02:00
bridge drm/bridge: dw-hdmi-cec: Make use of the helper function devm_add_action_or_reset() 2021-10-06 11:21:46 +02:00
etnaviv drm-misc-next for $kernel-version: 2021-09-22 15:30:40 +10:00
exynos drm/exynos: Always initialize mapping in exynos_drm_register_dma() 2021-08-22 01:56:39 +09:00
fsl-dcu drm/fsl-dcu: Convert to Linux IRQ interfaces 2021-08-10 20:13:25 +02:00
gma500 Revert "drm/gma500: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" 2021-10-04 09:34:55 -04:00
gud drm/gud: Add GUD_PIXEL_FORMAT_RGB888 2021-10-04 12:06:14 +02:00
hisilicon drm-misc-next for v5.15: 2021-07-30 14:52:00 +10:00
hyperv drm/hyperv: Use offset-adjusted shadow-plane mappings 2021-08-08 20:27:27 +02:00
i2c
i810 drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
i915 drm/i915/guc: Fix recursive lock in GuC submission 2021-10-22 14:54:59 -07:00
imx drm for v5.15-rc1 2021-09-01 11:26:46 -07:00
ingenic drm/ingenic: Use standard drm_atomic_helper_commit_tail 2021-08-11 15:49:15 +02:00
kmb drm for v5.15-rc1 2021-09-01 11:26:46 -07:00
lib
lima drm/lima: use scheduler dependency tracking 2021-08-30 10:58:20 +02:00
mcde drm/mcde: Make use of the helper function devm_platform_ioremap_resource() 2021-09-07 22:50:17 +02:00
mediatek drm for v5.15-rc1 2021-09-01 11:26:46 -07:00
meson Merge drm/drm-next into drm-misc-next 2021-09-14 09:25:30 +02:00
mga drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
mgag200 drm/mgag200: Use managed interfaces for framebuffer write combining 2021-09-23 09:26:09 +02:00
msm Revert "drm/msm: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN()" 2021-10-04 09:34:57 -04:00
mxsfb drm/mxsfb: Convert to Linux IRQ interfaces 2021-08-10 20:13:45 +02:00
nouveau Revert "drm/nouveau: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" 2021-10-04 09:34:56 -04:00
omapdrm drm/omap: Depend on CONFIG_OF 2021-10-07 05:42:16 +03:00
panel drm/panel: support for BOE and INX video mode panel 2021-09-28 09:31:33 -07:00
panfrost drm/panfrost: simplify getting .driver_data 2021-09-20 14:34:37 +01:00
pl111 drm/pl111: Remove unused including <linux/version.h> 2021-07-31 20:52:01 +02:00
qxl drm/qxl: User page size macro for qxl release bo 2021-09-15 08:21:32 +02:00
r128 drm/r128: switch from 'pci_' to 'dma_' API 2021-08-23 14:29:02 -04:00
radeon drm-misc-next for v5.16: 2021-10-11 12:39:15 +10:00
rcar-du drm: rcar-du: Add r8a779a0 device support 2021-10-07 05:59:54 +03:00
rockchip drm-misc-next for 5.15: 2021-09-24 13:49:08 +10:00
savage
scheduler drm/sched: fix the bug of time out calculation(v4) 2021-09-15 10:21:30 -04:00
selftests drm: Fix oops in damage self-tests by mocking damage property 2021-08-02 11:15:11 +02:00
shmobile drm/shmobile: Make use of the helper function devm_platform_ioremap_resource() 2021-10-07 05:42:18 +03:00
sis
sti drm/sti: Use correct printk format specifiers for size_t 2021-10-07 05:42:17 +03:00
stm drm/stm: ltdc: add layer alpha support 2021-09-09 14:58:27 +02:00
sun4i drm/sun4i: dw-hdmi: Make use of the helper function dev_err_probe() 2021-09-16 15:47:20 +02:00
tdfx
tegra Revert "drm/tegra: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" 2021-10-04 09:34:56 -04:00
tidss drm/tidss: Convert to Linux IRQ interfaces 2021-08-10 20:13:49 +02:00
tilcdc drm/tilcdc: Convert to Linux IRQ interfaces 2021-08-10 20:13:53 +02:00
tiny drm/bochs: add Bochs PCI ID for Simics model 2021-09-15 08:21:32 +02:00
ttm Merge tag 'drm-intel-gt-next-2021-10-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2021-10-11 18:09:39 +10:00
tve200
udl drm/shmem-helper: Switch to vmf_insert_pfn 2021-08-12 21:41:10 +02:00
v3d drm/v3d: add multiple syncobjs support 2021-10-04 10:08:46 +01:00
vboxvideo drm/vboxvideo: Use managed interfaces for framebuffer write combining 2021-09-23 09:26:09 +02:00
vc4 drm-misc-next for v5.16: 2021-10-11 12:39:15 +10:00
vgem drm/vgem: use shmem helpers 2021-08-12 21:41:10 +02:00
via drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
virtio drm/virtio: implement context init: advertise feature to userspace 2021-09-29 09:22:31 +02:00
vkms drm/vkms: Use offset-adjusted shadow-plane mappings and output 2021-08-08 20:27:52 +02:00
vmwgfx Revert "drm/vmwgfx: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" 2021-10-04 09:34:56 -04:00
xen
xlnx drm/xlnx/zynqmp_disp: Fix incorrectly named enum 'zynqmp_disp_layer_id' 2021-08-09 02:28:05 +03:00
drm_agpsupport.c
drm_aperture.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_atomic_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_atomic_state_helper.c
drm_atomic_uapi.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_atomic.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_auth.c drm: add lockdep assert to drm_is_current_master_locked 2021-08-05 12:08:15 +02:00
drm_blend.c
drm_bridge_connector.c
drm_bridge.c drm/bridge: Document the probe issue with MIPI-DSI bridges 2021-09-24 19:25:23 +02:00
drm_bufs.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_cache.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_client_modeset.c Revert "drm: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN()" 2021-10-04 09:34:57 -04:00
drm_client.c
drm_color_mgmt.c
drm_connector.c drm: Fix scaling_mode docs 2021-09-22 22:11:53 +03:00
drm_context.c
drm_crtc_helper_internal.h
drm_crtc_helper.c Revert "drm: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" 2021-10-04 09:34:57 -04:00
drm_crtc_internal.h drm/connector: Add drm_connector_find_by_fwnode() function (v3) 2021-08-20 12:35:59 +02:00
drm_crtc.c
drm_damage_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_debugfs_crc.c
drm_debugfs.c drm: avoid blocking in drm_clients_info's rcu section 2021-07-20 20:14:42 +02:00
drm_displayid.c
drm_dma.c
drm_dp_aux_bus.c Bus: Make remove callback return void tag 2021-08-11 08:47:08 +10:00
drm_dp_aux_dev.c
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm/dp: add helper for extracting adjust 128b/132b TX FFE preset 2021-09-20 18:45:35 +03:00
drm_dp_mst_topology_internal.h
drm_dp_mst_topology.c drm/dp_mst: Fix return code on sideband message failure 2021-07-27 18:58:28 -04:00
drm_drv.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_dsc.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_dumb_buffers.c
drm_edid_load.c
drm_edid.c Cross-subsystem Changes: 2021-10-11 16:53:57 +10:00
drm_encoder_slave.c
drm_encoder.c
drm_fb_cma_helper.c
drm_fb_helper.c Revert "drm: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" 2021-10-04 09:34:57 -04:00
drm_file.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_flip_work.c
drm_format_helper.c drm/format-helper: Add drm_fb_xrgb8888_to_rgb888() 2021-10-04 12:04:19 +02:00
drm_fourcc.c drm/fourcc: Add R8 to drm_format_info 2021-10-04 12:03:09 +02:00
drm_framebuffer.c Revert "drm: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" 2021-10-04 09:34:57 -04:00
drm_gem_atomic_helper.c drm/gem: Provide offset-adjusted framebuffer BO mappings 2021-08-08 20:26:16 +02:00
drm_gem_cma_helper.c
drm_gem_framebuffer_helper.c drm/gem: Provide offset-adjusted framebuffer BO mappings 2021-08-08 20:26:16 +02:00
drm_gem_shmem_helper.c drm/shmem-helpers: Allocate wc pages on x86 2021-08-12 21:41:10 +02:00
drm_gem_ttm_helper.c
drm_gem_vram_helper.c drm/ttm: remove ttm_tt_destroy_common v2 2021-08-23 13:54:55 +02:00
drm_gem.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_hashtab.c
drm_hdcp.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_internal.h
drm_ioc32.c drm: Copy drm_wait_vblank to user before returning 2021-08-17 13:56:03 -04:00
drm_ioctl.c GPU: drm: fix style errors 2021-08-28 19:00:20 +02:00
drm_irq.c drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
drm_kms_helper_common.c drm: Remove unused code to load the non-existing fbcon.ko 2021-08-18 14:33:47 +02:00
drm_lease.c drm/lease: allow empty leases 2021-10-01 15:55:47 +02:00
drm_legacy_misc.c drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
drm_legacy.h
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c drm/mipi-dbi: Use framebuffer dma-buf helpers 2021-07-23 20:17:59 +02:00
drm_mipi_dsi.c drm/mipi-dsi: Create devm device attachment 2021-09-24 19:25:33 +02:00
drm_mm.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_mode_config.c
drm_mode_object.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_modes.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_modeset_helper.c
drm_modeset_lock.c Revert "drm: cleanup: remove drm_modeset_(un)lock_all()" 2021-10-04 09:34:55 -04:00
drm_of.c drm/bridge: Add a function to abstract away panels 2021-09-14 10:39:01 +02:00
drm_panel_orientation_quirks.c drm/panel-orientation-quirks: add Valve Steam Deck 2021-09-12 15:10:12 +02:00
drm_panel.c
drm_pci.c
drm_plane_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_plane.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_prime.c RDMA v5.15 merge window Pull Request 2021-09-02 14:47:21 -07:00
drm_print.c isystem: ship and use stdarg.h 2021-08-19 09:02:55 +09:00
drm_probe_helper.c drm/probe-helper: Create a HPD IRQ event helper for a single connector 2021-09-28 12:29:13 +02:00
drm_property.c drm: property: Replace strncpy() with strscpy_pad() 2021-10-07 05:42:13 +03:00
drm_rect.c
drm_scatter.c
drm_scdc_helper.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_self_refresh_helper.c
drm_simple_kms_helper.c drm/simple-kms: Support custom CRTC state 2021-08-08 20:14:08 +02:00
drm_syncobj.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_sysfs.c drm/connector: Add a fwnode pointer to drm_connector and register with ACPI (v2) 2021-08-20 12:35:59 +02:00
drm_trace_points.c
drm_trace.h
drm_vblank_work.c
drm_vblank.c drm: IRQ midlayer is now legacy 2021-08-10 20:14:01 +02:00
drm_vm.c
drm_vma_manager.c drm: Fix typo in comments 2021-08-02 10:19:43 +02:00
drm_writeback.c
Kconfig drm: fb_helper: fix CONFIG_FB dependency 2021-10-01 09:40:16 +02:00
Makefile drm: zte: remove obsolete DRM Support for ZTE SoCs 2021-08-26 11:19:08 +02:00