Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDMA driver timeout in poll mode , can't work properly #321

Open
LNC0831 opened this issue Jan 21, 2025 · 4 comments
Open

XDMA driver timeout in poll mode , can't work properly #321

LNC0831 opened this issue Jan 21, 2025 · 4 comments

Comments

@LNC0831
Copy link

LNC0831 commented Jan 21, 2025

Recently I'm working to get low latency in xdma tranfer, when I load the driver in interrupt mode, I always get 30us latency per transfer(32 byte), that means a bit long for my project. So I try to load the driver in poll mode, In XDMA/linux-kernel/test, I run that:
sudo ./load_driver.sh 4
and terminal returns:

interrupt_selection 4.
xdma                   86016  0
Loading driver...insmod xdma.ko poll_mode=1 ...

The Kernel module installed correctly and the xmda devices were recognized.
DONE

after this, In linux-kernel/tools, I run that:
sudo ./dma_to_device -a 0x44a00000 -v
and it takes about 10 seconds then terminal returns:

dev /dev/xdma0_h2c_0, addr 0x44a00000, aperture 0x0, size 0x20, offset 0x0, count 1
host buffer 0x1020 = 0x5620bae8f000
/dev/xdma0_h2c_0, write 0x20 @ 0x44a00000 failed -1.
write file: Unknown error 512

That issue was struggling and I have read other issues but it seems that no evidence had been given.
I will be appreciate if someone can help or share hints on the similar question.

My working environment:

  1. Ubuntu 18.04.6
  2. Kernel Version: 5.3.0-28-generic
  3. dma_ip_driver Version: 2022.1.5
@dmitrym1
Copy link

dmitrym1 commented Feb 4, 2025

Hi @LNC0831. Have you tried alanbl's patch set?

@LNC0831
Copy link
Author

LNC0831 commented Feb 4, 2025

Hi @LNC0831. Have you tried alanbl's patch set?

Glad to receive your reply, I'm still try to figure out the root problem.I have read some artical on ZipCPU and there is a possibility that It's the AXI-Lite peripherals OR the AXI Smartconnect IP caused this problem. I've googled the alanbl's patch, and I did't find something about XDMA driver. Sorry for my unfamiliar with that, Could you please provide a link or upload a zip for me? After all,thank you for your reply.

@dmitrym1
Copy link

dmitrym1 commented Feb 4, 2025

See the link #240
For AXI bus diagnostics I recommend using System ILA with Protocol Checker enabled, or standalone Protocol Checker IP, set a trigger on error detecton signal and you'll get a snapshot of bus state at the moment when the issue was detected. It will also give you an error code. But first try the aforementioned patch, there is a chance it will fix your problem. If it does not, see what "dmesg" tells you.

@LNC0831
Copy link
Author

LNC0831 commented Feb 4, 2025

See the link #240 For AXI bus diagnostics I recommend using System ILA with Protocol Checker enabled, or standalone Protocol Checker IP, set a trigger on error detecton signal and you'll get a snapshot of bus state at the moment when the issue was detected. It will also give you an error code. But first try the aforementioned patch, there is a chance it will fix your problem. If it does not, see what "dmesg" tells you.

Thank you for your sincere help, I'll try that patch and will share the results or maybe solutions later 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants