[Cbe-oss-dev] [patch 08/16] powerpc and x86_64: Initial port of PCIe endpoint device driver for Axon

Murali Iyer mniyer at vnet.ibm.com
Fri Mar 14 02:22:31 EST 2008


On Thu, 2008-03-13 at 10:11 -0500, Jesse P Arroyo wrote:
> Murali Iyer <mniyer at vnet.ibm.com> wrote on 03/13/2008 10:04:29 AM:
> > > Nothing in the kernel guarantees that the memory returned from
> > > dma_alloc_coherent() is aligned. Even if it is, the DMA address
> > > may not be aligned in the same way. If you require strict alignment,
> > > your best option would be to allocate an extra 64kb and manually
> > > align on the bus address.
> > I suspect it has to be aligned 16 bytes boundary.. need to check.
> > 
> According to the spec, the mailbox FIFO buffer must be aligned on a
> sizeof(buffer) due to the hardware wrapping logic.
> So, if we have a 64kB buffer, we need it aligned to a 64kB address.
       if ((u64)mbx_p->mbx_buf & 0xffff) {
                printk(KERN_ERR "Mailbox buffer not 64KB aligned.\n");
                return -ENOMEM;
        }
Looks like we are checking and not seen any failures so far but what
Arnd saying is that dma_alloc_coherent may not return aligned..

Murali





More information about the cbe-oss-dev mailing list