All of lore.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	linux-pci@vger.kernel.org,
	"Rick Wertenbroek" <rick.wertenbroek@gmail.com>
Subject: Re: [PATCH] PCI: endpoint: Improve pci_epc_ops::align_addr() interface
Date: Tue, 15 Oct 2024 11:02:13 +0200	[thread overview]
Message-ID: <Zw4vPeM8sFwOGlLy@ryzen.lan> (raw)
In-Reply-To: <Zw4YkSVpbRVA5KEr@ryzen.lan>

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

      reply	other threads:[~2024-10-15  9:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-15  6:47 [PATCH] PCI: endpoint: Improve pci_epc_ops::align_addr() interface Damien Le Moal
2024-10-15  7:24 ` Niklas Cassel
2024-10-15  9:02   ` Niklas Cassel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zw4vPeM8sFwOGlLy@ryzen.lan \
    --to=cassel@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=dlemoal@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=rick.wertenbroek@gmail.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.