--- zzzz-none-000/linux-5.4.213/drivers/pci/msi.c 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/drivers/pci/msi.c 2024-08-14 09:02:08.000000000 +0000 @@ -1116,14 +1116,17 @@ if (WARN_ON_ONCE(dev->msi_enabled)) return -EINVAL; - nvec = pci_msi_vec_count(dev); - if (nvec < 0) - return nvec; - if (nvec < minvec) - return -ENOSPC; - - if (nvec > maxvec) + if (maxvec > 32 && maxvec <= 128) { nvec = maxvec; + } else { + nvec = pci_msi_vec_count(dev); + if (nvec < 0) + return nvec; + if (nvec < minvec) + return -ENOSPC; + if (nvec > maxvec) + nvec = maxvec; + } for (;;) { if (affd) {