]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: endpoint: pci-epf-test: Add BAR subrange mapping test support
authorKoichiro Den <den@valinux.co.jp>
Sat, 24 Jan 2026 14:50:10 +0000 (23:50 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 29 Jan 2026 23:42:21 +0000 (17:42 -0600)
commit6c5e6101423b0dbda417d92d1552a4e2c669a76c
tree03c6ea728d756c8608d39d636bea6d3fafab6cc4
parentdd3ce1667a99d3ecfb1ad3b619140350796e01c0
PCI: endpoint: pci-epf-test: Add BAR subrange mapping test support

Extend pci-epf-test so that pci_endpoint_test can exercise BAR subrange
mapping end-to-end.

Add BAR_SUBRANGE_SETUP/CLEAR commands that program (and tear down) a
simple 2-subrange layout for a selected BAR. The endpoint deliberately
permutes the physical backing regions (swap the halves) and writes a
deterministic signature byte per subrange. This allows the RC to verify
that the submap order is actually applied, not just that reads/writes
work with an identity mapping.

Advertise CAP_SUBRANGE_MAPPING only when the underlying EPC supports
dynamic_inbound_mapping and subrange_mapping. Also bump the default BAR
sizes (BAR0-4) to 128 KiB so that split subranges are large enough to
satisfy common inbound-translation alignment constraints. E.g. for DWC
EP, the default and maximum CX_ATU_MIN_REGION_SIZE is 64 kB, so 128 KiB
is sufficient for DWC-based EP platforms for 2-subrange testing.

Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260124145012.2794108-7-den@valinux.co.jp
drivers/pci/endpoint/functions/pci-epf-test.c