linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* MPC7455 DMA buffer strangeness
@ 2004-07-05  8:31 Oliver Korpilla
  2004-07-06  8:34 ` Adrian Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Oliver Korpilla @ 2004-07-05  8:31 UTC (permalink / raw)
  To: linuxppc-embedded


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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-07-06 10:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-05  8:31 MPC7455 DMA buffer strangeness Oliver Korpilla
2004-07-06  8:34 ` 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

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).