PCI buffer allocation in Linux device

From: Joji Joseph
Date: Thu Feb 22 2007 - 05:57:55 EST


Hi All,

I have a PCI host Device runs in Linux platform and the PCI slave device
runs in VxWorks platform.

The PCI DMA transmission is successful from host to slave when I have
allocated source data buffer with "dma_alloc_coherent" function and I
can read the data at the PCI slave (in vxwork platform) when DMA
interrupts happens at there.

But, Though the PCI DMA receive interrupt at the host side(in Linux
platform), I couldn't receive the data which sends from the pci slave
(in vxworks platform).

For allocating the buffer at the host side, I have used
"dma_alloc_coherent" as shown below,

pBuff =dma_alloc_coherent( NULL , lenBuf, &dma_handle, GFP_ATOMIC);

and keeping the physical address 'dma_handle' in buffer descriptor which
is used for the DMA transmission.

When interrupt happens at the host side, I am using the 'pBuff' virtual
address which was saved locally for reading the buffer.

But, the data which I am getting is not correct.

Could anybody help me out how I should allocate memory in this scenario?

Is there any other function which I should use apart from
"dma_alloc_coherent" to get the proper behavior?

Thanks a lot in advance for you help.

Regards
Joji

Conexant E-mail Firewall (Conexant.Com) made the following annotations---------------------------------------------------------------------********************** Legal Disclaimer ****************************

"This email may contain confidential and privileged material for the sole use of the intended recipient. Any unauthorized review, use or distribution by others is strictly prohibited. If you have received the message in error, please advise the sender by reply email and delete the message. Thank you."

**********************************************************************

---------------------------------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/