revert bab65e48cb064 PCI/MSI Sanitize MSI-X checks
From: David Laight
Date: Thu Apr 06 2023 - 07:05:37 EST
The change in bab65e48cb064 breaks pci_enable_msix_range().
The intent is to optimise the sanity checks, but it is
somewhat overenthusiastic.
The interface allows you to ask for a lot of vectors and
returns the number that were allocated.
However, after the change, you can't request a vector
that is higher than the largest the hardware supports.
Which makes that rather pointless.
So code like:
for (i = 0; i < 16; i++)
msix_tbl[i].entry = i;
nvec = pci_enable_msix_range(dev, msix_tbl, 1, 16);
Now returns -22 if the hardware only supports 8 interrupts.
Previously it returned 8.
I can fix my driver, but I suspect that any code that relies
on a smaller number of vectors being returned is now broken.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)