This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EDMAK Error: dma_ioctl returns -16 on DM365



When I try to restart my program I sometimes get

[  488.810000] EDMAK Error: dma_ioctl: REQUESTDMA failed: -16

 

I am not really sure about how to tackle this problem. I'm running DVSDK_3_10_00_19

I've upgraded the linuxutils to linuxutils_2_26_02_05

The return code comes from the function davinci_request_params.

 

Is there any way to make sense out of this error?

  • Eric Chartier said:

    [  488.810000] EDMAK Error: dma_ioctl: REQUESTDMA failed: -16

    A return code of -16 is EBUSY, which means that the code allocating the EDMA channel requested an explicit channel number (instead of "ANY") and that particular channel was already allocated.

    Eric Chartier said:

    The return code comes from the function davinci_request_params.

    Actually, that return code comes from edma_alloc_channel().  The function davinci_request_params() (available in "earlier" Davinci Linux MVL releases) can return only error code -22 (EINVAL).

    Eric Chartier said:

    When I try to restart my program I sometimes get

    Since this happens only when restarting your program then it's most likely related to an unreleased resource from the previous run.

    The error might go away if you "% rmmod edmak" and "% insmod edmak.ko" again.

    In order to determine further you could rebuild edmak.ko for DEBUG mode, which will print lots of trace output to the console.  To do so:
        % cd <linux utils>/packages/ti/sdo/linuxutils/edma/src/module
        % make debug
    and the resulting edmak.ko will have trace debug output enabled.

    Run your application to the failure point again, and you should see which channel the request it is failing on.  In order to determine if the problem is due to an unreleased EDMA resource, "reset" EDMAK by either rmmod/insmod (if that does indeed make the problem go away) or restart the system, and observe the EDMAK console messages while application is shutting down.  Inspect the output for traces of a "release" operation on the channel in question - if you don't see it being released then there's the problem, but if you do see it being released then there's more studying of the issue to be done.  Since there will be lots of output unfamiliar to you, if you'd prefer you can post the trace output back here and I'll inspect it for you.

    EDMAK tracks resource allocations and contains an auto-release mechanism that is designed to release resources that were not explicitly released, when the EDMAK file handle is closed.  I would expect that this mechanism would prevent what I'm supposing is happening here (an unreleased resource), based on your statement that the failure happens on a restart of your app, so hopefully we'll see something useful in the EDMA traces.

    Regards,

    - Rob

     

  • Should I see debug output with insmod/rmmod ?

    I see some trace on insmod that I normaly see and nothing during the rmmod.

     

    My application does not output anything more than it normaly does

  • Eric Chartier said:

    Should I see debug output with insmod/rmmod ?

    Yes, you should see debug output with insmod and rmmod when using the debug version of edmak.ko.

    The output will go to the system console, so if you're using a telnet or some other terminal that is not the console when you run your app then you will need to look for the debug output in the console.

    The command "% dmesg" should also show you the same output as the console (limited to the size of the buffer used by dmesg).

    Regards,

    - Rob