{"id":2234742,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2234742/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260508031710.514574-9-alistair.francis@wdc.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/1.2/projects/28/?format=json","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-9-alistair.francis@wdc.com>","list_archive_url":null,"date":"2026-05-08T03:17:00","name":"[08/18] PCI/TSM: Support connecting to PCIe CMA devices","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"c4dcd9a4d9de7de336c4d895d27d50d1618c183b","submitter":{"id":64571,"url":"http://patchwork.ozlabs.org/api/1.2/people/64571/?format=json","name":"Alistair Francis","email":"alistair23@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260508031710.514574-9-alistair.francis@wdc.com/mbox/","series":[{"id":503312,"url":"http://patchwork.ozlabs.org/api/1.2/series/503312/?format=json","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/2234742/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2234742/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-54163-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=luJNN9US;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-pci+bounces-54163-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=\"luJNN9US\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.216.44","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\n [IPv6:2600:3c15:e001:75::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 4gBZBW3DtLz1yK7\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 13:20:35 +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 20656302698F\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  8 May 2026 03:18:36 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 604482DECBA;\n\tFri,  8 May 2026 03:18:30 +0000 (UTC)","from mail-pj1-f44.google.com (mail-pj1-f44.google.com\n [209.85.216.44])\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 778682F531F\n\tfor <linux-pci@vger.kernel.org>; Fri,  8 May 2026 03:18:26 +0000 (UTC)","by mail-pj1-f44.google.com with SMTP id\n 98e67ed59e1d1-3660daea6a5so739855a91.1\n        for <linux-pci@vger.kernel.org>; Thu, 07 May 2026 20:18:25 -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.17\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Thu, 07 May 2026 20:18:24 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778210309; cv=none;\n b=ECLISMlL6ZlYVGVCzR6dLKrLIwlbl4ST6DVIKKMW1wehVIvnlkixtjL9BCp7PmGIuVslRYO6p1K5EkJ+DrruEAXfvYnx0VoxAa3qNAh75CW/tPB08SJ4tATTKWThE+i4zbcC7Cq8+5AHyie/a0eeUkwDx55UP43L2ximePOzKoc=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778210309; c=relaxed/simple;\n\tbh=L++LTy00lMS0Z9lJGdmdFlMR2op6hVxOgn4kFHOj63g=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=ux0sGKxuTDAeuqiO0xC1tfC+KMbNg8+ZCoNxbzfBHkfmSkYDDlj6jKR4CJSkOFmyglXr6bnZwYt2v0bz+4tHQiEP8BjeDgqn7AQF4FWSlKkqxBX71WoRkXperBlHVCW1/l2LE74X6PL1DMuUfJKhdopdWlfRCh0tKEFQhK8eZrg=","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=luJNN9US; arc=none smtp.client-ip=209.85.216.44","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1778210305; x=1778815105;\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=DaECM3afZbtSVstcoN8c/Bxd1jLK8MEltAPqU9LiKz4=;\n        b=luJNN9UStWQ9eytibJ2OU3m1xDtPOGuAPbgmn3NRUqFn2RXKSB372N7kP2zS/O6u1C\n         tgqLNmqNVEx2lqTs9BpR4OGT+zvIfLsVMXA3BHVMPtyXBy/augp/ozTMwDHKEypEduug\n         YH5q7aSwCCMWsne4haDQHyqksFulFOgJwTMzemcbKisWxGdSRr9shmy1NvPbuy0IdWBs\n         IksE5SdWBACGQCSMph0m2zskToxWqo8/W/VJ23gsYl4lOr3AYqUDx+nkMoh0rgHKSa6r\n         R+VjIpbJxzK1cOREGT4plIlq0prwY7DZFxi96aBpU9smY8SjAsIQqOPlFTWLEmTZBO3z\n         K+sg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1778210305; x=1778815105;\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=DaECM3afZbtSVstcoN8c/Bxd1jLK8MEltAPqU9LiKz4=;\n        b=Fa6w5TgY89311qTz+fhxkhXpZHDXrFCvuw+kW7RX3OBx8pXktmr+ebY7ifdyhKd8i/\n         yiJ1/b9cmeqkSIBFyzX4jcXpSUgXnkZwfA63jfGhZ9J0KHYGWyoeTFo2TUcn/r/uCO6o\n         TMJzN69fZLDNkxlM3cu5yj2cxsskTilP5NbOU0QTWo6hjsJPqrmjw2si3pUG6sEczUtY\n         /WWqOAzmlee6WP24ee8egPVw3qbppQSw/TuoOXZnBaaUnW1FiVAKkPXjhtabBlbR+lGE\n         fWWLMSxBpVSggexGIq9QNUYi5WAKSdP4vM1nTy4nzicRG/xwqtTC0ccz5OdfQyJAtOR7\n         IooQ==","X-Forwarded-Encrypted":"i=1;\n AFNElJ/tusI9oIks7niIswmNJZmlcyBMRKdpVHZJcpkxNB7NQvtU/LJUjF2zIrRiavPyvD/P4aWvKNV2js4=@vger.kernel.org","X-Gm-Message-State":"AOJu0YxLuCHPJS+6drcSZY2uvDuY0U+d4eJVaw7wiKUiR8uqhR2wqqyi\n\tH2MWkpo3X/UySTdQfEEGNeeJRqquT9VvMn8je6UGvm+izM3sRMCBewDE","X-Gm-Gg":"Acq92OEORyersIv8I0+eQduAtnjXnw/Hf5b/CkAOzU2CA8wO93oo1o8aso9d0ZxG0Qo\n\tpbfgiaRtIfEKd3KhTkwHh4+uzNER9BLOn81r92QBuDU6eoBkr1O8/a5djd1y4oc/Wmoi8BFVlw1\n\tqSg1bYBUDk4OXlZeGZ3NsFUNFkLZpfBwOvbRJnPEm4M18lymWtDk06/0EGYVbRTTHEVntF5BC3m\n\tj60dnlCGbAqn6U64lQhWpL1mb6tGer85xom3JMmyBpwmQYWn56SjCQ12xBNaqqE3lHz64oKjg1v\n\ta8BGfiLoWFbFbb7YWrvWFkg2eoUQCMJhp2C7lsxr5rMND8xr4aZixhttk1RdocAbtnVcR3Vw2So\n\tj3GqItyLH4mmtMbXw7swmkTs7c8HfdIKD3LA8sYUiLwDeK3bmjy4HVlWwJOmyydJbcttcE3KBg2\n\tZWLBAM8H7qTMn9EpR58xFdutqTxLNHDi5SFn4lfRJp","X-Received":"by 2002:a17:903:3bcc:b0:2ba:4e84:976 with SMTP id\n d9443c01a7336-2ba78f45b67mr104924825ad.13.1778210304563;\n        Thu, 07 May 2026 20:18:24 -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 08/18] PCI/TSM: Support connecting to PCIe CMA devices","Date":"Fri,  8 May 2026 13:17:00 +1000","Message-ID":"<20260508031710.514574-9-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\nIn the next patch we are going to add a PCIe CMA TSM driver, as such we\nneed to ensure that is_pci_tsm_pf0() will allow us to connect to CMA\ncapable devices. These devices don't necessarily has DEVCAP_TEE or IDE\nsupport.\n\nAs such for Root Complex Integrated Endpoint (PCI_EXP_TYPE_RC_END) we\nalso check for the CMA DOE feature.\n\nSigned-off-by: Alistair Francis <alistair.francis@wdc.com>\n---\n include/linux/pci-tsm.h | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)","diff":"diff --git a/include/linux/pci-tsm.h b/include/linux/pci-tsm.h\nindex a6435aba03f9..5059954e4853 100644\n--- a/include/linux/pci-tsm.h\n+++ b/include/linux/pci-tsm.h\n@@ -3,6 +3,7 @@\n #define __PCI_TSM_H\n #include <linux/mutex.h>\n #include <linux/pci.h>\n+#include <linux/pci-doe.h>\n #include <linux/sockptr.h>\n \n struct pci_tsm;\n@@ -129,6 +130,8 @@ struct pci_tsm_pf0 {\n /* physical function0 and capable of 'connect' */\n static inline bool is_pci_tsm_pf0(struct pci_dev *pdev)\n {\n+\tstruct pci_doe_mb *doe;\n+\n \tif (!pdev)\n \t\treturn false;\n \n@@ -146,9 +149,15 @@ static inline bool is_pci_tsm_pf0(struct pci_dev *pdev)\n \t * switch.\n \t */\n \tswitch (pci_pcie_type(pdev)) {\n+\tcase PCI_EXP_TYPE_RC_END:\n+\t\tdoe = pci_find_doe_mailbox(pdev, PCI_VENDOR_ID_PCI_SIG,\n+\t\t\t\t\t   PCI_DOE_FEATURE_CMA);\n+\n+\t\tif (doe)\n+\t\t\tbreak;\n+\t\tfallthrough;\n \tcase PCI_EXP_TYPE_ENDPOINT:\n \tcase PCI_EXP_TYPE_UPSTREAM:\n-\tcase PCI_EXP_TYPE_RC_END:\n \t\tif (pdev->ide_cap || (pdev->devcap & PCI_EXP_DEVCAP_TEE))\n \t\t\tbreak;\n \t\tfallthrough;\n","prefixes":["08/18"]}