From owner-dev-commits-src-all@freebsd.org Thu Sep 30 20:35:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBFE16B7C0B; Thu, 30 Sep 2021 20:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HL4kQ5rsxz4pt8; Thu, 30 Sep 2021 20:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B5BB1226E; Thu, 30 Sep 2021 20:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UKZQn2074593; Thu, 30 Sep 2021 20:35:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UKZQiC074592; Thu, 30 Sep 2021 20:35:26 GMT (envelope-from git) Date: Thu, 30 Sep 2021 20:35:26 GMT Message-Id: <202109302035.18UKZQiC074592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: bf40080762e9 - main - uart: Allow PCI quirk for not using MSI interrupts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf40080762e939b44d4dd0fbfac5127f2a2562ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 20:35:26 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bf40080762e939b44d4dd0fbfac5127f2a2562ce commit bf40080762e939b44d4dd0fbfac5127f2a2562ce Author: Warner Losh AuthorDate: 2021-09-30 20:15:32 +0000 Commit: Warner Losh CommitDate: 2021-09-30 20:15:32 +0000 uart: Allow PCI quirk for not using MSI interrupts Some setups claim to have one MSI, but they don't actually work. Allow these to be flagged. Sponsored by: Netflix Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D32229 --- sys/dev/uart/uart_bus_pci.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c index 92046261f544..4090af0ea9a0 100644 --- a/sys/dev/uart/uart_bus_pci.c +++ b/sys/dev/uart/uart_bus_pci.c @@ -75,6 +75,9 @@ struct pci_id { int regshft; }; +#define PCI_NO_MSI 0x40000000 +#define PCI_RID_MASK 0x0000ffff + static const struct pci_id pci_ns8250_ids[] = { { 0x1028, 0x0008, 0xffff, 0, "Dell Remote Access Card III", 0x14, 128 * DEFAULT_RCLK }, @@ -171,7 +174,8 @@ static const struct pci_id pci_ns8250_ids[] = { { 0x8086, 0x8cbd, 0xffff, 0, "Intel Wildcat Point KT Controller", 0x10 }, { 0x8086, 0x9c3d, 0xffff, 0, "Intel Lynx Point-LP HECI KT", 0x10 }, { 0x8086, 0xa13d, 0xffff, 0, - "100 Series/C230 Series Chipset Family KT Redirection", 0x10 }, + "100 Series/C230 Series Chipset Family KT Redirection", + 0x10 | PCI_NO_MSI }, { 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, @@ -227,7 +231,8 @@ uart_pci_probe(device_t dev) return (ENXIO); match: - result = uart_bus_probe(dev, id->regshft, 0, id->rclk, id->rid, 0, 0); + result = uart_bus_probe(dev, id->regshft, 0, id->rclk, + id->rid & PCI_RID_MASK, 0, 0); /* Bail out on error. */ if (result > 0) return (result); @@ -241,6 +246,7 @@ static int uart_pci_attach(device_t dev) { struct uart_softc *sc; + const struct pci_id *id; int count; sc = device_get_softc(dev); @@ -249,7 +255,9 @@ uart_pci_attach(device_t dev) * 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) == 1) { + id = uart_pci_match(dev, pci_ns8250_ids); + if ((id == NULL || (id->rid & PCI_NO_MSI) == 0) && + pci_msi_count(dev) == 1) { count = 1; if (pci_alloc_msi(dev, &count) == 0) { sc->sc_irid = 1;