From nobody Mon Aug 14 22:05:49 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 4RPpPT4qFqz4mR5v; Mon, 14 Aug 2023 22:05:49 +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 4RPpPT4K2Rz4Yd7; Mon, 14 Aug 2023 22:05:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692050749; 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=zcZ+ZfebUN6LEK+qOyrDV+SEaupHma6j7ffwOuIyy8s=; b=SKGXTcbn8BUNb4mQbZTR0oNS/fjRrvokUYrT6hLwzPkxLnHZwat/3FWIBVU/aH2tKemcBL QAubo0/3/mnlgcL1l0BXtxQMPbz0xCmolI/m8S27cN0sf30sNtT/NPjxs/WE9RirJCYDZI H6A6TH4wphv9qWfG7i0aiUQVmivObpJoVxqXrkF9Ep5Nh8kifS4IVZYAfu0pG8JzmN/cC+ LZzqCeCiTJx+Ac7GGgQzR3CBKYfwYoUKWFMn6IGsXBTD3d7ifBERbFIp+D0sU9D8xhjCUa yZ3Mmef2yVlRb0h/n8vnfI37KzZ8sNu+Q+pA4r7u7orAkM2iQNDAj02hPWDQqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692050749; 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=zcZ+ZfebUN6LEK+qOyrDV+SEaupHma6j7ffwOuIyy8s=; b=RK9eu3u5oyAWKPru3cPfgctEHHipNKgt5d6e7zVvNt1kNOjVo8c5/v2mS7H3cEDbmfsyI4 CMnCCAC9mUy1taBq6J0ovVg8QVggrEjcr3nYDvMw87+DEOTtj4easnIY1RUNXCHCYuQpjb 5RVslywu+5ENYbHWaWHovJXI8IsFAi7x+98jiuxMIuXtvnB61ayH0lH/Vwy7Ij+BWDlXIv lOJwSJjHtoXXswU+5NfOQhvzfG5lCj9+YgdecXu4AKxd1PKZHUzBqx7OlIH0QPZyr7UiLm ualAWIZfaMoLgLUGNd2aWLLI0qiB+CT8gKz7C6xhvvks3N+T2NWwJzjNX+nzqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692050749; a=rsa-sha256; cv=none; b=SQxorgQQeQBe8QpT6rSaDBr8KCqls8gUpP32ab6Oyo2vjyuNPd9m70XO4LwQ6UdREr5odx bJTcPgxG979Zf3Wf6VQBfoDOU6/TFtO6u6P71JV2r6dszrv65cIjLczCOVeoOasmbqnf85 9KvSG6wA/Atj9afsF8X+qkLPt8+BIshR0FexmxRwjn0wCoDFgn3bAzEl5jJ3a8JWJ47YXX C9CE9lBtJR+QjqpLKMIqwH5yWSfVDkc3bIZMXjBVmKc/BNhFGYhPC9tHrPtpMpm0m/uH4r K6INuTfHWOz86cZAWn6H7WJsqwzdBda4IizYAB9XDaF90lfZbU5U1eQgoFVBHA== 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 4RPpPT3GXgzlYT; Mon, 14 Aug 2023 22:05:49 +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 37EM5ntE076987; Mon, 14 Aug 2023 22:05:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37EM5nnk076984; Mon, 14 Aug 2023 22:05:49 GMT (envelope-from git) Date: Mon, 14 Aug 2023 22:05:49 GMT Message-Id: <202308142205.37EM5nnk076984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 43e545e8e016 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 43e545e8e016d22346a4fe278ea2570328b20cc1 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=43e545e8e016d22346a4fe278ea2570328b20cc1 commit 43e545e8e016d22346a4fe278ea2570328b20cc1 Author: Ed Maste AuthorDate: 2023-08-14 20:35:34 +0000 Commit: Ed Maste CommitDate: 2023-08-14 21:56:15 +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 --- 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 cbdfb3acec70..9118ca7781e1 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -2447,6 +2447,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) { @@ -2466,9 +2468,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);