uart: only use MSI on devices that advertise 1 MSI vector

This updates r311987/fb1d9b7f4113d which allowed any number of vectors to be
used. Since we're just attaching one instance, the meaning of more than one
vector is not clear and seems to cause problems. Fall back to old methods for
these cards.

PR: 235016
Submitted by: David Cross
This commit is contained in:
Warner Losh 2021-02-17 15:08:19 -07:00
parent 9a995fe186
commit 955b6109bb

View File

@ -227,10 +227,10 @@ uart_pci_attach(device_t dev)
sc = device_get_softc(dev);
/*
* Use MSI in preference to legacy IRQ if available.
* Whilst some PCIe UARTs support >1 MSI vector, use only the first.
* Use MSI in preference to legacy IRQ if available. However, experience
* suggests this is only reliable when one MSI vector is advertised.
*/
if (pci_msi_count(dev) > 0) {
if (pci_msi_count(dev) == 1) {
count = 1;
if (pci_alloc_msi(dev, &count) == 0) {
sc->sc_irid = 1;