freebsd-dev/sys/compat
Bjoern A. Zeeb e9715b1c44 LinuxKPI: fix pci_alloc_irq_vectors() for MSI
pci_alloc_irq_vectors() is given a min and max vector value.
pci_enable_msi() will always succeed independent of these arguments as
it does not know about them.  Further it will only ever allocate
1 "vector" not supporting any other amount.
So upfront check that (a) the available pci_msi_count() can satisfy the
requested minv and (b) given the pci_enable_msi() hard coded limit check
that minv is not larger than 1.
If we cannot satisfy either requirement return an error.

This fixes problems with drivers which check that the returned value
of allocated "vectors" will match their requests and only otherwise try
to fall back to ask for 1 or deal otherwise.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	hselasky (earlier version)
Differential Revision: https://reviews.freebsd.org/D37522
2023-01-13 00:39:24 +00:00
..
freebsd32 ptrace(2): add PT_SC_REMOTE remote syscall request 2022-12-22 23:11:35 +02:00
ia32 Retire sv_transtrap 2022-05-20 14:54:03 +03:00
lindebugfs LinuxKPI,lindebugfs: add u8 base type and blob support 2022-11-28 17:21:50 +00:00
linprocfs linprocfs: Add net/route. 2022-10-22 13:52:58 +03:00
linsysfs linsysfs: plug set-but-not-used vars. 2022-03-31 23:49:26 +03:00
linux linux(4): Fix get_robust_list() syscall return value. 2022-11-09 00:17:17 +03:00
linuxkpi LinuxKPI: fix pci_alloc_irq_vectors() for MSI 2023-01-13 00:39:24 +00:00
x86bios pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t. 2022-09-22 15:08:52 -07:00