Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Job IDs are dropped when crossing page boundaries #8

Open
ctbur opened this issue Jul 15, 2019 · 3 comments
Open

Job IDs are dropped when crossing page boundaries #8

ctbur opened this issue Jul 15, 2019 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ctbur
Copy link

ctbur commented Jul 15, 2019

From my tests with the DMA it seems that waiting for a job ID does not equate to waiting for every preceding job ID. Instead a call to wait has to be done for each one in the sequence. If this is the intended behaviour of the DMA, the assumption made by this line of code in hero_dma_memcpy_async is incorrect.

Furthermore, if the DMA job buffer filled up, any further jobs stalled the core indefinitely. Therefore, if more than 16 pages are transferred, the function would stall in the same way.

Edit: The IDs are not dropped on page boundaries, but when the transfer size is larger than PULP_DMA_MAX_XFER_SIZE_B, which causes the transfer to be split into multiple DMA jobs.

@ctbur
Copy link
Author

ctbur commented Aug 1, 2019

To resolve the issue with the dropped job IDs there are two potential solutions:

  • counters can be used to bundle multiple DMA jobs into a single wait operation
  • hero_job_t could be used as a bit vector, where the i-th bit represents whether the DMA job with id i is part of this transfer

To avoid exceeding the limit of 16 transfers there is no good solution that I know of. I could not find any runtime function that tells us how many DMA jobs are ongoing, so the only solution we currently have is to store it in a global. This would mean that any DMA job issued outside of libhero-target would not be recorded and thus we could still exceed the job limit.

@alessandrocapotondi alessandrocapotondi added the bug Something isn't working label Aug 2, 2019
@alessandrocapotondi alessandrocapotondi self-assigned this Aug 2, 2019
@alessandrocapotondi
Copy link
Contributor

Dear @ctbur,
thanks for the report!

I will work on a solution very soon.

Alessandro

alessandrocapotondi added a commit that referenced this issue Aug 2, 2019
 ## Changelog: v1.2.0 - 2019-08-02

 ### Fixed
 - Fix [#8](#8). Fixed `hero_dma_memcpy_async` API. In case of big memory transfers, some DMA job were leacked, resulting on the termination of DMA channels available.

 ### Changed
 - Added API to access HW cycles counters.
@alessandrocapotondi
Copy link
Contributor

alessandrocapotondi commented Aug 2, 2019

Ciao @ctbur,
I pushed on rel-v1.2.0 branch a fix. Unfortunately, I can't test it right now, but It should work.

Let me know if the problem persists, otherwise close the issue.

Thanks,
Alessandro

@vogelpi vogelpi mentioned this issue Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants