[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250407-pci-ep-size-alignment-v3-0-865878e68cc8@baylibre.com>
Date: Mon, 07 Apr 2025 16:39:06 +0200
From: Jerome Brunet <jbrunet@...libre.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>, Jon Mason <jdmason@...zu.us>,
Dave Jiang <dave.jiang@...el.com>, Allen Hubbe <allenbh@...il.com>,
Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
Chaitanya Kulkarni <kch@...dia.com>
Cc: Marek Vasut <marek.vasut+renesas@...il.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Yuya Hamamachi <yuya.hamamachi.sx@...esas.com>, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, ntb@...ts.linux.dev,
linux-nvme@...ts.infradead.org, Jerome Brunet <jbrunet@...libre.com>
Subject: [PATCH v3 0/3] PCI: endpoint: space allocation fixups
This patchset fixes problems while trying to allocate space for PCI
endpoint function.
The problems, and related fixups, have been found while trying to link two
renesas rcar-gen4 r8a779f0-spider devices with the vNTB endpoint
function. This platform has 2 configurable BAR0 and BAR2, with an alignment
of 1MB, and fairly small fixed BAR4 of 256B.
This was tested with
* BAR0 (1MB): CTRL+SPAD
* BAR2 (1MB): MW0
* BAR4 (256B): Doorbell
This setup is currently not supported by the vNTB EP driver and requires a
small hack. I'm working on that too.
Changes in v3:
- Rebased on v6.15-rc1
- Fix build issue with newly introduced nvme endpoint function
- Link to v2: https://lore.kernel.org/r/20250404-pci-ep-size-alignment-v2-0-c3a0db4cfc57@baylibre.com
Changes in v2:
- Allocate space that match the iATU alignment requirement, as previously
done.
- Chose not to add a new member in struct pci_epf_bar, as initially
discussed. After reworking the code, that did not seem necessary.
- Make sure SPAD registers are 4 bytes aligned in the vNTB endpoint function
- Link to v1: https://lore.kernel.org/r/20250328-pci-ep-size-alignment-v1-0-ee5b78b15a9a@baylibre.com
Signed-off-by: Jerome Brunet <jbrunet@...libre.com>
---
Jerome Brunet (3):
PCI: endpoint: add epc_feature argument for pci_epf_free_space()
PCI: endpoint: improve fixed_size bar handling when allocating space
PCI: endpoint: pci-epf-vntb: simplify ctrl/spad space allocation
drivers/nvme/target/pci-epf.c | 3 +-
drivers/pci/endpoint/functions/pci-epf-ntb.c | 3 +-
drivers/pci/endpoint/functions/pci-epf-test.c | 2 ++
drivers/pci/endpoint/functions/pci-epf-vntb.c | 42 ++++++++++-----------------
drivers/pci/endpoint/pci-epf-core.c | 27 ++++++++++++-----
include/linux/pci-epf.h | 1 +
6 files changed, 42 insertions(+), 36 deletions(-)
---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250328-pci-ep-size-alignment-9d85b28b8050
Best regards,
--
Jerome
Powered by blists - more mailing lists