Comments (4)
ezdma is designed for use from userspace only, and get_user_pages_fast() is intended only for userspace (process virtual) memory, so I'm not surprised that it's not working when being called from within the kernel.
I think you're on the right track with your code above (calling the dmaengine API directly from within the kernel), but as far as debugging your specific issue I'd have to know more context. The meanings of register values printed in dmesg are explained in the AXI DMA Documentation (PG021).
from ezdma.
Thank you for your response, according to AXI DMA Documentation, DMA driver turned on 2 bits:
DMA channel halted. For Scatter / Gather Mode this bit gets set when DMACR.RS = 0 and DMA and
scatter Gather (SG) operations have halted. For Direct Register mode (C_INCLUDE_SG = 0) this bit gets
set when DMACR.RS = 0 and DMA operations have halted. There can be a lag of time between when
DMACR.RS = 0 and when DMASR.Halted = 1
DMA Internal Error. Internal error occurs if the buffer length specified in the fetched descriptor
is set to 0. This error condition causes the AXI DMA to halt gracefully. The DMACR.RS bit is set
to 0, and when the engine has completely shut down, the DMASR.Halted bit is set to 1.
I don't know why channel turned off and this error only occurs when I increase the speed to larger than thread hold (2Mbit/s). My code is very simple, it receives bytes from DMA and sends to another module in an infinity loop.
from ezdma.
@gochit: You mentioned that you didn't know how the core's parameters were set when your FPGA image was built -- perhaps as you increase the size of your transfers you are exceeding the configured length of the transfer size register. When the upper bits of your transfer size are lost, the truncated result might be all zeros, which would cause the error you see.
In some versions of the xilinx AXI DMA driver, you can set the register length as a device tree parameter. Even if you don't know exactly how the AXI DMA's register length was configured in your FPGA image, you could always set the value in the device tree to something lower and it should still work, at the expense of using more descriptors than necessary.
from ezdma.
I still don't know why this error occurs. When I can reduce the frequency of errors by increase buffer size which is mapped to DMA. When I increased writing speed, your driver got the same error.
BTW, I replaced DMA single with DMA coherent and the performance is much better, now I can ignore this error 😀
from ezdma.
Related Issues (17)
- Status? HOT 3
- Trouble working with pl330 HOT 6
- module built using petalinux HOT 7
- Kernel error with dma size of 65 KB HOT 2
- dma_map_sg fails HOT 3
- Was this Module added to mainline kernel? HOT 1
- userspace nodes for Debain rootfs HOT 1
- QUESTION
- zynq Ultrscale +
- read() throws error when transfer size is 1 MB HOT 8
- DMA transactions read() or write() with size bigger than 32 kB DMA transactions, Is Possible?? HOT 7
- Physical Addresses HOT 2
- Loopback Devicetree Troubles HOT 5
- Does ezdma support contiguous memory ? HOT 3
- Problem stopping an uncompleted read or write operation HOT 5
- Transferring very large DMA buffers HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ezdma.