linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Korpilla <korpo@01019freenet.de>
To: linuxppc-embedded@lists.linuxppc.org
Subject: MPC7455 DMA buffer strangeness
Date: Mon, 5 Jul 2004 10:31:09 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.58.0407051018590.388@corpster2> (raw)


Hello!

I'm mapping a DMA buffer allocated with pci_alloc_consistent() into user
space with a mmap hook like this:

int vme_mmap(struct file *file_ptr, struct vm_area_struct *vma)
{
        DPRINTF("Attempting to map %#lx bytes of memory at "
                "physical address %#lx\n", vma->vm_end - vma->vm_start,
                vma->vm_pgoff << PAGE_SHIFT);

        vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);

        vma->vm_flags |= VM_RESERVED;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,3) || defined RH9BRAINDAMAGE
        return remap_page_range(vma, vma->vm_start, vma->vm_pgoff <<
PAGE_SHIFT,
                                vma->vm_end - vma->vm_start,
vma->vm_page_prot);
#else
        return remap_page_range(vma->vm_start, vma->vm_pgoff <<
PAGE_SHIFT,
                                vma->vm_end - vma->vm_start,
vma->vm_page_prot);
#endif
}

Actually this produces the desired effect on a MPC8240, where the buffer
is writeable and readable from user space and kernel space (with its
original virtual address on allocation).

On the MPC7455, though, write accesses seem to be applied or not applied
in a somewhat random fashion. Sometimes an offsetted write into the buffer
is there, and sometimes not. Writing at the begin of the buffer seems to
disapper always.

What's going on here?

Thanks in advance,
Oliver Korpilla

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

             reply	other threads:[~2004-07-05  8:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-05  8:31 Oliver Korpilla [this message]
2004-07-06  8:34 ` MPC7455 DMA buffer strangeness Adrian Cox
2004-07-06  8:47   ` Oliver Korpilla
2004-07-06  9:34     ` Adrian Cox
2004-07-06  9:46       ` Oliver Korpilla
2004-07-06 10:09       ` Oliver Korpilla

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=Pine.LNX.4.58.0407051018590.388@corpster2 \
    --to=korpo@01019freenet.de \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=okorpil@fh-landshut.de \
    /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).