CR-1156069 Update condition for data transfer complete event to wait for #194
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.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.`