[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221213234442.GA219721@bhelgaas>
Date: Tue, 13 Dec 2022 17:44:42 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Kishon Vijay Abraham I <kishon@...nel.org>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>,
Joao Pinto <Joao.Pinto@...opsys.com>,
linux-pci@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-omap@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
hch@...radead.org, nsekhar@...com
Subject: Re: [PATCH v7 01/23] PCI: endpoint: Add EP core layer to enable EP
controller and EP functions
On Mon, Apr 10, 2017 at 07:25:10PM +0530, Kishon Vijay Abraham I wrote:
> Introduce a new EP core layer in order to support endpoint functions in
> linux kernel. This comprises the EPC library (Endpoint Controller Library)
> and EPF library (Endpoint Function Library). EPC library implements
> functions specific to an endpoint controller and EPF library implements
> functions specific to an endpoint function.
> +void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar)
> +{
> + void *space;
> + struct device *dev = &epf->dev;
> + dma_addr_t phys_addr;
> +
> + if (size < 128)
> + size = 128;
> + size = roundup_pow_of_two(size);
> +
> + space = dma_alloc_coherent(dev, size, &phys_addr, GFP_KERNEL);
> + if (!space) {
> + dev_err(dev, "failed to allocate mem space\n");
> + return NULL;
> + }
> +
> + epf->bar[bar].phys_addr = phys_addr;
> + * struct pci_epf_bar - represents the BAR of EPF device
> + * @phys_addr: physical address that should be mapped to the BAR
> + * @size: the size of the address space present in BAR
> + */
> +struct pci_epf_bar {
> + dma_addr_t phys_addr;
If this "phys_addr" is an address that can appear on the PCI bus, is
"phys_addr" a misnomer? Many drivers use dma, dmabuf, bus_addr, etc.
Bjorn
Powered by blists - more mailing lists