public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Chris Pringle <chris.pringle@oxtel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PowerPC PCI DMA issues (prefetch/coherency?)
Date: Tue, 16 Jun 2009 11:21:14 -0500	[thread overview]
Message-ID: <20090616162114.GA5051@loki.buserror.net> (raw)
In-Reply-To: <4A37A503.3030209@oxtel.com>

On Tue, Jun 16, 2009 at 02:58:27PM +0100, Chris Pringle wrote:
> We're developing on a Freescale MPC8272 and are having some nasty  
> problems with PCI bus mastering and data corruption.

What kernel version?  What firmware?  Custom board, or one in upstream
(which one)?

> We have some custom hardware that is bus mastering, reading data from  
> the CPUs memory for it's own use. Most of the time, the data is correct,  
> however occasionally we are seeing data that appears to be from  
> somewhere else in memory (usually memory that has already been read by  
> the PCI device). The problem looks like stale data on the PCI bridge  
> prefetch buffers or a cache coherency problem, but we've been unable to  
> come up with a solution to our problem. It is my understanding that it  
> shouldn't be a cache coherency problem as the CPU cache should be  
> snooped as the data is read from memory. Even if it were an issue, the  
> pci_map_sg* functions should have sorted out any cache coherency issues  
> before the DMA operation started.

Cache coherency on PCI DMA requires that the memory be mapped with the M
attribute on this chip, but that should be happening based on detection of
the core.

Also make sure that you park the bus on PCI and raise its arbitration
priority, as done at the end of fixup_pci in arch/powerpc/boot/cuboot-pq2.c.

BTW, you may want to post to linuxppc-dev@lists.ozlabs.org for
powerpc-specific issues, especially this kind of hardware issue.

-Scott

  parent reply	other threads:[~2009-06-16 16:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16 13:58 PowerPC PCI DMA issues (prefetch/coherency?) Chris Pringle
2009-06-16 14:16 ` Michael S. Zick
2009-06-16 14:59 ` Hu Gang
2009-06-16 16:21 ` Scott Wood [this message]
2009-06-16 16:34   ` Chris Pringle
2009-06-16 16:46     ` Scott Wood
2009-06-16 16:57       ` Chris Pringle
2009-06-16 17:03         ` Scott Wood
2009-06-16 17:43           ` Arnd Bergmann
2009-06-16 17:49             ` Scott Wood
2009-06-16 18:02               ` Arnd Bergmann
2009-06-17  0:18                 ` Benjamin Herrenschmidt
2009-06-17  0:37                   ` FUJITA Tomonori
2009-06-17  0:56                     ` Leon Woestenberg
2009-06-17  1:08                       ` Benjamin Herrenschmidt
2009-06-17  1:13                         ` Leon Woestenberg
2009-06-17  1:07                     ` Benjamin Herrenschmidt
2009-06-17  7:58           ` Chris Pringle
2009-06-17 13:18             ` Chris Pringle
2009-06-18 11:24               ` Chris Pringle
2009-06-22 14:31                 ` AW: " Sergej.Stepanov
2009-06-29  8:11                   ` Chris Pringle

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=20090616162114.GA5051@loki.buserror.net \
    --to=scottwood@freescale.com \
    --cc=chris.pringle@oxtel.com \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox