Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
dma-trace: Align dma trace buffer correctly, fixed Zephyr dtrace issue#5329
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -541,8 +541,8 @@ int dma_copy_from_host_nowait(struct dma_copy *dc, | ||
| int32_t size); | ||
| /* DMA copy data from DSP to host */ | ||
| int dma_copy_to_host_nowait(struct dma_copy *dc, struct dma_sg_config *host_sg, | ||
| int32_t host_offset, void *local_ptr, int32_t size); | ||
| int dma_copy_to_host(struct dma_copy *dc, struct dma_sg_config *host_sg, | ||
| int32_t host_offset, void *local_ptr, int32_t size); | ||
jsarha marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| int dma_copy_set_stream_tag(struct dma_copy *dc, uint32_t stream_tag); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -83,10 +83,10 @@ static enum task_state trace_work(void *data) | ||
| d->copy_in_progress = 1; | ||
| /* copy this section to host */ | ||
| size = dma_copy_to_host_nowait(&d->dc, config, d->posn.host_offset, | ||
| buffer->r_ptr, size); | ||
| size = dma_copy_to_host(&d->dc, config, d->posn.host_offset, | ||
| buffer->r_ptr, size); | ||
| if (size < 0) { | ||
| tr_err(&dt_tr, "trace_work(): dma_copy_to_host_nowait() failed"); | ||
| tr_err(&dt_tr, "trace_work(): dma_copy_to_host() failed"); | ||
| goto out; | ||
| } | ||
| @@ -223,10 +223,23 @@ static int dma_trace_buffer_init(struct dma_trace_data *d) | ||
| struct dma_trace_buf *buffer = &d->dmatb; | ||
| void *buf; | ||
| k_spinlock_key_t key; | ||
| uint32_t addr_align; | ||
| int err; | ||
| if (!d || !d->dc.dmac) { | ||
| mtrace_printf(LOG_LEVEL_ERROR, | ||
| "%s failed: no DMAC!", __func__); | ||
| return -ENODEV; | ||
| } | ||
| err = dma_get_attribute(d->dc.dmac, DMA_ATTR_BUFFER_ADDRESS_ALIGNMENT, | ||
| &addr_align); | ||
| if (err < 0) | ||
| return err; | ||
| /* allocate new buffer */ | ||
jsarha marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| buf = rballoc(0, SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_DMA, | ||
| DMA_TRACE_LOCAL_SIZE); | ||
| /* For DMA to work properly the buffer must be correctly aligned */ | ||
| buf = rballoc_align(0, SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_DMA, | ||
jsarha marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| DMA_TRACE_LOCAL_SIZE, addr_align); | ||
| if (!buf) { | ||
| tr_err(&dt_tr, "dma_trace_buffer_init(): alloc failed"); | ||
| return -ENOMEM; | ||
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.
Uh oh!
There was an error while loading. Please reload this page.