get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2234744,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2234744/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260508031710.514574-10-alistair.francis@wdc.com/",
    "project": {
        "id": 28,
        "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260508031710.514574-10-alistair.francis@wdc.com>",
    "list_archive_url": null,
    "date": "2026-05-08T03:17:01",
    "name": "[09/18] PCI/CMA: Add a PCI TSM CMA driver using SPDM",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "9c3a5239dab12b3dd6be29ad842b00d44b390073",
    "submitter": {
        "id": 64571,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/64571/?format=api",
        "name": "Alistair Francis",
        "email": "alistair23@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260508031710.514574-10-alistair.francis@wdc.com/mbox/",
    "series": [
        {
            "id": 503312,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/503312/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=503312",
            "date": "2026-05-08T03:16:52",
            "name": "lib: Rust implementation of SPDM",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/503312/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2234744/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2234744/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-pci+bounces-54164-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 (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=UtV3RSiq;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-pci+bounces-54164-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"UtV3RSiq\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.214.171",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"
        ],
        "Received": [
            "from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\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 4gBZCC4sCHz1yK7\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 13:21:11 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id D1D68302A44E\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  8 May 2026 03:18:54 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 5C8893016E7;\n\tFri,  8 May 2026 03:18:39 +0000 (UTC)",
            "from mail-pl1-f171.google.com (mail-pl1-f171.google.com\n [209.85.214.171])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B788306486\n\tfor <linux-pci@vger.kernel.org>; Fri,  8 May 2026 03:18:33 +0000 (UTC)",
            "by mail-pl1-f171.google.com with SMTP id\n d9443c01a7336-2baca78cfaaso8653495ad.1\n        for <linux-pci@vger.kernel.org>; Thu, 07 May 2026 20:18:33 -0700 (PDT)",
            "from toolbx.alistair23.me ([2403:581e:fdf9:0:6209:4521:6813:45b7])\n        by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2baf1eafa62sm3220685ad.74.2026.05.07.20.18.25\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Thu, 07 May 2026 20:18:31 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778210318; cv=none;\n b=mENJ3kG2lRPgvkrWaUSW/6HZKBMDA8Emotjt0tISi5OgOBV4Tm2eubeh5SCfaMcT58ewdE3hk+mfgtCgV3fstRArg3HxvLa/iR+9JXUJwE+QshCtnIoqdW8auX56VeaL8g3vxtHtU6OCmn3Y1HMp3zYTUECwgzzjLtzj5sXh5yc=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778210318; c=relaxed/simple;\n\tbh=MkGBnlqcPkrjbetz6CR3OU3ygvsKKQd9u7prbxNnQb8=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=KDi6Bfl2wS95bZGpS+ODLskfu0bbW9ejLlyqUH7Ljc6d8YERLXVHIm/PL+1boagkriTeZDDJ1wKGhsCI4/RQBx/BkVuJX3AnHjy3sQo35KhvFHtrH7IWlqsG+RisHOo4blFdxV4NmrEPwTO/mVe5uws+CSSejf9Bt+kbwxNRwBk=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=UtV3RSiq; arc=none smtp.client-ip=209.85.214.171",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1778210312; x=1778815112;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=4ZDNMlvL+OebdDkipENIfQ0eTX10FcJgg4MaM4qp9cc=;\n        b=UtV3RSiqhG63kRqMzxQOPtj7OqmR2fYfNs/2aS0tY8Sm03/Rtf33JmDOqNpjXKwM04\n         8G/sZFlwkYHJjMqK08rWNsn9SIfZXCWR12fU94y01n9M71OxS0nWXEBFYtSB3ZAIgGjp\n         qapoy95EcpagTR1ojAPbQ4+NXrEADnrK/GSmR6T5PTX+TNU0pU8Kz7F5Ic4uNQLLdl8X\n         bRHY3HCAdO1grCWBj21mHdmcK0kgjVy1qxL4LtDjHor8H+sUPukMS472VEgGFB1ND922\n         N2fn2U8YyLder5GHTsdzdJBv/LafZMOXflM90LiLmcHB8CEuQzOEUybhZlaq/Qpk7z+J\n         OQCA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1778210312; x=1778815112;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=4ZDNMlvL+OebdDkipENIfQ0eTX10FcJgg4MaM4qp9cc=;\n        b=b0sWPWHGmmMlX9UL6AhkzLksDz68VfBI927PXAwKxPcR25u7fkciliIBRfuS6156B7\n         sxllxE6ISaI9tuBfv/B3T6FuAPBEONyONSbOoAKiwFN+cPWDNqsF6emYNrSZEiF+iqWW\n         gn1uIivMuydPf9wZJ2rAIYFA9pU7YiGDi5+5Ks0Cejn0xEYuRN/7M5ehPcgGwxBwPFPv\n         pm0qqinLGHss0cMpDt1o8uWTFGMhdac3p1+2xW12cahQDoiRQtkFSa1Rr+roxlFj1IAl\n         nM32U3y7OPPOyX+jwXmWNYM8pKuMPG6PNr0TpQKPkKLZADzEcuL2bXf34N4nacryXpQI\n         cFKQ==",
        "X-Forwarded-Encrypted": "i=1;\n AFNElJ+D67S6Incu+hZua9Zp/bd30KStJOeut52qgUlN7DEYnGxF1r8B+fp9/Oc6uGtGrTl9Dup7uavZtl0=@vger.kernel.org",
        "X-Gm-Message-State": "AOJu0Yynhrm/8rynZxdc3A7zO3FVRTWNxW+CStE7G/+F66VIT6KjZWix\n\tIfqQYv80vkiXkNUL7LY7byQG2jTF2ReSXM3sAdt/Qg72hkgLXHdsYeUs",
        "X-Gm-Gg": "Acq92OGw0TydgcOaXktj3YD+v4OOBDvMmrZzTWEZckCOte1lT/rPE327191E0TW/Gf+\n\t2J1nNPK81wq2p4m/uI3b8C/rBxNeu788WqIum6e6nplvwDJSxKTkv9ZVM2lC9g/tTq2hbR/o6FA\n\tt36u9eoqQUmaquMFVUwJRO/6xPAa8QRZXe8xH0JXzo/WZ5FVevgm72ee2j2xJ2FtCCdK+UBff7/\n\tmHrcy2J/JhY07fpJ+21rOJoi+SL58uwX+BrKWQNfyeBP9QwvMv/ciqdBoHv6kGtckRClkouxsv6\n\tJ/qX7zlpgAurcSmfsR7K3EewSI8IJFbCFOWneeKOfDyjJ/2MpM5CfJN5UZ9exKxjsDo2M+u8UAT\n\t5O94mNb+XUgTHat7js+DisxD2OERTwyvR6pbVE4f3H4LjvQUzRPTKEGNfY5VW6nuDnUxiPLz1tn\n\tOkX4HATbECZl1SJcwiuE+KCNFu9JTLlYdE2RVRnWat",
        "X-Received": "by 2002:a17:903:22c4:b0:2ba:e66b:ce34 with SMTP id\n d9443c01a7336-2bae66bd563mr27232095ad.21.1778210312457;\n        Thu, 07 May 2026 20:18:32 -0700 (PDT)",
        "From": "alistair23@gmail.com",
        "X-Google-Original-From": "alistair.francis@wdc.com",
        "To": "alistair@alistair23.me,\n\tlinux-kernel@vger.kernel.org,\n\tlukas@wunner.de,\n\tJonathan.Cameron@huawei.com,\n\tbhelgaas@google.com,\n\trust-for-linux@vger.kernel.org,\n\takpm@linux-foundation.org,\n\tlinux-cxl@vger.kernel.org,\n\tdjbw@kernel.org,\n\tlinux-pci@vger.kernel.org",
        "Cc": "alex.gaynor@gmail.com,\n\twilfred.mallawa@wdc.com,\n\tgary@garyguo.net,\n\tbjorn3_gh@protonmail.com,\n\tbenno.lossin@proton.me,\n\taliceryhl@google.com,\n\tboqun.feng@gmail.com,\n\ta.hindborg@kernel.org,\n\ttmgross@umich.edu,\n\tojeda@kernel.org,\n\talistair23@gmail.com,\n\tAlistair Francis <alistair.francis@wdc.com>",
        "Subject": "[PATCH 09/18] PCI/CMA: Add a PCI TSM CMA driver using SPDM",
        "Date": "Fri,  8 May 2026 13:17:01 +1000",
        "Message-ID": "<20260508031710.514574-10-alistair.francis@wdc.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20260508031710.514574-1-alistair.francis@wdc.com>",
        "References": "<20260508031710.514574-1-alistair.francis@wdc.com>",
        "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",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "From: Alistair Francis <alistair.francis@wdc.com>\n\nComponent Measurement and Authentication (CMA, PCIe r6.2 sec 6.31)\nallows for measurement and authentication of PCIe devices.  It is\nbased on the Security Protocol and Data Model specification (SPDM,\nhttps://www.dmtf.org/dsp/DSP0274).\n\nCMA-SPDM in turn forms the basis for Integrity and Data Encryption\n(IDE, PCIe r6.2 sec 6.33) because the key material used by IDE is\ntransmitted over a CMA-SPDM session.\n\nAs a first step, add support for authentication via a CMA TSM driver.\n\nThis was previously discusd here:\nhttp://lore.kernel.org/69976d7d39c60_2f4a1009@dwillia2-mobl4.notmuch\n\nBy utilising a TSM driver we get a lot of the TSM driver probe policies\n\"for free\". Currently there is no mechanism to provide evidence to\nuserspace, as the TSM system doesn't support that at the moment. That\ncan be added later when support by TSM.\n\nCredits: Jonathan wrote the original proof-of-concept for a CMA implementation.\nLukas reworked that for upstream. Wilfred contributed fixes for issues\ndiscovered during testing. Alistair reworked it as a TSM driver.\n\nSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>\nCo-developed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>\nSigned-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>\nCo-developed-by: Lukas Wunner <lukas@wunner.de>\nSigned-off-by: Lukas Wunner <lukas@wunner.de>\nSigned-off-by: Alistair Francis <alistair.francis@wdc.com>\n---\n MAINTAINERS             |   1 +\n drivers/pci/Kconfig     |  14 ++++\n drivers/pci/Makefile    |   2 +\n drivers/pci/cma.c       | 141 ++++++++++++++++++++++++++++++++++++++++\n drivers/pci/doe.c       |   3 -\n include/linux/pci-doe.h |   4 ++\n 6 files changed, 162 insertions(+), 3 deletions(-)\n create mode 100644 drivers/pci/cma.c",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 2e8ad57fec5d..c99fc6ae2d03 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -24173,6 +24173,7 @@ L:\tlinux-cxl@vger.kernel.org\n L:\tlinux-pci@vger.kernel.org\n S:\tMaintained\n T:\tgit git://git.kernel.org/pub/scm/linux/kernel/git/devsec/spdm.git\n+F:\tdrivers/pci/cma.c\n F:\tinclude/linux/spdm.h\n F:\tlib/rspdm/\n \ndiff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig\nindex 33c88432b728..dcf4170381f2 100644\n--- a/drivers/pci/Kconfig\n+++ b/drivers/pci/Kconfig\n@@ -124,6 +124,20 @@ config PCI_ATS\n config PCI_IDE\n \tbool\n \n+config PCI_CMA\n+\tbool \"Component Measurement and Authentication (CMA-SPDM)\"\n+\tselect CRYPTO_ECDSA\n+\tselect CRYPTO_RSA\n+\tselect CRYPTO_SHA256\n+\tselect CRYPTO_SHA512\n+\tselect PCI_DOE\n+\tselect PCI_TSM\n+\tselect RSPDM\n+\thelp\n+\t  Authenticate devices on enumeration per PCIe r6.2 sec 6.31.\n+\t  A PCI DOE mailbox is used as transport for DMTF SPDM based\n+\t  authentication, measurement and secure channel establishment.\n+\n config PCI_TSM\n \tbool \"PCI TSM: Device security protocol support\"\n \tselect PCI_IDE\ndiff --git a/drivers/pci/Makefile b/drivers/pci/Makefile\nindex 41ebc3b9a518..16abfd0e17e1 100644\n--- a/drivers/pci/Makefile\n+++ b/drivers/pci/Makefile\n@@ -41,6 +41,8 @@ obj-$(CONFIG_PCI_NPEM)\t\t+= npem.o\n obj-$(CONFIG_PCIE_TPH)\t\t+= tph.o\n obj-$(CONFIG_CARDBUS)\t\t+= setup-cardbus.o\n \n+obj-$(CONFIG_PCI_CMA)\t\t+= cma.o\n+\n # Endpoint library must be initialized before its users\n obj-$(CONFIG_PCI_ENDPOINT)\t+= endpoint/\n \ndiff --git a/drivers/pci/cma.c b/drivers/pci/cma.c\nnew file mode 100644\nindex 000000000000..998fde6366fb\n--- /dev/null\n+++ b/drivers/pci/cma.c\n@@ -0,0 +1,141 @@\n+// SPDX-License-Identifier: GPL-2.0\n+/*\n+ * Component Measurement and Authentication (CMA-SPDM, PCIe r6.2 sec 6.31)\n+ *\n+ * Copyright (C) 2021 Huawei\n+ *     Jonathan Cameron <Jonathan.Cameron@huawei.com>\n+ * Copyright (C) 2022-24 Intel Corporation\n+ * Copyright (C) 2026 Western Digital\n+ * \tAlistair Francis <alistair.francis@wdc.com>\n+ */\n+\n+#define dev_fmt(fmt) \"CMA: \" fmt\n+\n+#include <linux/pci.h>\n+#include <linux/pci-doe.h>\n+#include <linux/pci-tsm.h>\n+#include <linux/slab.h>\n+#include <linux/spdm.h>\n+#include <linux/tsm.h>\n+\n+#include \"pci.h\"\n+\n+static ssize_t pci_doe_transport(void *priv, struct device *dev,\n+\t\t\t\t const void *request, size_t request_sz,\n+\t\t\t\t void *response, size_t response_sz)\n+{\n+\tstruct pci_doe_mb *doe = priv;\n+\tssize_t rc;\n+\n+\trc = pci_doe(doe, PCI_VENDOR_ID_PCI_SIG, PCI_DOE_FEATURE_CMA,\n+\t\t     request, request_sz, response, response_sz);\n+\n+\treturn rc;\n+}\n+\n+/**\n+ * struct pci_cma_tsm - CMA SPDM TSM driver context\n+ * @pf0: base pci_tsm_pf0 context (must be first)\n+ * @spdm: SPDM session for this device\n+ */\n+struct pci_cma_tsm {\n+\tstruct pci_tsm_pf0 pf0;\n+\tstruct spdm_state *spdm;\n+};\n+\n+static struct pci_cma_tsm *cma_tsm_from_tsm(struct pci_tsm *tsm)\n+{\n+\tstruct pci_tsm_pf0 *pf0 = container_of(tsm, struct pci_tsm_pf0, base_tsm);\n+\n+\treturn container_of(pf0, struct pci_cma_tsm, pf0);\n+}\n+\n+/**\n+ * struct pci_cma_devsec - CMA SPDM devsec TSM context\n+ * @spdm: SPDM session for this device\n+ */\n+struct pci_cma_devsec {\n+\tstruct spdm_state *spdm;\n+};\n+\n+static struct pci_tsm *pci_cma_tsm_probe(struct tsm_dev *tsm_dev,\n+\t\t\t\t      struct pci_dev *pdev)\n+{\n+\tstruct pci_doe_mb *doe;\n+\tstruct pci_cma_tsm *cma;\n+\n+\tdoe = pci_find_doe_mailbox(pdev, PCI_VENDOR_ID_PCI_SIG,\n+\t\t\t\t   PCI_DOE_FEATURE_CMA);\n+\tif (!doe)\n+\t\treturn NULL;\n+\n+\tcma = kzalloc(sizeof(*cma), GFP_KERNEL);\n+\tif (!cma)\n+\t\treturn NULL;\n+\n+\tmutex_init(&cma->pf0.lock);\n+\tcma->pf0.doe_mb = doe;\n+\tcma->pf0.base_tsm.pdev = pdev;\n+\tcma->pf0.base_tsm.dsm_dev = pdev;\n+\tcma->pf0.base_tsm.tsm_dev = tsm_dev;\n+\n+\tcma->spdm = spdm_create(&pdev->dev, pci_doe_transport, doe,\n+\t\t\t\tPCI_DOE_MAX_PAYLOAD, NULL);\n+\tif (!cma->spdm) {\n+\t\tmutex_destroy(&cma->pf0.lock);\n+\t\tkfree(cma);\n+\t\treturn NULL;\n+\t}\n+\n+\treturn &cma->pf0.base_tsm;\n+}\n+\n+static void pci_cma_tsm_remove(struct pci_tsm *tsm)\n+{\n+\tstruct pci_cma_tsm *cma = cma_tsm_from_tsm(tsm);\n+\n+\tspdm_destroy(cma->spdm);\n+\tmutex_destroy(&cma->pf0.lock);\n+\tkfree(cma);\n+}\n+\n+static int pci_cma_tsm_connect(struct pci_dev *pdev)\n+{\n+\tstruct pci_cma_tsm *cma = cma_tsm_from_tsm(pdev->tsm);\n+\tint rc;\n+\n+\trc = spdm_authenticate(cma->spdm);\n+\tif (rc)\n+\t\treturn rc;\n+\n+\treturn 0;\n+}\n+\n+static void pci_cma_tsm_disconnect(struct pci_dev *pdev)\n+{\n+\t/* SPDM state is freed in pci_cma_tsm_remove() */\n+}\n+\n+static const struct pci_tsm_ops pci_cma_tsm_ops = {\n+\t.link_ops = {\n+\t\t.probe\t\t= pci_cma_tsm_probe,\n+\t\t.remove\t\t= pci_cma_tsm_remove,\n+\t\t.connect\t= pci_cma_tsm_connect,\n+\t\t.disconnect\t= pci_cma_tsm_disconnect,\n+\t},\n+};\n+\n+static struct tsm_dev *pci_cma_tsm_dev;\n+\n+static int __init pci_cma_tsm_init(void)\n+{\n+\tstruct tsm_dev *tsm_dev;\n+\n+\ttsm_dev = tsm_register(NULL, (struct pci_tsm_ops *)&pci_cma_tsm_ops);\n+\tif (IS_ERR(tsm_dev))\n+\t\treturn PTR_ERR(tsm_dev);\n+\n+\tpci_cma_tsm_dev = tsm_dev;\n+\treturn 0;\n+}\n+late_initcall(pci_cma_tsm_init);\ndiff --git a/drivers/pci/doe.c b/drivers/pci/doe.c\nindex 7b41da4ec11a..f236942660a3 100644\n--- a/drivers/pci/doe.c\n+++ b/drivers/pci/doe.c\n@@ -31,9 +31,6 @@\n #define PCI_DOE_FLAG_CANCEL\t0\n #define PCI_DOE_FLAG_DEAD\t1\n \n-/* Max data object length is 2^18 dwords */\n-#define PCI_DOE_MAX_LENGTH\t(1 << 18)\n-\n /**\n  * struct pci_doe_mb - State for a single DOE mailbox\n  *\ndiff --git a/include/linux/pci-doe.h b/include/linux/pci-doe.h\nindex bd4346a7c4e7..7540396336de 100644\n--- a/include/linux/pci-doe.h\n+++ b/include/linux/pci-doe.h\n@@ -19,6 +19,10 @@ struct pci_doe_mb;\n #define PCI_DOE_FEATURE_CMA 1\n #define PCI_DOE_FEATURE_SSESSION 2\n \n+/* Max data object length is 2^18 dwords (including 2 dwords for header) */\n+#define PCI_DOE_MAX_LENGTH\t(1 << 18)\n+#define PCI_DOE_MAX_PAYLOAD\t((PCI_DOE_MAX_LENGTH - 2) * sizeof(u32))\n+\n struct pci_doe_mb *pci_find_doe_mailbox(struct pci_dev *pdev, u16 vendor,\n \t\t\t\t\tu8 type);\n \n",
    "prefixes": [
        "09/18"
    ]
}