linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question about pci_alloc_consistent() return address
@ 2019-11-14  8:51 Muni Sekhar
  2019-11-14 19:17 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Muni Sekhar @ 2019-11-14  8:51 UTC (permalink / raw)
  To: linux-pci

Hi All,

 I’m using pci_alloc_consistent() in PCIe driver. My PCIe device only
works 64 bit data  boundary transactions.

Is there a way to make sure pci_alloc_consistent() always returns
64-bit aligned address?


-- 
Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about pci_alloc_consistent() return address
  2019-11-14  8:51 Question about pci_alloc_consistent() return address Muni Sekhar
@ 2019-11-14 19:17 ` Bjorn Helgaas
  2019-11-16 18:36   ` Muni Sekhar
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2019-11-14 19:17 UTC (permalink / raw)
  To: Muni Sekhar; +Cc: linux-pci, Christoph Hellwig

[+cc Christoph]

On Thu, Nov 14, 2019 at 02:21:21PM +0530, Muni Sekhar wrote:
>  I’m using pci_alloc_consistent() in PCIe driver. My PCIe device only
> works 64 bit data  boundary transactions.
> 
> Is there a way to make sure pci_alloc_consistent() always returns
> 64-bit aligned address?

See Documentation/DMA-API-HOWTO.txt.  pci_alloc_consistent() is
implemented in terms of dma_alloc_coherent(), and that doc says
regions returned from dma_alloc_coherent() are guaranteed to be at
least PAGE_SIZE-aligned.

Are you seeing otherwise, or are you just making sure?  The dma_pool
interface for allocating smaller regions has a way to request the
alignment you need.

Bjorn

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about pci_alloc_consistent() return address
  2019-11-14 19:17 ` Bjorn Helgaas
@ 2019-11-16 18:36   ` Muni Sekhar
  0 siblings, 0 replies; 3+ messages in thread
From: Muni Sekhar @ 2019-11-16 18:36 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, Christoph Hellwig

On Fri, Nov 15, 2019 at 12:47 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> [+cc Christoph]
>
> On Thu, Nov 14, 2019 at 02:21:21PM +0530, Muni Sekhar wrote:
> >  I’m using pci_alloc_consistent() in PCIe driver. My PCIe device only
> > works 64 bit data  boundary transactions.
> >
> > Is there a way to make sure pci_alloc_consistent() always returns
> > 64-bit aligned address?
>
> See Documentation/DMA-API-HOWTO.txt.  pci_alloc_consistent() is
> implemented in terms of dma_alloc_coherent(), and that doc says
> regions returned from dma_alloc_coherent() are guaranteed to be at
> least PAGE_SIZE-aligned.
>
> Are you seeing otherwise, or are you just making sure?  The dma_pool
> interface for allocating smaller regions has a way to request the
> alignment you need.
Thanks for the clarification. I just want to make sure that
pci_alloc_consistent() returns 64-bit aligned address.
>
> Bjorn



-- 
Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-16 18:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14  8:51 Question about pci_alloc_consistent() return address Muni Sekhar
2019-11-14 19:17 ` Bjorn Helgaas
2019-11-16 18:36   ` Muni Sekhar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).