All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Angielski <jeff@theptrgroup.com>
To: Marc Leeman <marc.leeman@barco.com>
Cc: linas@austin.ibm.com,
	linuxppc-dev list <linuxppc-dev@lists.linuxppc.org>
Subject: Re: PCI Memory mapping
Date: 30 Mar 2004 14:49:39 -0500	[thread overview]
Message-ID: <1080676178.7581.30.camel@localhost.localdomain> (raw)
In-Reply-To: <20040326080012.GA7238@smtp.barco.com>


Marc,

How is the PICMRx configured?  Do you have snoop enabled or disabled?

This will sound obvious, but have you stuck a PCI bus analyzer into the
system to watch the actual PCI transactions?  They more than make up for
their cost in time savings.  :)

Jeff


On Fri, 2004-03-26 at 03:00, Marc Leeman wrote:
> > actually, if you have 32-byte cache lines on your cpu, and you have,
> > umm, something maybe 4-way set associative (I've forgotten how it
> > works) that might explain it. I don't know what cpu's have what cache
> > sizes.
>
> This was also one of the paths we were considering, but the following
> tests have been performed in order to validate or invalidate this
> assumption:
> 1. I was under the impression that 'consistent_alloc' (which I
> activited by defining CONFIG_NOT_COHERENT_CACHE in the kernel
> configuration for our board) assured that the pages were not using
> cache, at least the following lines lead me to this:
>
> [malm@bpscltpd linux-2.4.17_bl21]$ vim ./arch/ppc/mm/cachemap.c
>
> <...>
>         /*
>          * we need to ensure that there are no cachelines in use,
>          * or worse dirty in this area.
>          */
>         invalidate_dcache_range(page, page + size);
> <...>
>
> and
>
> <...>
>         flags = _PAGE_KERNEL | _PAGE_NO_CACHE;
>
>         err = 0;
>         for (i = 0; i < size && err == 0; i += PAGE_SIZE)
>                 err = map_page(va+i, pa+i, flags);
> <...>
>
> As told before, no change with or without this define enabled that uses
> consistent_alloc.
>
> 2. Next I tried to invalidate the cache the naive way:
> I refilled the used buffer with 0xCA in userspace and copied it back to
> kernelspace (in the PCI mappded buffer). Next I transferred the next
> 'useful' data from user to kernel space. Still completely the same: the
> data showing up (corrupted) on the DSP side was the 'old' lines of the
> buffer last transferred (i.e. the buffer before bringing 0xCA into
> kernel space).
>
> 3. I took the previous point one step further: I filled the kernel
> buffer with 0xCA before copying in the userbuffer. Still the same old
> data is showing up on the DSP side. Still, I understand that none of
> these two techniques assure purging the cache.
>
> 4. I added sync's and the like which should sync cache and mem, still no
> change.
>
> Apparently, the closest I can come to pinpointing the location of the
> problem at the moment is that 'something' must be happening at the point
> where the DSP starts reading from the PPC memory. When no such read is
> performed, the problem does not occur. The other way around, the DSP can
> write into the PPC memory without corrupting data.
>
> Maybe reading of the DSP over PCI and the resulting DMA setup causes a
> [hardware|software] timing problem with purging the cache (which should
> not be used for these pages to start with (see [1]), or the DSP ack's
> too early on and reading these 97 bytes after the DSP ACK causes some
> hardware lock to be released, giving the DSP just enough time to
> correctly fetch the data before the PPC starts pumping in new, ...
>
>   marc.
>


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2004-03-30 19:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-16 11:40 PCI Memory mapping Marc Leeman
2004-03-16 16:39 ` Jeff Angielski
2004-03-22  7:48   ` Marc Leeman
2004-03-22 11:02     ` Marc Leeman
2004-03-23 11:17     ` Marc Leeman
2004-03-23 16:01       ` Marc Leeman
2004-03-24  2:04         ` Michael R. Zucca
2004-03-24  0:04       ` Benjamin Herrenschmidt
2004-03-24 12:26         ` Marc Leeman
2004-03-24 14:25           ` Marc Leeman
2004-03-24 17:08             ` linas
2004-03-25 15:48               ` Marc Leeman
2004-03-25 16:34                 ` linas
2004-03-25 16:45                   ` linas
2004-03-26  8:00                     ` Marc Leeman
2004-03-30 19:49                       ` Jeff Angielski [this message]
2004-03-31 15:56                         ` Marc Leeman
2004-03-31 16:02                           ` Marc Leeman
2004-04-01 12:33                           ` Marc Leeman
2004-04-04 22:53                             ` Benjamin Herrenschmidt
2004-04-05  8:46                             ` Adrian Cox
     [not found]                             ` <20040402140130.GG22365@smtp.barco.com>
     [not found]                               ` <1081175362.20952.30.camel@localhost.localdomain>
2004-04-06  6:21                                 ` Marc Leeman
  -- strict thread matches above, loose matches on Subject: below --
2004-04-07  7:15 Marc Leeman
2011-04-15  5:44 koteswararaom
2011-04-15  6:32 ` David Hawkins
2011-04-15  6:48 ` Michael Neuling
2025-04-07 14:55 PCI memory mapping Renaud Barbier
2025-04-08  9:54 ` Lucas Stach
2025-04-09 10:00   ` Renaud Barbier

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=1080676178.7581.30.camel@localhost.localdomain \
    --to=jeff@theptrgroup.com \
    --cc=linas@austin.ibm.com \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=marc.leeman@barco.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.