git: c562c81e315c - main - uart/pci: always disable MSI for generic devices

From: Roger Pau Monné <royger_at_FreeBSD.org>
Date: Fri, 27 Mar 2026 08:33:38 UTC
The branch main has been updated by royger:

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

commit c562c81e315cd25bd35d5ece14ef9a3cb569cab5
Author:     Roger Pau Monné <royger@FreeBSD.org>
AuthorDate: 2026-03-26 19:59:24 +0000
Commit:     Roger Pau Monné <royger@FreeBSD.org>
CommitDate: 2026-03-27 08:26:32 +0000

    uart/pci: always disable MSI for generic devices
    
    The generic device pci_id structure in uart_pci_probe() already has
    PCI_NO_MSI appended to it's flags, however that information is not
    propagated into uart_pci_attach().
    
    Assume that any device that doesn't match the known IDs is a generic UART
    device, and hence prevent the usage of MSIs.
    
    MFC: 2 weeks
    Reviewed by: imp
    Differential revision: https://reviews.freebsd.org/D56097
---
 sys/dev/uart/uart_bus_pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c
index 7087958cbfa9..b0d285e3c603 100644
--- a/sys/dev/uart/uart_bus_pci.c
+++ b/sys/dev/uart/uart_bus_pci.c
@@ -339,7 +339,8 @@ uart_pci_attach(device_t dev)
 	 * suggests this is only reliable when one MSI vector is advertised.
 	 */
 	id = uart_pci_match(dev, pci_ns8250_ids);
-	if ((id == NULL || (id->rid & PCI_NO_MSI) == 0) &&
+	/* Always disable MSI for generic devices. */
+	if (id != NULL && (id->rid & PCI_NO_MSI) == 0 &&
 	    pci_msi_count(dev) == 1) {
 		count = 1;
 		if (pci_alloc_msi(dev, &count) == 0) {