Re: [PATCH 1/2] PCI: endpoint: Introduce 'get_bar' to map fixed address BARs in EPC

From: Niklas Cassel
Date: Thu Jul 25 2024 - 17:52:46 EST


On Thu, Jul 25, 2024 at 10:06:52PM +0530, Manivannan Sadhasivam wrote:
>
> I vary with you here. IMO EPF drivers have no business in knowing the BAR
> location as they are independent of controller (mostly except drivers like MHI).
> So an EPF driver should call a single API that just allocates/configures the
> BAR. For fixed address BAR, EPC core should be able to figure it out using the
> EPC features.
>
> For naming, we have 3 proposals as of now:
>
> 1. pci_epf_setup_bar() - This looks good, but somewhat collides with the
> existing pci_epc_set_bar() API.
>
> 2. pci_epc_alloc_set_bar() - Looks ugly, but aligns with the existing APIs.
>
> 3. pci_epc_get_bar() - Also looks good, but the usage of 'get' gives the
> impression that the BAR is fetched from somewhere, which is true for fixed
> address BAR, but not for dynamic BAR.

pci_epc_configure_bar() ?
we could name the 'struct pci_epf_bar *' param 'conf'


Kind regards,
Niklas