get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2216674/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2216674,
    "url": "http://patchwork.ozlabs.org/api/patches/2216674/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260327035422.4020455-2-den@valinux.co.jp/",
    "project": {
        "id": 28,
        "url": "http://patchwork.ozlabs.org/api/projects/28/?format=api",
        "name": "Linux PCI development",
        "link_name": "linux-pci",
        "list_id": "linux-pci.vger.kernel.org",
        "list_email": "linux-pci@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260327035422.4020455-2-den@valinux.co.jp>",
    "list_archive_url": null,
    "date": "2026-03-27T03:54:16",
    "name": "[v12,1/7] PCI: endpoint: Add auxiliary resource query API",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "86f37004a2d936c7c47c0db676abf947e4d54053",
    "submitter": {
        "id": 91573,
        "url": "http://patchwork.ozlabs.org/api/people/91573/?format=api",
        "name": "Koichiro Den",
        "email": "den@valinux.co.jp"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260327035422.4020455-2-den@valinux.co.jp/mbox/",
    "series": [
        {
            "id": 497685,
            "url": "http://patchwork.ozlabs.org/api/series/497685/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=497685",
            "date": "2026-03-27T03:54:17",
            "name": "PCI: endpoint: pci-ep-msi: Add embedded doorbell fallback",
            "version": 12,
            "mbox": "http://patchwork.ozlabs.org/series/497685/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2216674/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216674/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-pci+bounces-51248-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-pci@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=valinux.co.jp header.i=@valinux.co.jp\n header.a=rsa-sha256 header.s=selector1 header.b=FXuxWrTV;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-51248-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=valinux.co.jp header.i=@valinux.co.jp\n header.b=\"FXuxWrTV\"",
            "smtp.subspace.kernel.org;\n arc=fail smtp.client-ip=52.101.229.114",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=valinux.co.jp",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=valinux.co.jp",
            "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=valinux.co.jp;"
        ],
        "Received": [
            "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fhmzy3MN1z1yFp\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 14:57:02 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 0F56230D87DE\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 03:54:39 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 93D1B343D75;\n\tFri, 27 Mar 2026 03:54:38 +0000 (UTC)",
            "from TY3P286CU002.outbound.protection.outlook.com\n (mail-japaneastazon11020114.outbound.protection.outlook.com [52.101.229.114])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 15D87371CE7;\n\tFri, 27 Mar 2026 03:54:34 +0000 (UTC)",
            "from TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:38f::10)\n by TY7P286MB7090.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:323::16) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9745.20; Fri, 27 Mar\n 2026 03:54:25 +0000",
            "from TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM\n ([fe80::2305:327c:28ec:9b32]) by TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM\n ([fe80::2305:327c:28ec:9b32%5]) with mapi id 15.20.9745.019; Fri, 27 Mar 2026\n 03:54:25 +0000"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774583678; cv=fail;\n b=pgLgBP1AqJhn4EuNdNMVLnvppZX0UUxfZMYTvMoajFabRDBcaAJqXW8HWC5ozuxoMcg2FDsssROP8UVyfXteeyM2oVDHkHVLryvO1AJk0GeuXeFt9fZjlOgYFquqmjgHjT8ous/PJtN1KV9PhDM+AvcrAnjHBlzt8qQNaWyhTA0=",
            "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=Wzhpv6MgYAvMw6rdgH/RNzZOc0TnPf7w5BMStBPOsfnf94BzP8fy80dQSvFAX+Qpx3bFmfRW7CR9Fb1Q8pGJCi+/ziT0cXj9bdreZ5Vn3cIevxueQbN39ZmtlZTXEqWKr2ycdEsTJ973PfNupsbIRKg0OaStVowZygQzyxO1e19sbeuCVwJf1vYx4lkd+hrI9+3uchcdirfqv+Qd4ouN3E2WZ0qZs+Ib1Cox0npfgCYZrJWUG9dY5cbvAAtjYql1fi2TOqxjoMOcrsRF5HuvsAr6SPQWUS4AEd6e5CkOywdZ7twABvrwSTEF4WZl/KYSIf+oIyDllPVRwHHcFLm/Ng=="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774583678; c=relaxed/simple;\n\tbh=a/8hsKyEISoPr+dCulGaSqhThqZ0bY0QVVuFPBZ7cmw=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=ggxpE2bmSr+M0KmDAx62cyFbBfwUtoXvGlYD5eozLftgys9cIhvEjGG4XBwcv4xWxlzCkZmom5uE9ExOMeNawqAG2PfXbD7OaqLziLW3b0tg9+fsF8xHV9oOdZ68UywuGJEja/i4MRcKSbIcWxh/18z32n0A/Secyd+sGMHUwf0=",
            "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=XiOF/Jna8t4zNHuJYK2klo1qxQCLAzs25HB7Vjw7h+c=;\n b=gGnHIl4Jz3sNw92EU2cV1saYSoyddZfSFMB2LwX4LE6X9YGhF/wNP6FpHJkaxWOg/wQG1Km7e9YkC4ujTXzRKH3169pO4WH3q25+RaJnsEIktBUjLVpPPy4jxwfrBWeX5hZqJ0sJWy7MQk4VCc4hq+yblXXzYs7YSmP5mgJTJQuLL/MFbc4SBEghpgaPhXxdLY4wav4rMH9CXlCQOyEFIkMbqamUOJwCThvY5KDDukO5uF+YRJlJ1i3Q+vAzAc0it5f8lUoAQbHWu1Y/HA6084nY9HvFhHypqF7jvEpoL98GucVJ1qMjW9iETxDTNRQMJr9a898iak5PT83OxNBZbQ=="
        ],
        "ARC-Authentication-Results": [
            "i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=valinux.co.jp;\n spf=pass smtp.mailfrom=valinux.co.jp;\n dkim=pass (1024-bit key) header.d=valinux.co.jp header.i=@valinux.co.jp\n header.b=FXuxWrTV; arc=fail smtp.client-ip=52.101.229.114",
            "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=valinux.co.jp; dmarc=pass action=none\n header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=XiOF/Jna8t4zNHuJYK2klo1qxQCLAzs25HB7Vjw7h+c=;\n b=FXuxWrTVegeCkQ6ysX31id/eBrCLWcirO70ApMo1vegloBfmAeAgpk7mRqp9QaXhWVsrucAFbkUX7Ri9KlbPxHvvYz6xZbmhqXJMIjJJEQ8I9Qx4t6Nm23R0eEQ2wxm0fj9vI/VbtweD3S+6a/w63zd6sMJm2Rku0QnPOm2Y3zo=",
        "From": "Koichiro Den <den@valinux.co.jp>",
        "To": "Jingoo Han <jingoohan1@gmail.com>,\n Manivannan Sadhasivam <mani@kernel.org>,\n Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84?=\n\t=?utf-8?q?ski?= <kwilczynski@kernel.org>, Rob Herring <robh@kernel.org>,\n Bjorn Helgaas <bhelgaas@google.com>,\n Kishon Vijay Abraham I <kishon@kernel.org>, Jon Mason <jdmason@kudzu.us>,\n Dave Jiang <dave.jiang@intel.com>, Allen Hubbe <allenbh@gmail.com>,\n Niklas Cassel <cassel@kernel.org>, Frank Li <Frank.Li@nxp.com>,\n Bhanu Seshu Kumar Valluri <bhanuseshukumar@gmail.com>,\n Marco Crivellari <marco.crivellari@suse.com>,\n Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,\n Manikanta Maddireddy <mmaddireddy@nvidia.com>",
        "Cc": "linux-pci@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tntb@lists.linux.dev",
        "Subject": "[PATCH v12 1/7] PCI: endpoint: Add auxiliary resource query API",
        "Date": "Fri, 27 Mar 2026 12:54:16 +0900",
        "Message-ID": "<20260327035422.4020455-2-den@valinux.co.jp>",
        "X-Mailer": "git-send-email 2.51.0",
        "In-Reply-To": "<20260327035422.4020455-1-den@valinux.co.jp>",
        "References": "<20260327035422.4020455-1-den@valinux.co.jp>",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-ClientProxiedBy": "TY4P301CA0048.JPNP301.PROD.OUTLOOK.COM\n (2603:1096:405:36b::19) To TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM\n (2603:1096:405:38f::10)",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-pci@vger.kernel.org",
        "List-Id": "<linux-pci.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-pci+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-pci+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "TY7P286MB7722:EE_|TY7P286MB7090:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "c7be07e5-a277-498f-0e69-08de8bb489e8",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "\n\tBCL:0;ARA:13230040|366016|1800799024|10070799003|376014|7416014|921020|18002099003|22082099003|56012099003;",
        "X-Microsoft-Antispam-Message-Info": "\n\tsLVZ1SGp4jDHamTr9Ie/jsyk26jv4/eVmS+0WPA2Bf+Dl8JZNOYVL/nFZ6+Cc5rFmIVa3eujCZxoZQLcKtMvtGvTRxNDhmUhFeTKkuOjOdFCu3K/Gp/6RbFckrHdchS/vbXF9All8QyzewuD/OTT6au6JNnuuEzcJPwKZM/hOEoEx4b+NUzRBrIPlCrfLpNXM0/SNdcAqVNs3EA25rgyWKv2OVkOowQn3EIltvmxNQHZRnEEs8Tore83m9ewGiDqG6Gg3TCOKrcHOYcXB4/0oCP9A9OSPt7e9nDypWB7gy2Ta9l16wAeMj+rX7kToXg+ICXoh80NLaEVJxURh8GsckMWQ6tKMF1SxSDhbgwEAGvhotHdzDSYzWicvcs61NsKNrpY0qQJolzQhPI96uf2rloOmsXVYdHGfbkEps28O9wzJmNThQHi5garnHcQZypSRrYXveSq/KsO92ORk6YmYn5cDabZ7AuaN5vc2SVRioaC8jMZwmkX5mJqAArXCCidrEW/8bkR9XjoOayc4q7QrXo0es62qI1oLeH2zri8nJEdkfUOEePtITCzRDEQc1SbwfrnxllGTxsjKh9/1DPOSmP0dWEAth2oKc7SxKXF4rFEqy8IB2qLKLFZUUtSBaKkXpa+/IXSwVA0FgucD7s0TMg1R6uya9fU2S8qliauLucDvtZHno0ghYgBZZiXBm20TPieVo0KyYyEdjiGz3l1F5Uw8A1QRtLVHp2EmNdzP3Tv3CcwYrEyLFOAYIkPS4GpFmLtLBCAQzriulvvynbzuA==",
        "X-Forefront-Antispam-Report": "\n\tCIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(10070799003)(376014)(7416014)(921020)(18002099003)(22082099003)(56012099003);DIR:OUT;SFP:1102;",
        "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1",
        "X-MS-Exchange-AntiSpam-MessageData-0": "\n y6Zq50sT7JvYaI+g5cpftVZd+IqJ4N6XPQlEv7xSS5a+Ps4caS1nk3+ybyGvUCQndFMOJYAJK0uSYHhANuVdxspzH/+R0U8FrsCBUtEsoqnG/lhwoXuOQVvpe/lgxXNmugxefwC2QJ4TtRtlSXcGwuOgDfFx5jx+3zYCISSMj1QE+hZn/P4OvpUOuiJDJBjhwBuRD1kVVYFpE9aet8vJx+hkOy4IJHMW8yeaW3es9dtO1W7jwc6jv3OQM37vjBDLyuP9kbp6bfEjFLfuFbQ3yqaxN9OZ2hbAO+CZB4npCxViz09WFgiK8TbVDK+bNXgrqimbwWPrJ7XoMt3DTEaDlQGHpXbBjJX2RMDRz/dM7VhUwJ+GVBYGPy6VRgwU8m3EEpcLm2ia0Q9UcRfv9Xx+tf9kMH4K0ZzOtTV33W9p+bZ4RHhmOWjVVcD0GrTKqjjq/wijewDGiff1uGKfFVtoFO/t4KDwI8lPc6CHLaNZ4eugQSO33n2RGUAbaks/6VLssRFcgAnTn7JFVLtDwOpkAJ/U02d4aRxu2PLnUr5l+o3w/ax0576rSg+Gvra/1qtrA/NIzoXn6sBCYLkVNCEe0Yzz1NykGWNThg6MAGg6HOFalO8JSb7uATMcJENId9UFwNvr1Jl7YIKAs7P+XA0qmrE1T3kRMWL1Io07juRRoE6r5WYely4Np0RVRj6qCn5PhX/RhWlXhvdHSXPiecItZDLQ5I/lq7zh/p3ZhtJdLPeKoO8m9Hg9ApXWBOnk4G6NwMSl0BKoeQk0bCSdF5gvPVgIKInLn06FYwyMNbeMtirn6BcTUn4oJYS1nFgj0Z2WhklFKMSp81YtKQOfviX0K09RyNIkw1lsxTPj9TKBSg/UkOXLi8ElibP9GAXHdlbEa9CVKb3bvIQgk9Wl0TeQO0kn5uhsErG7it4K6Ce1NviXoiNjyLNwE7sCJDy5gOICp1Rkv/DmsI+GS2iPBoyIW9EtoWBe+whI5fTMkrKPG1Y68E4cFppJMZExuFN9UsGLMQ0w5srDPr67Z6kfv4KsuiQClq1Mi7wiTwMJOimfJudrCb5XSpZScgzQOJ6cTJokk7SzxMZjuD6neVFTfbFkVrxE3C9BNvhR+TI3WvIRM1MeXXrdrtCE2g+/AuhdInMnfUfOApx0UhkS4eGqGfKeoyK6ZKsnEA4F8ABsi1Qqqi2KJ8MbJvovKOAB6W06MOKFBhKWD2aq/esYWehW5phDfVRm8q/FSsyk/0ZOgdvFPhlpJ+eIcHEvL17g2mDfRP940zC4bllq7vHYWa2rDyLAn6jfIBpJrBftOFUaV9hQhcUqPJNBVldIYeWOSvLIbNd1Rtq83Z9nqiT4TSLvlH4xI4llRpXtm5dnp079CUBtMIZcZSv6CTcm72P9EY8s/J1xkUawqexqi08By7Q14mKhquM4Wmsuq6zDGt0QV/3hAZCXbn7SacjrLIczwkjbIfd44nVt9PIs44LcMQQp0M5zX7clDcesqDajGZg2iFyRGFDB+toXlZE4w1dAFW1RyzsjiLHMHtXAd/QJXFkE3JfMyRz/MobI6adv9C6mNXPoPCNj8os9ULgAcWL33t02YcQXrq4oCdfQUcQ63pgEr712DWViZFOSkBmpdoJVY6+jffdNfoi1QGZ8zMGGS/DeegKMtDrqu8lpoL69SZvg3Jvg4ERPfc8VxXfYIdxAT4137wDc9ldD09EmyDbh8jTjx+W1ZBIvh+cg+ep+yoOxCMJBWLNcWz3gnO+AmnSi/dHnFqhzEMXrG6TFHwIkTsyexfZU",
        "X-OriginatorOrg": "valinux.co.jp",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n c7be07e5-a277-498f-0e69-08de8bb489e8",
        "X-MS-Exchange-CrossTenant-AuthSource": "TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "27 Mar 2026 03:54:25.8145\n (UTC)",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted",
        "X-MS-Exchange-CrossTenant-Id": "7a57bee8-f73d-4c5f-a4f7-d72c91c8c111",
        "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED",
        "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n 3vTrALyTvq3F96jDdHHNJ8KeF2tQD7jRi+9LX/RiKM1yVz280bG4vd96sLgrjhROpDZ//0AfhQiuAPSLlVrD9A==",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "TY7P286MB7090"
    },
    "content": "Endpoint controller drivers may integrate auxiliary blocks (e.g. DMA\nengines) whose register windows and descriptor memories metadata need to\nbe exposed to a remote peer. Endpoint function drivers need a generic\nway to discover such resources without hard-coding controller-specific\nhelpers.\n\nAdd pci_epc_count_aux_resources() / pci_epc_get_aux_resources() and the\ncorresponding pci_epc_ops callbacks. The count helper returns the number\nof available resources via an output parameter, while the get helper\nfills a caller-provided array of resources described by type, physical\naddress and size, plus type-specific metadata.\n\nSuggested-by: Manivannan Sadhasivam <mani@kernel.org>\nSigned-off-by: Koichiro Den <den@valinux.co.jp>\n---\nChanges in v12:\n  - Add pci_epc_count_aux_resources() and pci_epc_ops.count_aux_resources\n  - Use pci_epc_function_is_valid() instead of open-coding\n\n drivers/pci/endpoint/pci-epc-core.c | 83 +++++++++++++++++++++++++++++\n include/linux/pci-epc.h             | 53 ++++++++++++++++++\n 2 files changed, 136 insertions(+)",
    "diff": "diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c\nindex 6c3c58185fc5..fded71a19d71 100644\n--- a/drivers/pci/endpoint/pci-epc-core.c\n+++ b/drivers/pci/endpoint/pci-epc-core.c\n@@ -156,6 +156,89 @@ const struct pci_epc_features *pci_epc_get_features(struct pci_epc *epc,\n }\n EXPORT_SYMBOL_GPL(pci_epc_get_features);\n \n+/**\n+ * pci_epc_count_aux_resources() - count EPC-provided auxiliary resources\n+ * @epc: EPC device\n+ * @func_no: function number\n+ * @vfunc_no: virtual function number\n+ * @num_resources: returned number of auxiliary resources\n+ *\n+ * Some EPC backends integrate auxiliary blocks (e.g. DMA engines) whose control\n+ * registers and/or descriptor memories can be exposed to the host by mapping\n+ * them into BAR space. This helper queries how many such resources the backend\n+ * provides.\n+ *\n+ * Return: 0 on success, -EOPNOTSUPP if the backend does not support auxiliary\n+ * resource queries, or another -errno on failure.\n+ */\n+int pci_epc_count_aux_resources(struct pci_epc *epc, u8 func_no, u8 vfunc_no,\n+\t\t\t\tint *num_resources)\n+{\n+\tint ret;\n+\n+\tif (!num_resources)\n+\t\treturn -EINVAL;\n+\n+\tif (!epc || !epc->ops)\n+\t\treturn -EINVAL;\n+\n+\tif (!pci_epc_function_is_valid(epc, func_no, vfunc_no))\n+\t\treturn -EINVAL;\n+\n+\tif (!epc->ops->count_aux_resources)\n+\t\treturn -EOPNOTSUPP;\n+\n+\tmutex_lock(&epc->lock);\n+\tret = epc->ops->count_aux_resources(epc, func_no, vfunc_no,\n+\t\t\t\t\t    num_resources);\n+\tmutex_unlock(&epc->lock);\n+\n+\treturn ret;\n+}\n+EXPORT_SYMBOL_GPL(pci_epc_count_aux_resources);\n+\n+/**\n+ * pci_epc_get_aux_resources() - query EPC-provided auxiliary resources\n+ * @epc: EPC device\n+ * @func_no: function number\n+ * @vfunc_no: virtual function number\n+ * @resources: output array\n+ * @num_resources: size of @resources array in entries\n+ *\n+ * Some EPC backends integrate auxiliary blocks (e.g. DMA engines) whose control\n+ * registers and/or descriptor memories can be exposed to the host by mapping\n+ * them into BAR space. This helper queries the backend for such resources.\n+ *\n+ * Return: 0 on success, -EOPNOTSUPP if the backend does not support auxiliary\n+ * resource queries, or another -errno on failure.\n+ */\n+int pci_epc_get_aux_resources(struct pci_epc *epc, u8 func_no, u8 vfunc_no,\n+\t\t\t      struct pci_epc_aux_resource *resources,\n+\t\t\t      int num_resources)\n+{\n+\tint ret;\n+\n+\tif (!resources || num_resources <= 0)\n+\t\treturn -EINVAL;\n+\n+\tif (!epc || !epc->ops)\n+\t\treturn -EINVAL;\n+\n+\tif (!pci_epc_function_is_valid(epc, func_no, vfunc_no))\n+\t\treturn -EINVAL;\n+\n+\tif (!epc->ops->get_aux_resources)\n+\t\treturn -EOPNOTSUPP;\n+\n+\tmutex_lock(&epc->lock);\n+\tret = epc->ops->get_aux_resources(epc, func_no, vfunc_no, resources,\n+\t\t\t\t\t  num_resources);\n+\tmutex_unlock(&epc->lock);\n+\n+\treturn ret;\n+}\n+EXPORT_SYMBOL_GPL(pci_epc_get_aux_resources);\n+\n /**\n  * pci_epc_stop() - stop the PCI link\n  * @epc: the link of the EPC device that has to be stopped\ndiff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h\nindex 334c2b7578d0..d8b81fc6ca6a 100644\n--- a/include/linux/pci-epc.h\n+++ b/include/linux/pci-epc.h\n@@ -61,6 +61,47 @@ struct pci_epc_map {\n \tvoid __iomem\t*virt_addr;\n };\n \n+/**\n+ * enum pci_epc_aux_resource_type - auxiliary resource type identifiers\n+ * @PCI_EPC_AUX_DOORBELL_MMIO: Doorbell MMIO, that might be outside the DMA\n+ *                             controller register window\n+ *\n+ * EPC backends may expose auxiliary blocks (e.g. DMA engines) by mapping their\n+ * register windows and descriptor memories into BAR space. This enum\n+ * identifies the type of each exposable resource.\n+ */\n+enum pci_epc_aux_resource_type {\n+\tPCI_EPC_AUX_DOORBELL_MMIO,\n+};\n+\n+/**\n+ * struct pci_epc_aux_resource - a physical auxiliary resource that may be\n+ *                               exposed for peer use\n+ * @type:       resource type, see enum pci_epc_aux_resource_type\n+ * @phys_addr:  physical base address of the resource\n+ * @size:       size of the resource in bytes\n+ * @bar:        BAR number where this resource is already exposed to the RC\n+ *              (NO_BAR if not)\n+ * @bar_offset: offset within @bar where the resource starts (valid iff\n+ *              @bar != NO_BAR)\n+ * @u:          type-specific metadata\n+ */\n+struct pci_epc_aux_resource {\n+\tenum pci_epc_aux_resource_type type;\n+\tphys_addr_t phys_addr;\n+\tresource_size_t size;\n+\tenum pci_barno bar;\n+\tresource_size_t bar_offset;\n+\n+\tunion {\n+\t\t/* PCI_EPC_AUX_DOORBELL_MMIO */\n+\t\tstruct {\n+\t\t\tint irq; /* IRQ number for the doorbell handler */\n+\t\t\tu32 data; /* write value to ring the doorbell */\n+\t\t} db_mmio;\n+\t} u;\n+};\n+\n /**\n  * struct pci_epc_ops - set of function pointers for performing EPC operations\n  * @write_header: ops to populate configuration space header\n@@ -84,6 +125,8 @@ struct pci_epc_map {\n  * @start: ops to start the PCI link\n  * @stop: ops to stop the PCI link\n  * @get_features: ops to get the features supported by the EPC\n+ * @count_aux_resources: ops to count controller-owned auxiliary resources\n+ * @get_aux_resources: ops to retrieve controller-owned auxiliary resources\n  * @owner: the module owner containing the ops\n  */\n struct pci_epc_ops {\n@@ -115,6 +158,11 @@ struct pci_epc_ops {\n \tvoid\t(*stop)(struct pci_epc *epc);\n \tconst struct pci_epc_features* (*get_features)(struct pci_epc *epc,\n \t\t\t\t\t\t       u8 func_no, u8 vfunc_no);\n+\tint\t(*count_aux_resources)(struct pci_epc *epc, u8 func_no,\n+\t\t\t\t       u8 vfunc_no, int *num_resources);\n+\tint\t(*get_aux_resources)(struct pci_epc *epc, u8 func_no, u8 vfunc_no,\n+\t\t\t\t     struct pci_epc_aux_resource *resources,\n+\t\t\t\t     int num_resources);\n \tstruct module *owner;\n };\n \n@@ -339,6 +387,11 @@ int pci_epc_start(struct pci_epc *epc);\n void pci_epc_stop(struct pci_epc *epc);\n const struct pci_epc_features *pci_epc_get_features(struct pci_epc *epc,\n \t\t\t\t\t\t    u8 func_no, u8 vfunc_no);\n+int pci_epc_count_aux_resources(struct pci_epc *epc, u8 func_no, u8 vfunc_no,\n+\t\t\t\tint *num_resources);\n+int pci_epc_get_aux_resources(struct pci_epc *epc, u8 func_no, u8 vfunc_no,\n+\t\t\t      struct pci_epc_aux_resource *resources,\n+\t\t\t      int num_resources);\n enum pci_barno\n pci_epc_get_first_free_bar(const struct pci_epc_features *epc_features);\n enum pci_barno pci_epc_get_next_free_bar(const struct pci_epc_features\n",
    "prefixes": [
        "v12",
        "1/7"
    ]
}