freebsd-dev/sys/compat
Vladimir Kondratyev 89889ab470 LinuxKPI: Allow wake_up to be executed within a critical section
by replaceing of spin_lock() call with spin_lock_irqsave()

This fixes following panic in drm-kmod:

panic: mi_switch: switch in a critical section
cpuid = 2
time = 1636939794
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b
vpanic() at vpanic+0x187
panic() at panic+0x43
mi_switch() at mi_switch+0x198
__mtx_lock_sleep() at __mtx_lock_sleep+0x1c9
__mtx_lock_flags() at __mtx_lock_flags+0xa2
linux_wake_up() at linux_wake_up+0x38
__active_retire() at __active_retire+0xb7
dma_fence_signal() at dma_fence_signal+0x100
dma_resv_add_shared_fence() at dma_resv_add_shared_fence+0x96
i915_gem_do_execbuffer() at i915_gem_do_execbuffer+0x11d0
i915_gem_execbuffer2_ioctl() at i915_gem_execbuffer2_ioctl+0x19a
drm_ioctl_kernel() at drm_ioctl_kernel+0x72
drm_ioctl() at drm_ioctl+0x2c4
linux_file_ioctl() at linux_file_ioctl+0x297
kern_ioctl() at kern_ioctl+0x1dc
sys_ioctl() at sys_ioctl+0x124
amd64_syscall() at amd64_syscall+0x124
fast_syscall_common() at fast_syscall_common+0xf8
--- syscall (54, FreeBSD ELF64, sys_ioctl)

MFC after:	1 week
Reviewed by:	manu
Reported by:	Graham Perrin <grahamperrin_AT_gmail_DOT_com>
PR:		261166
Differential Revision:	https://reviews.freebsd.org/D33888
2022-01-18 23:14:13 +03:00
..
freebsd32 freebsd32: Fix layout of struct shmid_kernel32. 2022-01-18 10:42:21 -08:00
ia32 exec: Remove the stack gap implementation 2022-01-17 16:11:54 -05:00
lindebugfs Add emulation support for the Linux kcov(4) ioctl API. 2020-09-04 00:12:28 +00:00
linprocfs linux: add sysctl to pass untranslated interface names 2022-01-17 09:35:15 +00:00
linsysfs linsysfs: create /sys/bus/ and /sys/subsystem/ 2021-03-11 15:50:51 +00:00
linux linux: add sysctl to pass untranslated interface names 2022-01-17 09:35:15 +00:00
linuxkpi/common LinuxKPI: Allow wake_up to be executed within a critical section 2022-01-18 23:14:13 +03:00
x86bios Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00