xilinx_axidma icon indicating copy to clipboard operation
xilinx_axidma copied to clipboard

Inappropriate ioctl for device

Open pmccumber opened this issue 5 years ago • 6 comments

We seem to have a driver installed correctly. It is a read-only axi dma.

[ 976.113508] axidma: loading out-of-tree module taints kernel. [ 976.120585] axidma: axidma_dma.c: axidma_dma_init: 718: DMA: Found 0 transmit channels and 1 receive channels. [ 976.130519] axidma: axidma_dma.c: axidma_dma_init: 720: VDMA: Found 0 transmit channels and 0 receive channels.

But when I try to invoke the driver I get this message. I boiled down the transaction to the simplest of forms but here is the line and the invocation with the error:

_int rc = axidma_oneway_transfer(mDmaDev, DMA_RX_CHANNEL, mpDmaBuf, DMA_BUFFER_SIZE, true);

root@olympus20181217:~# ./axidma_hw Failed to perform the AXI DMA transfer: Inappropriate ioctl for device RX DMA failed! (-1)_

What is it I'm missing here?

pmccumber avatar Mar 29 '19 02:03 pmccumber

Hi! Are you correct compile library (libaxidma.so) and copy it into /lib? Also you can try set ILA around your AXI DMA IP and look to incoming data, if DMA doesn't up s2mm interrupt, may be you have some errors in PL project.

GOOD-Stuff avatar Apr 01 '19 18:04 GOOD-Stuff

Thanks for the response.

I explicitly set the LD_LIBRARY_PATH to where I put the libaxidma.so.

And we are setting ILA around the AXI DMA IP. That's a good idea.

From a sw perspective, it seems pretty simple. The drive installs. The dmesg looks good. The API is pretty simple. I just get that Invalid ioctl. I'll post what we see.

pmccumber avatar Apr 02 '19 16:04 pmccumber

Hello.

I explicitly set the LD_LIBRARY_PATH to where I put the libaxidma.so.

No, I mean copy it into /lib directory on Zynq board.

GOOD-Stuff avatar Apr 03 '19 07:04 GOOD-Stuff

Is anyone using this driver with an Ultrascale+ on a more recent version of Petalinux?

pmccumber avatar Apr 08 '19 14:04 pmccumber

The library is getting executed.

We scoped the axidma logic in the pl and transactions occur when the driver is installed. When we try to use the entry point, axidma_oneway_transfer() the pl sees no transactions and I get the "Inappropriate ioctl for device".

I'm using an Ultrascale+. I'm compiling with: make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 library

Doesn't seem to be hitting the driver correctly.

pmccumber avatar Apr 10 '19 15:04 pmccumber

Solution found. I had updated the driver tree in Petalinux with appropriate source, including axidma_ioctl.h and failed to update the examples/library tree. Yeesh.

pmccumber avatar Apr 10 '19 19:04 pmccumber