PCI: endpoint: Add pci_epf_align_inbound_addr() helper for inbound address alignment
authorFrank Li <Frank.Li@nxp.com>
Thu, 10 Jul 2025 19:13:51 +0000 (15:13 -0400)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 24 Jul 2025 21:51:41 +0000 (16:51 -0500)
commit4ff4252a2355f585c5cad8dc959ff1097300aa47
tree2a0e0f0ed057d921e7ff0968941e912d2ce53699
parentc822392280aa9bc57ad3b5079020388950cce9c8
PCI: endpoint: Add pci_epf_align_inbound_addr() helper for inbound address alignment

Add pci_epf_align_inbound_addr() to align the inbound addresses according
to PCI BAR alignment requirements. The aligned base address and offset are
returned via 'base' and 'off' parameters.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
[mani: reworded kernel-doc and commit message]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20250710-ep-msi-v21-5-57683fc7fb25@nxp.com
drivers/pci/endpoint/pci-epf-core.c
include/linux/pci-epf.h