AnsweredAssumed Answered

Possible Bug in adi_dma.c

Question asked by gpetrowitsch on Jul 6, 2010
Latest reply on Jul 7, 2010 by CraigG

Dear all,


I think I discovered a bug in adi_dma.c

It's in the function adi_dma_Queue. Close to the end of

this function, the dataflow is (re)started with this code:


  if (pChannel->Status == ADI_DMA_STATUS_PAUSED) {
    Result = adi_dma_Control(ChannelHandle, ADI_DMA_CMD_SET_DATAFLOW, (void *)TRUE);

I came across the situation, that I queued data buffers, while

the status was ADI_DMA_STATUS_STOPPED. Because of

the if-clause, the DMA was never started. On the other hand,

the adi_dma_Control call with command ADI_DMA_CMD_SET_DATAFLOW

does nothing, if the status is ADI_DMA_STATUS_RUNNING.

So it should do no harm (and in my case solved my problem)

to just remove the if-condition and always do the adi_dma_Control call.





P.S.: I must admit, that I'm not sure, if it's OK to queue buffers when

the status is ADI_DMA_STATUS_STOPPED. In my case I had the

additional problem, that the DMA interrupt service for the related

device driver could not be hooked because of lacking resources.