From nobody Mon Aug 21 00:36:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RTYSH1s3sz4qwjR; Mon, 21 Aug 2023 00:36:15 +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 4RTYSH1Dr2z4f1T; Mon, 21 Aug 2023 00:36:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692578175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q0QWCKH8SPoljj+96EuSKl7R/SZNfCKlBf7DSnUJ3sA=; b=sAgIE90jjDccP/BgEWndW7TfNXa5Ew47I1lSYcaXsL8JFceh1N10nhZaRWjdUZxo8Fcipi YhZdzYafVGHEc+S7ajGsiM48iva8yAGCrhXKZj5WayLlFRudc1bd+OQ0LsRQW6nKYjPiZM ARneWvtxfffEBGEhHgj4ltwBoKz76YyazJLk18Of2woPjWnGicol6aEPn3uAWsHj3+yksS /iFsL8tw3MNVFjcrFCDZiiB7Resp3BJaRJv/qv/vzl3DUj6XpWF6RG+wga5mde3uJzLhkN 9qoHZ3w8foNGWN9LAvdEExiCv9SriX61yYIp+Q4api5ErnHrC/iDBliuMOfaqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692578175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q0QWCKH8SPoljj+96EuSKl7R/SZNfCKlBf7DSnUJ3sA=; b=uABsn5uPX8P6n+LAxDB6PAoX/FEOo6E68WqMxYnqXca1FF2ungx9i2kZiE2swGBgdqjWG1 JNopVv4Lva/biam6KaVebTmUyAxxYzh4+qPoGy7WbQWdTnmEnB4gIdPbARSohalBo5trvK HFQt5gbhtcsJubUzNJXLDKTkUdES4LNU2w2W3XG5TriR7qCUKveUrAPoLx7taUOoXArwKv Wagg4v6wcZRybMukKvaGFmtWJSgcqlAsgj1UsY0zzFCZ7R7fIBklWc86CA9tvnl46gIPtl jSJ6MGEG5D8ypltX85Li7f4J/BMJiUOc7u25gPFtLCxFtqQzdPe2MFdMCO6gEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692578175; a=rsa-sha256; cv=none; b=Njs+MqAIuEQXzeCiGsAKgF1yZbnanpgtGoiovH5aS2/bftOFBVyCsf1xcmwAxTBgXYMkQd AIG+s9qvIe/I3SwBWpcZAJML2Pj/EfftxmKdxJlerHBVaSyd69Lk3erOCc31BiEjwqtnAE xrpf4MotjXOoJuyKShNRF8cHcf1KHnjHrOjED5PnNpdnpEIjT/BEVGmAmx/ixLtWHwKH4j MQVWX1T0PkWX5lQ16L5NWwIP+ZcNisMBNK401S61j96ze64wNTMEQmiqFXbsHWvO5L9FFY n2HsLknxGjSld3iDEFTKmt8dPwUPDt9nvSYpFyEwv4PYSIbP13j+ueG31SoQ8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RTYSH0JCRz10x5; Mon, 21 Aug 2023 00:36:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37L0aEg7038833; Mon, 21 Aug 2023 00:36:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37L0aEss038830; Mon, 21 Aug 2023 00:36:14 GMT (envelope-from git) Date: Mon, 21 Aug 2023 00:36:14 GMT Message-Id: <202308210036.37L0aEss038830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 9a92ce22df7c - stable/13 - pci: return 0 for pci_remap_intr_method MSI-X non-error case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9a92ce22df7c746331da63b169db14a817d9abad Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9a92ce22df7c746331da63b169db14a817d9abad commit 9a92ce22df7c746331da63b169db14a817d9abad Author: Ed Maste AuthorDate: 2023-08-14 20:35:34 +0000 Commit: Ed Maste CommitDate: 2023-08-21 00:35:45 +0000 pci: return 0 for pci_remap_intr_method MSI-X non-error case When remapping a MSI-X vector, we would always return ENOENT, even if successful. This didn't really matter, as the sole caller of BUS_REMAP_INTR also didn't check for errors. Return 0 if there's no error, so that we can start handling (or at least warning about) actual failures. Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41449 (cherry picked from commit 43e545e8e016d22346a4fe278ea2570328b20cc1) --- sys/dev/pci/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 065b7080f206..15bb76377f40 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -2466,6 +2466,8 @@ pci_remap_intr_method(device_t bus, device_t dev, u_int irq) * through all the slots that use this IRQ and update them. */ if (cfg->msix.msix_alloc > 0) { + bool found = false; + for (i = 0; i < cfg->msix.msix_alloc; i++) { mv = &cfg->msix.msix_vectors[i]; if (mv->mv_irq == irq) { @@ -2485,9 +2487,10 @@ pci_remap_intr_method(device_t bus, device_t dev, u_int irq) pci_enable_msix(dev, j, addr, data); pci_unmask_msix(dev, j); } + found = true; } } - return (ENOENT); + return (found ? 0 : ENOENT); } return (ENOENT);