[PATCH 1/3] PCI: endpoint: pci-epf-test: Advertise dynamic inbound mapping support

Koichiro Den posted 3 patches 1 month, 2 weeks ago
[PATCH 1/3] PCI: endpoint: pci-epf-test: Advertise dynamic inbound mapping support
Posted by Koichiro Den 1 month, 2 weeks ago
The doorbell test requires the EPC driver to support dynamic inbound
mapping so the host can map the doorbell target address into a BAR
aperture.

Expose epc_features->dynamic_inbound_mapping via a new
CAP_DYNAMIC_INBOUND_MAPPING bit in the pci-epf-test capability register,
so the host-side pci_endpoint_test driver can detect missing support and
return -EOPNOTSUPP instead of running the test fruitlessly.

Suggested-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Koichiro Den <den@valinux.co.jp>
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index 0cb7af0919dc..c0db207ff143 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -64,6 +64,7 @@
 #define CAP_MSIX			BIT(2)
 #define CAP_INTX			BIT(3)
 #define CAP_SUBRANGE_MAPPING		BIT(4)
+#define CAP_DYNAMIC_INBOUND_MAPPING	BIT(5)
 
 #define PCI_EPF_TEST_BAR_SUBRANGE_NSUB	2
 
@@ -1102,6 +1103,9 @@ static void pci_epf_test_set_capabilities(struct pci_epf *epf)
 	if (epf_test->epc_features->intx_capable)
 		caps |= CAP_INTX;
 
+	if (epf_test->epc_features->dynamic_inbound_mapping)
+		caps |= CAP_DYNAMIC_INBOUND_MAPPING;
+
 	if (epf_test->epc_features->dynamic_inbound_mapping &&
 	    epf_test->epc_features->subrange_mapping)
 		caps |= CAP_SUBRANGE_MAPPING;
-- 
2.51.0
Re: [PATCH 1/3] PCI: endpoint: pci-epf-test: Advertise dynamic inbound mapping support
Posted by Niklas Cassel 1 month, 2 weeks ago
On Mon, Feb 16, 2026 at 12:03:32AM +0900, Koichiro Den wrote:
> The doorbell test requires the EPC driver to support dynamic inbound
> mapping so the host can map the doorbell target address into a BAR
> aperture.
> 
> Expose epc_features->dynamic_inbound_mapping via a new
> CAP_DYNAMIC_INBOUND_MAPPING bit in the pci-epf-test capability register,
> so the host-side pci_endpoint_test driver can detect missing support and
> return -EOPNOTSUPP instead of running the test fruitlessly.
> 
> Suggested-by: Niklas Cassel <cassel@kernel.org>
> Signed-off-by: Koichiro Den <den@valinux.co.jp>
> ---

Reviewed-by: Niklas Cassel <cassel@kernel.org>