Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
75 user(s) are online (51 user(s) are browsing Forums)

Members: 2
Guests: 73

tlm, khayoz, more...

Support us!

Headlines

Report message:*
 

Re: DMA buffer for PCI busmaster headache

Subject: Re: DMA buffer for PCI busmaster headache
by geennaam on 2021/2/11 14:49:44

@salass00

The experiment in my first post did exactly that:

1) Enter hypervisor and save context.

2) Flush caches

3) get/set memory attributes on buffer to inhibit caches ( CurrentAttr | MEMATTRF_CACHEINHIBIT).

3) get physical address of buffer and store in PCIe device DMA base register

4) Return to user space and restore context

5) Write the command to virtual buffer address. Physical address access will result in a DSI )

6) Signal pci device that the new command is available.

I don't know why but this didn't work for me. Still no response.


In the meantime I changed the sequence a bit:

1) Enter hypervisor and save context

2) Get physical address and store in PCI device DMA base register

3) Return to user space and restore context

4) Write command to virtual address

5) Flush cache to memory -> CacheCleanE() with CACRF_ClearD Flag set

6) Signal PCI device that the new command is available.

Now I receive an PCI interrupt when the response is available in another DMA buffer in memory. And this second buffer reads the response that I expected.

Strange that inhibiting caches for my buffer didn't do the trick. But at least it works now.


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project