]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: endpoint: pci-epf-test: Reuse pre-exposed doorbell targets
authorKoichiro Den <den@valinux.co.jp>
Tue, 14 Apr 2026 14:15:13 +0000 (23:15 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 4 May 2026 23:01:33 +0000 (18:01 -0500)
commit8fda2dd209d34396cf49504e2c8dd55d182b14bc
treeb0fe55a2bafcccc2c95eb6874af7e9a927fa342d
parent0c3f82a584082a0d2e09b65e0a2e9cdcf9046d0d
PCI: endpoint: pci-epf-test: Reuse pre-exposed doorbell targets

pci-epf-test advertises the doorbell target to the RC as a BAR number
and an offset, and the RC rings the doorbell with a single DWORD MMIO
write.

Some doorbell backends may report that the doorbell target is already
exposed via a platform-owned fixed BAR (db_msg[0].bar/offset). In that
case, reuse the pre-exposed window and do not reprogram the BAR with
pci_epc_set_bar().

Also honor db_msg[0].irq_flags when requesting the doorbell IRQ, and
only restore the original BAR mapping on disable if pci-epf-test
programmed it.

Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
[bhelgaas: wrap comment]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260414141514.1341429-7-den@valinux.co.jp
drivers/pci/endpoint/functions/pci-epf-test.c