From owner-dev-commits-src-branches@freebsd.org Mon Mar 1 19:00:29 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 2238A5483B3; Mon, 1 Mar 2021 19:00:29 +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 4Dq8j804xDz3NXS; Mon, 1 Mar 2021 19:00:27 +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 CACE995F; Mon, 1 Mar 2021 19:00:27 +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 121J0Rq2030811; Mon, 1 Mar 2021 19:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 121J0RnC030810; Mon, 1 Mar 2021 19:00:27 GMT (envelope-from git) Date: Mon, 1 Mar 2021 19:00:27 GMT Message-Id: <202103011900.121J0RnC030810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: eb62c494bfa0 - releng/13.0 - uart: only use MSI on devices that advertise 1 MSI vector 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: eb62c494bfa0771581dae96f6ae6bdcf4d3f21b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:00:29 -0000 The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=eb62c494bfa0771581dae96f6ae6bdcf4d3f21b9 commit eb62c494bfa0771581dae96f6ae6bdcf4d3f21b9 Author: Warner Losh AuthorDate: 2021-02-17 22:08:19 +0000 Commit: Warner Losh CommitDate: 2021-03-01 18:59:30 +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 Approved by: re@ (gjb) (cherry picked from commit 955b6109bb36036e9357006be42dfa89cd7cb0f2) (cherry picked from commit ef1f2056084202c554d5482af9586a8995e604d5) --- 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;