Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
Re-enable trace filtering and implement DMA reset op#4793
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
Closed
Uh oh!
There was an error while loading. Please reload this page.
Closed
Changes from all commits
Commits
Show all changes
4 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
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 |
|---|---|---|
| @@ -50,6 +50,7 @@ DECLARE_TR_CTX(hdma_tr, SOF_UUID(hda_dma_uuid), LOG_LEVEL_INFO); | ||
| #define DGCS_SCS BIT(31) | ||
| #define DGCS_GEN BIT(26) | ||
| #define DGCS_FWCB BIT(23) | ||
| #define DGCS_GBUSY BIT(15) | ||
| #define DGCS_BSC BIT(11) | ||
| /* NOTE: both XRUN bits are the same, just direction is different */ | ||
| #define DGCS_BOR BIT(10) /* buffer overrun (input streams) */ | ||
| @@ -522,7 +523,6 @@ static void hda_dma_channel_put(struct dma_chan_data *channel) | ||
| static int hda_dma_start(struct dma_chan_data *channel) | ||
| { | ||
| uint32_t flags; | ||
| uint32_t dgcs; | ||
| int ret = 0; | ||
| irq_local_disable(flags); | ||
| @@ -532,13 +532,12 @@ static int hda_dma_start(struct dma_chan_data *channel) | ||
| hda_dma_dbg_count_reset(channel); | ||
| /* is channel idle, disabled and ready ? */ | ||
| dgcs = dma_chan_reg_read(channel, DGCS); | ||
| if (channel->status != COMP_STATE_PREPARE || (dgcs & DGCS_GEN)) { | ||
| /* is channel active? */ | ||
| if (channel->status != COMP_STATE_PREPARE) { | ||
| ret = -EBUSY; | ||
| tr_err(&hdma_tr, "hda-dmac: %d channel %d busy. dgcs 0x%x status %d", | ||
| tr_err(&hdma_tr, "hda-dmac: %d channel %d status %d", | ||
| channel->dma->plat_data.id, | ||
| channel->index, dgcs, channel->status); | ||
| channel->index, channel->status); | ||
| goto out; | ||
| } | ||
| @@ -618,7 +617,7 @@ static int hda_dma_stop(struct dma_chan_data *channel) | ||
| hda_dma_host_stop(channel); | ||
| /* disable the channel */ | ||
| dma_chan_reg_update_bits(channel, DGCS, DGCS_GEN | DGCS_FIFORDY, 0); | ||
| dma_chan_reg_update_bits(channel, DGCS, DGCS_FIFORDY, 0); | ||
| channel->status = COMP_STATE_PREPARE; | ||
| hda_chan = dma_chan_get_data(channel); | ||
| hda_chan->state = 0; | ||
| @@ -630,6 +629,28 @@ static int hda_dma_stop(struct dma_chan_data *channel) | ||
| return 0; | ||
| } | ||
| static int hda_dma_reset(struct dma_chan_data *channel) | ||
| { | ||
| uint32_t val, flags; | ||
| irq_local_disable(flags); | ||
| /* reset GEN bit */ | ||
| dma_chan_reg_update_bits(channel, DGCS, DGCS_GEN, 0); | ||
| val = dma_chan_reg_read(channel, DGCS); | ||
| irq_local_enable(flags); | ||
| /* and verify if channel is idle */ | ||
| if (!(val & DGCS_GBUSY)) | ||
| return 0; | ||
| tr_err(&hdma_tr, "hda-dmac: %d channel %d busy", channel->dma->plat_data.id, | ||
| channel->index); | ||
| return -EBUSY; | ||
ranj063 marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| /* fill in "status" with current DMA channel state and position */ | ||
| static int hda_dma_status(struct dma_chan_data *channel, | ||
| struct dma_chan_status *status, uint8_t direction) | ||
| @@ -1004,6 +1025,7 @@ const struct dma_ops hda_link_dma_ops = { | ||
| .channel_put = hda_dma_channel_put, | ||
| .start = hda_dma_start, | ||
| .stop = hda_dma_stop, | ||
| .reset = hda_dma_reset, | ||
| .copy = hda_dma_link_copy, | ||
| .pause = hda_dma_pause, | ||
| .release = hda_dma_release, | ||
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need some timeout check here to wait for the flushing finish?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keyonjie I checked this in the cavs fw and they do not have a wait before checking for GBUSY