<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/misc/pci_endpoint_test.c, branch linux-7.1.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-04-08T19:41:39+00:00</updated>
<entry>
<title>selftests: pci_endpoint: Skip BAR subrange test on -ENOSPC</title>
<updated>2026-04-08T19:41:39+00:00</updated>
<author>
<name>Christian Bruel</name>
<email>christian.bruel@foss.st.com</email>
</author>
<published>2026-04-07T12:04:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1d3225cb5d82680143ffd705088199917ceafd76'/>
<id>urn:sha1:1d3225cb5d82680143ffd705088199917ceafd76</id>
<content type='text'>
In pci-epf-test.c, set the STATUS_NO_RESOURCE status bit if
pci_epc_set_bar() returns -ENOSPC.  This status bit is used to indicate
that there are not enough inbound window resources to allocate the
subrange.

In pci_endpoint_test.c, return -ENOSPC instead of -EIO when
STATUS_NO_RESOURCE is set.

In pci_endpoint_test.c, skip the BAR subrange test if -ENOSPC, i.e., there
are not enough inbound window resources to run the test.

Signed-off-by: Christian Bruel &lt;christian.bruel@foss.st.com&gt;
[mani: commit log]
Signed-off-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
[bhelgaas: squash related commits]
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Niklas Cassel &lt;cassel@kernel.org&gt;
Reviewed-by: Frank Li &lt;Frank.Li@nxp.com&gt;
Reviewed-by: Koichiro Den &lt;den@valinux.co.jp&gt;
Link: https://patch.msgid.link/20260407-skip-bar_subrange-tests-if-enospc-v4-1-6f2e65f2298c@foss.st.com
Link: https://patch.msgid.link/20260407-skip-bar_subrange-tests-if-enospc-v4-2-6f2e65f2298c@foss.st.com
Link: https://patch.msgid.link/20260407-skip-bar_subrange-tests-if-enospc-v4-3-6f2e65f2298c@foss.st.com
</content>
</entry>
<entry>
<title>misc: pci_endpoint_test: Add Tegra194 and Tegra234 device table entries</title>
<updated>2026-04-04T10:47:02+00:00</updated>
<author>
<name>Manikanta Maddireddy</name>
<email>mmaddireddy@nvidia.com</email>
</author>
<published>2026-03-24T08:08:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ab7a225888baa5474def18ba3b0a298d27e6ba0'/>
<id>urn:sha1:5ab7a225888baa5474def18ba3b0a298d27e6ba0</id>
<content type='text'>
Add PCI device IDs for Tegra194 (0x1ad4) and Tegra234(0x229b) Endpoint
controllers, so that pci_endpoint_test can bind and run on these
controllers.

Signed-off-by: Manikanta Maddireddy &lt;mmaddireddy@nvidia.com&gt;
Signed-off-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Reviewed-by: Niklas Cassel &lt;cassel@kernel.org&gt;
Link: https://patch.msgid.link/20260324080857.916263-5-mmaddireddy@nvidia.com
</content>
</entry>
<entry>
<title>misc: pci_endpoint_test: Use -EINVAL for small subrange size</title>
<updated>2026-04-03T16:34:36+00:00</updated>
<author>
<name>Koichiro Den</name>
<email>den@valinux.co.jp</email>
</author>
<published>2026-03-20T14:01:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9c55d0eb4e9d1bf229d691363fb0641a9b05d904'/>
<id>urn:sha1:9c55d0eb4e9d1bf229d691363fb0641a9b05d904</id>
<content type='text'>
The sub_size check ensures that each subrange is large enough for 32-bit
accesses. Subranges smaller than sizeof(u32) do not satisfy this
assumption, so this is a local sanity check rather than a resource
exhaustion case.

Return -EINVAL instead of -ENOSPC for this case.

Suggested-by: Niklas Cassel &lt;cassel@kernel.org&gt;
Signed-off-by: Koichiro Den &lt;den@valinux.co.jp&gt;
Signed-off-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Reviewed-by: Niklas Cassel &lt;cassel@kernel.org&gt;
Link: https://patch.msgid.link/20260320140139.2415480-1-den@valinux.co.jp
</content>
</entry>
<entry>
<title>misc: pci_endpoint_test: Give reserved BARs a distinct error code</title>
<updated>2026-03-15T16:34:28+00:00</updated>
<author>
<name>Niklas Cassel</name>
<email>cassel@kernel.org</email>
</author>
<published>2026-03-12T13:02:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c3f33af67e6458f4e49d016429d7aeef3c8b8399'/>
<id>urn:sha1:c3f33af67e6458f4e49d016429d7aeef3c8b8399</id>
<content type='text'>
Give reserved BARs a distinct error code, such that the pci_endpoint_test
selftest will be able to skip test cases that are run against reserved
BARs.

Signed-off-by: Niklas Cassel &lt;cassel@kernel.org&gt;
[mani: Used __fls(CAP_BAR0_RESERVED) instead of PCI_ENDPOINT_CAP_BAR0_RESERVED_BIT]
Signed-off-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Tested-by: Manikanta Maddireddy &lt;mmaddireddy@nvidia.com&gt;
Tested-by: Koichiro Den &lt;den@valinux.co.jp&gt;
Reviewed-by: Frank Li &lt;Frank.Li@nxp.com&gt;
Link: https://patch.msgid.link/20260312130229.2282001-21-cassel@kernel.org
</content>
</entry>
<entry>
<title>misc: pci_endpoint_test: Gate doorbell test on dynamic inbound mapping</title>
<updated>2026-02-24T10:30:50+00:00</updated>
<author>
<name>Koichiro Den</name>
<email>den@valinux.co.jp</email>
</author>
<published>2026-02-15T15:03:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=51fba4aa66192fa65a31f213218167d9af326f1e'/>
<id>urn:sha1:51fba4aa66192fa65a31f213218167d9af326f1e</id>
<content type='text'>
The doorbell test relies on the endpoint being able to update inbound
translations at runtime so the host can reach the doorbell target
through a BAR mapping.

If the endpoint does not advertise CAP_DYNAMIC_INBOUND_MAPPING, return
-EOPNOTSUPP from PCITEST_DOORBELL.

This avoids confusing failures in user space and kselftests when the
required capability is not available.

Suggested-by: Niklas Cassel &lt;cassel@kernel.org&gt;
Signed-off-by: Koichiro Den &lt;den@valinux.co.jp&gt;
Signed-off-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Reviewed-by: Niklas Cassel &lt;cassel@kernel.org&gt;
Link: https://patch.msgid.link/20260215150334.3391943-3-den@valinux.co.jp
</content>
</entry>
<entry>
<title>misc: pci_endpoint_test: Add BAR subrange mapping test case</title>
<updated>2026-01-29T23:42:29+00:00</updated>
<author>
<name>Koichiro Den</name>
<email>den@valinux.co.jp</email>
</author>
<published>2026-01-24T14:50:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8cf82bb558517503a81f8e3c49914c0836360aa6'/>
<id>urn:sha1:8cf82bb558517503a81f8e3c49914c0836360aa6</id>
<content type='text'>
Add a new PCITEST_BAR_SUBRANGE ioctl to exercise EPC BAR subrange
mapping end-to-end.

The test programs a simple 2-subrange layout on the endpoint (via
pci-epf-test) and verifies that:
  - the endpoint-provided per-subrange signature bytes are observed at
    the expected PCIe BAR offsets, and
  - writes to each subrange are routed to the correct backing region
    (i.e. the submap order is applied rather than accidentally working
    due to an identity mapping).

Return -EOPNOTSUPP when the endpoint does not advertise subrange
mapping, -ENODATA when the BAR is disabled, and -EBUSY when the BAR is
reserved for the test register space.

Signed-off-by: Koichiro Den &lt;den@valinux.co.jp&gt;
Signed-off-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://patch.msgid.link/20260124145012.2794108-8-den@valinux.co.jp
</content>
</entry>
<entry>
<title>misc: pci_endpoint_test: Cleanup extra 0 initialization</title>
<updated>2025-08-27T13:09:32+00:00</updated>
<author>
<name>Christian Bruel</name>
<email>christian.bruel@foss.st.com</email>
</author>
<published>2025-08-04T17:09:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=384b1b29481e39aae8eb01240d1edf287c7a4145'/>
<id>urn:sha1:384b1b29481e39aae8eb01240d1edf287c7a4145</id>
<content type='text'>
Initialization is not needed as memory is already set to 0 by devm_kzalloc.

Signed-off-by: Christian Bruel &lt;christian.bruel@foss.st.com&gt;
[mani: reworded description]
Signed-off-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Link: https://patch.msgid.link/20250804170916.3212221-3-christian.bruel@foss.st.com
</content>
</entry>
<entry>
<title>misc: pci_endpoint_test: Skip IRQ tests if irq is out of range</title>
<updated>2025-08-27T13:09:06+00:00</updated>
<author>
<name>Christian Bruel</name>
<email>christian.bruel@foss.st.com</email>
</author>
<published>2025-08-04T17:09:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cc8e391067164f45f89b6132a5aaa18c33a0e32b'/>
<id>urn:sha1:cc8e391067164f45f89b6132a5aaa18c33a0e32b</id>
<content type='text'>
The pci_endpoint_test tests the 32-bit MSI range. However, the device might
not have all vectors configured. For example, if msi_interrupts is 8 in the
ep function space or if the MSI Multiple Message Capable value is
configured as 4 (maximum 16 vectors).

In this case, do not attempt to run the test to avoid timeouts and directly
return the error value.

Signed-off-by: Christian Bruel &lt;christian.bruel@foss.st.com&gt;
Signed-off-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Link: https://patch.msgid.link/20250804170916.3212221-2-christian.bruel@foss.st.com
</content>
</entry>
<entry>
<title>misc: pci_endpoint_test: Fix array underflow in pci_endpoint_test_ioctl()</title>
<updated>2025-08-13T21:25:04+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@linaro.org</email>
</author>
<published>2025-08-01T17:03:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1ad82f9db13d85667366044acdfb02009d576c5a'/>
<id>urn:sha1:1ad82f9db13d85667366044acdfb02009d576c5a</id>
<content type='text'>
Commit eefb83790a0d ("misc: pci_endpoint_test: Add doorbell test case")
added NO_BAR (-1) to the pci_barno enum which, in practical terms,
changes the enum from an unsigned int to a signed int.  If the user
passes a negative number in pci_endpoint_test_ioctl() then it results in
an array underflow in pci_endpoint_test_bar().

Fixes: eefb83790a0d ("misc: pci_endpoint_test: Add doorbell test case")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Signed-off-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://patch.msgid.link/aIzzZ4vc6ZrmM9rI@suswa
</content>
</entry>
<entry>
<title>misc: pci_endpoint_test: Add doorbell test case</title>
<updated>2025-07-24T21:51:46+00:00</updated>
<author>
<name>Frank Li</name>
<email>Frank.Li@nxp.com</email>
</author>
<published>2025-07-10T19:13:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eefb83790a0dda112d1755e4f5e213738d717e76'/>
<id>urn:sha1:eefb83790a0dda112d1755e4f5e213738d717e76</id>
<content type='text'>
Add doorbell support with the help of three new registers:
PCIE_ENDPOINT_TEST_DB_BAR, PCIE_ENDPOINT_TEST_DB_ADDR, and
PCIE_ENDPOINT_TEST_DB_DATA.

The testcase works by triggering the doorbell in Endpoint by writing the
value from PCI_ENDPOINT_TEST_DB_DATA register to the address provided by
PCI_ENDPOINT_TEST_DB_OFFSET register of the BAR indicated by the
PCIE_ENDPOINT_TEST_DB_BAR register and waiting for the completion status
from the Endpoint.

Signed-off-by: Frank Li &lt;Frank.Li@nxp.com&gt;
[mani: removed one spurious change and reworded the commit message]
Signed-off-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Tested-by: Niklas Cassel &lt;cassel@kernel.org&gt;
Link: https://patch.msgid.link/20250710-ep-msi-v21-7-57683fc7fb25@nxp.com
</content>
</entry>
</feed>
