Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2228093/?format=api
{ "id": 2228093, "url": "http://patchwork.ozlabs.org/api/patches/2228093/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260425084607.53825-2-fengchengwen@huawei.com/", "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": "<20260425084607.53825-2-fengchengwen@huawei.com>", "list_archive_url": null, "date": "2026-04-25T08:46:03", "name": "[v4,1/5] PCI/TPH: Export pcie_tph_get_st_modes() for external use", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "aa2d02f7f456dd7a1bdeb3ea114f70044f6833e6", "submitter": { "id": 92756, "url": "http://patchwork.ozlabs.org/api/people/92756/?format=api", "name": "Chengwen Feng", "email": "fengchengwen@huawei.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260425084607.53825-2-fengchengwen@huawei.com/mbox/", "series": [ { "id": 501427, "url": "http://patchwork.ozlabs.org/api/series/501427/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=501427", "date": "2026-04-25T08:46:02", "name": "vfio/pci: Add PCIe TPH support", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/501427/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2228093/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2228093/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-pci+bounces-53167-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=huawei.com header.i=@huawei.com header.a=rsa-sha256\n header.s=dkim header.b=SMwNCJZz;\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-53167-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com\n header.b=\"SMwNCJZz\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=113.46.200.227", "smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=huawei.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=huawei.com" ], "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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g2k361MzMz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 18:46:58 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 890E3300EAA0\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 08:46:29 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id EC65E361DC0;\n\tSat, 25 Apr 2026 08:46:27 +0000 (UTC)", "from canpmsgout12.his.huawei.com (canpmsgout12.his.huawei.com\n [113.46.200.227])\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 A35853321B1;\n\tSat, 25 Apr 2026 08:46:25 +0000 (UTC)", "from mail.maildlp.com (unknown [172.19.163.15])\n\tby canpmsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4g2jv9259BznTWD;\n\tSat, 25 Apr 2026 16:40:05 +0800 (CST)", "from kwepemk500009.china.huawei.com (unknown [7.202.194.94])\n\tby mail.maildlp.com (Postfix) with ESMTPS id 7A68A40571;\n\tSat, 25 Apr 2026 16:46:17 +0800 (CST)", "from localhost.localdomain (10.50.163.32) by\n kwepemk500009.china.huawei.com (7.202.194.94) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.1544.11; Sat, 25 Apr 2026 16:46:16 +0800" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777106787; cv=none;\n b=u0/p7JPUdvMuE79AIdf1bV2uJYfMXUAcaVVqkoo+SuDHr2tOo9+A1mA0CjBcz0KBahGXaNCOKlYmkxUbkedHr74QVCnt4597p5O+q0ylCoMkGY7UYpvvdhl81X++FSvOOckHUcpf6TYfepEgolLpo+0n4W0GSVK4dOssyLHi2wo=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777106787; c=relaxed/simple;\n\tbh=Gx7tpU6S7W2c2AoOW7EdmvXsgoRKdjMoXXEsDjjSEys=;\n\th=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=LeCUYoq9bZ+zocwLHvPmo2F0/NRMinToH/XlCkS7Kve+Y2MnmhlW9mmYrvvgB9LChaBr9sDQe4l/eMUOIScLvCw8Fb6IRDVAzkmClPfI8wjWVd2sk3iKT7G7rSkdTnhwsPsI3AxKs634005RbOqgyd8tQXDNu+/hhfSJD5xFb1E=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=huawei.com;\n spf=pass smtp.mailfrom=huawei.com;\n dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com\n header.b=SMwNCJZz; arc=none smtp.client-ip=113.46.200.227", "dkim-signature": "v=1; a=rsa-sha256; d=huawei.com; s=dkim;\n\tc=relaxed/relaxed; q=dns/txt;\n\th=From;\n\tbh=WgVWU6zoDpnq0ILk/hO0MLd7A+Ww9qyRKPHUW/8gbP8=;\n\tb=SMwNCJZz/6//HrEFhqfKfJPkbQgfjD0DNTbOIETPsKTUEMtI1AHBDmSR7453z/XOKFv3VPi4P\n\tyzdis+1M5qysYLUw+MnwTLO9Fneu3N+V4wL1jtHg0eENtewYB9P+TqHEy5LnQRK2yCpdWnku+3u\n\toQ43tVRs64jmybrSeJpoKeg=", "From": "Chengwen Feng <fengchengwen@huawei.com>", "To": "<alex@shazbot.org>, <jgg@ziepe.ca>", "CC": "<wathsala.vithanage@arm.com>, <helgaas@kernel.org>,\n\t<wangzhou1@hisilicon.com>, <wangyushan12@huawei.com>,\n\t<liuyonglong@huawei.com>, <kvm@vger.kernel.org>, <linux-pci@vger.kernel.org>", "Subject": "[PATCH v4 1/5] PCI/TPH: Export pcie_tph_get_st_modes() for external\n use", "Date": "Sat, 25 Apr 2026 16:46:03 +0800", "Message-ID": "<20260425084607.53825-2-fengchengwen@huawei.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20260425084607.53825-1-fengchengwen@huawei.com>", "References": "<20260425084607.53825-1-fengchengwen@huawei.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-Type": "text/plain", "X-ClientProxiedBy": "kwepems500001.china.huawei.com (7.221.188.70) To\n kwepemk500009.china.huawei.com (7.202.194.94)" }, "content": "Export the helper to retrieve supported PCIe TPH steering tag modes so\nthat drivers like VFIO can query and expose device capabilities to\nuserspace.\n\nAnd also add pcie_tph_get_st_table_size() and\npcie_tph_get_st_table_loc() stub implementation in the !CONFIG_PCI_TPH\ncase.\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\nAcked-by: Bjorn Helgaas <bhelgaas@google.com>\n---\n drivers/pci/tph.c | 13 +++++++++++--\n include/linux/pci-tph.h | 7 +++++++\n 2 files changed, 18 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/pci/tph.c b/drivers/pci/tph.c\nindex 91145e8d9d95..f8767bf6fee9 100644\n--- a/drivers/pci/tph.c\n+++ b/drivers/pci/tph.c\n@@ -145,7 +145,15 @@ static void set_ctrl_reg_req_en(struct pci_dev *pdev, u8 req_type)\n \tpci_write_config_dword(pdev, pdev->tph_cap + PCI_TPH_CTRL, reg);\n }\n \n-static u8 get_st_modes(struct pci_dev *pdev)\n+/**\n+ * pcie_tph_get_st_modes - Get supported Steering Tag modes\n+ * @pdev: PCI device to query\n+ *\n+ * Return:\n+ * Bitmask of supported ST modes (PCI_TPH_CAP_ST_NS, PCI_TPH_CAP_ST_IV,\n+ * PCI_TPH_CAP_ST_DS)\n+ */\n+u8 pcie_tph_get_st_modes(struct pci_dev *pdev)\n {\n \tu32 reg;\n \n@@ -154,6 +162,7 @@ static u8 get_st_modes(struct pci_dev *pdev)\n \n \treturn reg;\n }\n+EXPORT_SYMBOL(pcie_tph_get_st_modes);\n \n /**\n * pcie_tph_get_st_table_loc - Return the device's ST table location\n@@ -400,7 +409,7 @@ int pcie_enable_tph(struct pci_dev *pdev, int mode)\n \n \t/* Sanitize and check ST mode compatibility */\n \tmode &= PCI_TPH_CTRL_MODE_SEL_MASK;\n-\tdev_modes = get_st_modes(pdev);\n+\tdev_modes = pcie_tph_get_st_modes(pdev);\n \tif (!((1 << mode) & dev_modes))\n \t\treturn -EINVAL;\n \ndiff --git a/include/linux/pci-tph.h b/include/linux/pci-tph.h\nindex be68cd17f2f8..586c75b19e01 100644\n--- a/include/linux/pci-tph.h\n+++ b/include/linux/pci-tph.h\n@@ -30,6 +30,7 @@ void pcie_disable_tph(struct pci_dev *pdev);\n int pcie_enable_tph(struct pci_dev *pdev, int mode);\n u16 pcie_tph_get_st_table_size(struct pci_dev *pdev);\n u32 pcie_tph_get_st_table_loc(struct pci_dev *pdev);\n+u8 pcie_tph_get_st_modes(struct pci_dev *pdev);\n #else\n static inline int pcie_tph_set_st_entry(struct pci_dev *pdev,\n \t\t\t\t\tunsigned int index, u16 tag)\n@@ -41,6 +42,12 @@ static inline int pcie_tph_get_cpu_st(struct pci_dev *dev,\n static inline void pcie_disable_tph(struct pci_dev *pdev) { }\n static inline int pcie_enable_tph(struct pci_dev *pdev, int mode)\n { return -EINVAL; }\n+static inline u16 pcie_tph_get_st_table_size(struct pci_dev *pdev)\n+{ return 0; }\n+static inline u32 pcie_tph_get_st_table_loc(struct pci_dev *pdev)\n+{ return 0x7FF; /* Values that do not appear in normal case */ }\n+static inline u8 pcie_tph_get_st_modes(struct pci_dev *pdev)\n+{ return 0; }\n #endif\n \n #endif /* LINUX_PCI_TPH_H */\n", "prefixes": [ "v4", "1/5" ] }