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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rajkumar-xilinx
Copy link

@rajkumar-xilinx rajkumar-xilinx commented Mar 25, 2023

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 Rampelli added 2 commits March 25, 2023 20:38
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

Successfully merging this pull request may close these issues.

1 participant