Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Feb 2021 22:12:26 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 955b6109bb36 - main - uart: only use MSI on devices that advertise 1 MSI vector
Message-ID:  <202102172212.11HMCQqq086018@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=955b6109bb36036e9357006be42dfa89cd7cb0f2

commit 955b6109bb36036e9357006be42dfa89cd7cb0f2
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-02-17 22:08:19 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-02-17 22:08:19 +0000

    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
---
 sys/dev/uart/uart_bus_pci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c
index 0ed3d7f4f974..fbd1d68b88ca 100644
--- a/sys/dev/uart/uart_bus_pci.c
+++ b/sys/dev/uart/uart_bus_pci.c
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102172212.11HMCQqq086018>