Re: [PATCH] PCI: endpoint: Improve pci_epc_ops::align_addr() interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 15, 2024 at 09:24:01AM +0200, Niklas Cassel wrote:
> 3) The problem with using u64 is that it will be 64-bit even on 32-bit
> systems.
> 
> Looking at:
> https://github.com/torvalds/linux/blob/master/Documentation/core-api/dma-api-howto.rst#cpu-and-dma-addresses
> and
> https://github.com/torvalds/linux/blob/master/include/linux/pci.h#L820-L824
> 
> makes me think that dma_addr_t is a better choice than u64 in this case.
> 
> pci_bus_addr_t is probably an even better choice, but it doesn't seem
> to be used outside drivers/pci/ core code, and it is simply defined to
> have the same size as dma_addr_t (CONFIG_ARCH_DMA_ADDR_T_64BIT) anyway.

Since:
int pci_epc_map_addr(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
                     phys_addr_t phys_addr, u64 pci_addr, size_t size)

Currently uses u64 for the pci address, I guess keeping this new API to
use u64 for the pci address is the most consistent thing after all...

Although ideally, sometime in the future someone should probably convert
both APIs to use pci_bus_addr_t or dma_addr_t instead.


Kind regards,
Niklas




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux