dma_ip_drivers icon indicating copy to clipboard operation
dma_ip_drivers copied to clipboard

CR-1156069 Update condition for data transfer complete event to wait for

Open rajkumar-xilinx opened this issue 1 year ago • 0 comments

Added a new condition in wait_event_interruptible_timeout() to wait for both descq pidx & cidx values to be equal. It will guarantee the data transfer complete and client driver reads the proper data in multi application data transfer test. `Logic in QDMA driver:

  1. QDMA driver receives data request from client/host driver
  2. It starts analyzing the received request (read/write), descriptors etc. Sets cb->done = 0; And, Initialize the wait queue.
  3. It starts processing request 3.1. for each request it starts setting cb->done = 1 & wakeups waiting queue. 3.2. Programs the pending requests pid values in PIDx register. DMA engine invokes data transfer in this step. Once transfer completed, requests/descq pidx, cidx values will be equal.
  4. It starts waiting for cb->done = 1 or timeout lapsed. wait_event_interruptible_timeout(<>, cb->done, timeout); 4.1. wait_event_*() will be terminated once cb->done is 1 which is updated in step 3.1 4.2. It will return the number of bytes to be transferred as a return value to client driver. 4.3. Tried reading the requests pidx & cidx values, they are not equal, meaning data transfer is not yet completed. This might be the reason, if client drivers adds 1 milli sec delay, it is able to read proper response.`

rajkumar-xilinx avatar Mar 25 '23 15:03 rajkumar-xilinx