Repository navigation
drivers: imx: Dummy DMA driver - #1838
Conversation
c6d0a22 to
3c52432
Compare
3c52432 to
50edfea
Compare
4a8c702 to
53a767e
Compare
|
Remaining Checkpatch warnings are probably benign (long messages making lines too long and that one usage of memcpy which comes from the design of the driver). Otherwise, unless there is another issue this should be mergeable. |
|
@paulstelian97 Yea |
I'd argue that one is hard to actually fix in a semantically meaningful way. I don't have anything other than the elem itself. So I should just do something like |
9ed1ae9 to
b30629b
Compare
|
Pushed, also noticed I forgot to remove the "[DO NOT MERGE]" tag from this one. |
b30629b to
520eafd
Compare
lgirdwood
left a comment
There was a problem hiding this comment.
The dummy driver looks like generic code that may be useful for similar platforms so should probably be drivers/generic directory ?
Also need more commit message on your first patch and the dummy driver could do with more comments explaining what it's doing and why. A top level description in the comments would be good too explaining the sue case since it may not be obvious.
Will do. For the moment the i.MX platform is the only one where this can be used (on the current Intel ones the DSP cannot directly access host memory, can it?)
For the first patch it isn't actually very obvious even to me but I needed to add it because otherwise I couldn't get actual, physical host addresses with HOST_PTABLE disabled (the descriptor would just put NULL as the first host address and I'd have no means to get the real one). The patch is actually larger than it should have been because it includes fixing some compile errors that show up by enabling that config. Any suggestions? For the driver itself, I will think about it and will do. |
520eafd to
2bca0f5
Compare
2e26e8d to
7124a84
Compare
7124a84 to
ea5c27a
Compare
7f51f12 to
b41fd4e
Compare
|
@paulstelian97 this is in a good shape. We need one more review to push it. |
tlauda
left a comment
There was a problem hiding this comment.
Small nitpick + copy size, which I think is important. Also checkpatch is complaining.
ba8fdad to
c759beb
Compare
Enabling this config option changes the way the SG elems are generated, such that the host addresses in the elems are actual, physical addresses. This is required by the Dummy DMA driver, which can only operate with said physical addresses. This commit enables the config option and fixes compile errors which appeared after this enabling. Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
The dummy DMA is a software-based DMA which acts as a host DMA. This one can be implemented in software alone because all host physical address space (at least the RAM portion) is accessible directly from the DSP on this platform. The driver works by taking the physical addresses for both the source and destination addresses from the elems. This works because no paging is enabled on the DSP side, and because the page tables interpretation allows these elements to actually have physical addresses on the host side. Given these addresses, the copy itself is done synchronously on the DSP within a memcpy_s call. Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
This is to optimize memory consumption from this driver. With 32 channels we would have needed a memory block >1024 bytes in size to allocate the dma_chan_data array. However 16 channels (which means allocating a smaller block) should be enough for everyone. Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
This driver can apply to any platform with the buffers in shared memory, not just to i.MX. Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
This config option also encapsulates a required dependency on HOST_PTABLE. Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
c759beb to
28bdfe3
Compare
|
@lgirdwood @tlauda this is working well for us now. I think we fixed all the comments reported. |
Stale review, changes have been applied
|
Checkpatch errors safe to ignore - 80 chars limit doesn't apply for literals in kernel (we should update our checkpatch to match it) |
For the communication between host and DSP a dummy DMA driver which
simply does memcpy is sufficient (given that a sizeable amount of
physical memory is shared)
This commit holds the initial implementation of the dummy DMA driver.
Signed-off-by: Paul Olaru paul.olaru@nxp.com