All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Muni Sekhar <munisekharrms@gmail.com>
Cc: linux-pci@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: Question about pci_alloc_consistent() return address
Date: Thu, 14 Nov 2019 13:17:50 -0600	[thread overview]
Message-ID: <20191114191750.GA230106@google.com> (raw)
In-Reply-To: <CAHhAz+j+pN3fy_9NTBBchuz_X1a-FQK0Lt8ty3sk3qkufH7KYQ@mail.gmail.com>

[+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

  reply	other threads:[~2019-11-14 19:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14  8:51 Question about pci_alloc_consistent() return address Muni Sekhar
2019-11-14 19:17 ` Bjorn Helgaas [this message]
2019-11-16 18:36   ` Muni Sekhar

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=20191114191750.GA230106@google.com \
    --to=helgaas@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-pci@vger.kernel.org \
    --cc=munisekharrms@gmail.com \
    /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.