linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Brower <jbrower@signalogic.com>
To: linuxppc-embedded@ozlabs.org
Subject: driver replacements for kmalloc and __pa()
Date: Tue, 09 Sep 2008 17:00:56 -0500	[thread overview]
Message-ID: <48C6F217.406CFDC0@signalogic.com> (raw)

Hello,

We have inherited an older driver that uses kmalloc() and vtophys (which resolves to
the __pa() macro) to create memory accessible by an external PCI device doing bus
master read/writes.  The driver works Ok on several x86 machines, but is failing on a
PPC board (MPC7447/8) running Gentoo Linux 2.6.9.  After looking at PCI bus analyzer
captures, it seems the physical address the driver is giving to the PCI device is
invalid, so the device ends up reading/writing incorrect memory areas.

What are the up-to-date APIs we should be using for DMA memory allocation and
virtual-to-physical address translation?  We have another driver for another device
that's working fine on this board and it uses pci_alloc_consistent().  What about
bus_space_vaddr()?  I'm hoping to get a recommendation for what's currently
appropriate and most future-proof for drivers that depend on external PCI DMA.

Any suggestions welcome.  Thanks.

-Jeff

             reply	other threads:[~2008-09-09 22:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09 22:00 Jeff Brower [this message]
2008-09-09 22:24 ` driver replacements for kmalloc and __pa() Scott Wood
2008-09-11  0:44   ` Jeff Brower

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=48C6F217.406CFDC0@signalogic.com \
    --to=jbrower@signalogic.com \
    --cc=linuxppc-embedded@ozlabs.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 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).