]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: endpoint: pci-epf-vntb: Allow BAR assignment via configfs
authorJerome Brunet <jbrunet@baylibre.com>
Tue, 3 Jun 2025 17:03:40 +0000 (19:03 +0200)
committerManivannan Sadhasivam <mani@kernel.org>
Wed, 9 Jul 2025 12:36:51 +0000 (18:06 +0530)
commite7cd58d2fdf8b3d2cb8c1d7a6d8eac2c67e5e18b
treed48802a5356efdd636fe5306035ca2b071cea5b5
parenta079d83c4afd4896f7f29bd9e807cb382043b360
PCI: endpoint: pci-epf-vntb: Allow BAR assignment via configfs

The current BAR configuration for the PCI vNTB endpoint function allocates
BARs in order, which lacks flexibility and does not account for
platform-specific quirks. This is problematic on Renesas platforms, where
BAR_4 is a fixed 256B region that ends up being used for MW1, despite being
better suited for doorbells.

Add new configfs attributes to allow users to specify arbitrary BAR
assignments. If no configuration is provided, the driver retains its
original behavior of sequential BAR allocation, preserving compatibility
with existing userspace setups.

This enables use cases such as assigning BAR_2 for MW1 and using the
limited BAR_4 for doorbells on Renesas platforms.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
[mani: adjusted the indent of EPF_NTB_BAR_W, fixed kdoc & squashed bar fix]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20250603-pci-vntb-bar-mapping-v2-3-fc685a22ad28@baylibre.com
drivers/pci/endpoint/functions/pci-epf-vntb.c