Skip to content
Snippets Groups Projects
Commit a2588211 authored by José Roberto de Souza's avatar José Roberto de Souza
Browse files

iris: Retry DRM_IOCTL_XE_EXEC for some error types

Xe KMD is frequently returning -EPERM with the message below in dmesg
and this this error code causes iris to abort() the application.

A Xe KMD bug was filed drm/xe/kernel#239


but until it here we are giving Xe KMD 3 tries to execute when it
returns -EPERM.
Also doing the same for -ENOMEM becase we have this handling in i915
were user reported Iris was aborting when system is under memory
pressure.

------------[ cut here ]------------
WARNING: CPU: 2 PID: 1913 at drivers/gpu/drm/xe/xe_vm.c:504 xe_vm_unlock_dma_resv+0x43/0x50 [xe]
Modules linked in: xe drm_ttm_helper gpu_sched drm_suballoc_helper i2c_algo_bit drm_buddy ttm drm_display_helper drm_kms_helper syscopyarea sysfillrect sysimgblt x86_pkg_temp_thermal coretemp crct10dif_pclmul mei_hdcp mei_pxp crc32_pclmul pmt_telemetry pmt_class ghash_clmulni_intel snd_hda_intel snd_intel_dspcfg snd_hda_codec kvm_intel snd_hwdep wmi_bmof snd_hda_core e1000e ptp mei_me i2c_i801 snd_pcm pps_core mei i2c_smbus intel_vsec video wmi fuse
CPU: 2 PID: 1913 Comm: gnome-shell Not tainted 6.3.0-rc4+zeh-xe+ #934
Hardware name: Intel Corporation Raptor Lake Client Platform/RaptorLake-P LP5 RVP, BIOS RPLPFWI1.R00.4081.A00.2302200847 02/20/2023
RIP: 0010:xe_vm_unlock_dma_resv+0x43/0x50 [xe]
Code: 05 20 05 00 00 48 39 c2 75 20 e8 28 02 ea ff 48 85 db 74 05 48 39 eb 75 07 5b 5d c3 cc cc cc cc 48 89 df 5b 5d e9 3d 8e f8 e0 <0f> 0b eb dc 66 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc9000256b9f0 EFLAGS: 00010202
RAX: ffff88811360d520 RBX: ffffc9000256bb08 RCX: ffffc9000256baa8
RDX: ffff888116a52790 RSI: ffffc9000256ba40 RDI: ffffc9000256baa8
RBP: ffffc9000256bb08 R08: ffffc9000256ba40 R09: 00000000cf730756
R10: 000000006cf73075 R11: 0000000000000000 R12: ffffc9000256be50
R13: 0000000000000000 R14: ffff8882811f0200 R15: ffff88811360d150
FS:  00007fc711af05c0(0000) GS:ffff8882a6300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fe601877000 CR3: 0000000119b94003 CR4: 0000000000770ee0
PKRU: 55555554
Call Trace:
 <TASK>
 xe_exec_ioctl+0x54d/0x9f0 [xe]
 ? __is_insn_slot_addr+0x8e/0x120
 ? kernel_text_address+0x75/0xf0
 ? find_held_lock+0x2b/0x80
 ? __lock_acquire+0x5c6/0x28b0
 ? __lock_acquire+0x5c6/0x28b0
 ? lock_acquire+0xd1/0x2d0
 ? find_held_lock+0x2b/0x80
 ? __pfx_xe_exec_ioctl+0x10/0x10 [xe]
 drm_ioctl_kernel+0xc0/0x170
 drm_ioctl+0x20c/0x460
 ? __pfx_xe_exec_ioctl+0x10/0x10 [xe]
 __x64_sys_ioctl+0x8a/0xb0
 do_syscall_64+0x37/0x90
 entry_SYSCALL_64_after_hwframe+0x72/0xdc
RIP: 0033:0x7fc715d1aaff
Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 77 1f 48 8b 44 24 18 64 48 2b 04 25 28 00
RSP: 002b:00007ffc6be5b560 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000563bd0f673d0 RCX: 00007fc715d1aaff
RDX: 00007ffc6be5b680 RSI: 0000000040386448 RDI: 000000000000000d
RBP: 00007ffc6be5b5f0 R08: 0000563bd0e48010 R09: 0000563bd2f07290
R10: 0000000000000007 R11: 0000000000000246 R12: 0000563bd10c4180
R13: 0000000000200012 R14: 0000563bd0f4d160 R15: 0000563bd0f59e50
 </TASK>
irq event stamp: 3639569
hardirqs last  enabled at (3639575): [<ffffffff811da469>] __up_console_sem+0x59/0x80
hardirqs last disabled at (3639580): [<ffffffff811da44e>] __up_console_sem+0x3e/0x80
softirqs last  enabled at (3632280b): [<ffffffff8114abae>] irq_exit_rcu+0xbe/0x130
softirqs last disabled at (3632237): [<ffffffff8114abae>] irq_exit_rcu+0xbe/0x130
---[ end trace 0000000000000000 ]---

Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
parent 3cb17370
No related branches found
No related tags found
No related merge requests found
...@@ -259,8 +259,12 @@ xe_batch_submit(struct iris_batch *batch) ...@@ -259,8 +259,12 @@ xe_batch_submit(struct iris_batch *batch)
.syncs = (uintptr_t)syncs, .syncs = (uintptr_t)syncs,
.num_syncs = sync_len, .num_syncs = sync_len,
}; };
if (!batch->screen->devinfo->no_hw) if (!batch->screen->devinfo->no_hw) {
ret = intel_ioctl(iris_bufmgr_get_fd(bufmgr), DRM_IOCTL_XE_EXEC, &exec); uint8_t tries = 3;
do {
ret = intel_ioctl(iris_bufmgr_get_fd(bufmgr), DRM_IOCTL_XE_EXEC, &exec);
} while (ret && tries-- && (ret == -ENOMEM || ret == -EPERM));
}
simple_mtx_unlock(bo_deps_lock); simple_mtx_unlock(bo_deps_lock);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment