Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
hda-dma: exit L1 only once for all DMA channels#2664
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
7 commits
Select commit
Hold shift + click to select a range
63e5ae5
notifier: add flags
tlauda 51e2a07
notifier: handle new aggregate flag
tlauda c2c09c2
notifier: protect from preemption
tlauda 5620faa
hda-dma: save irq_disabled in channel data
tlauda 5d94349
hda-dma: exit L1 only once for all DMA channels
tlauda fa7e7aa
pm_runtime: cavs: make private data shared
tlauda de843c9
pm_runtime: add core synchronization for Host DMA L1 Exit
tlauda 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -7,6 +7,7 @@ | ||
| #include <sof/common.h> | ||
| #include <sof/debug/panic.h> | ||
| #include <sof/drivers/idc.h> | ||
| #include <sof/drivers/interrupt.h> | ||
| #include <sof/lib/alloc.h> | ||
| #include <sof/lib/cache.h> | ||
| #include <sof/lib/cpu.h> | ||
| @@ -15,6 +16,7 @@ | ||
| #include <sof/list.h> | ||
| #include <sof/sof.h> | ||
| #include <ipc/topology.h> | ||
| #include <stdint.h> | ||
| #define trace_notifier(__e, ...) \ | ||
| trace_event(TRACE_CLASS_NOTIFIER, __e, ##__VA_ARGS__) | ||
| @@ -30,31 +32,52 @@ struct callback_handle { | ||
| void *caller; | ||
| void (*cb)(void *arg, enum notify_id, void *data); | ||
| struct list_item list; | ||
| uint32_t num_registrations; | ||
| }; | ||
| int notifier_register(void *receiver, void *caller, enum notify_id type, | ||
| void (*cb)(void *arg, enum notify_id type, void *data)) | ||
| void (*cb)(void *arg, enum notify_id type, void *data), | ||
| uint32_t flags) | ||
| { | ||
| struct notify *notify = *arch_notify_get(); | ||
| struct callback_handle *handle; | ||
| uint32_t irq_flags; | ||
| int ret = 0; | ||
| assert(type >= NOTIFIER_ID_CPU_FREQ && type < NOTIFIER_ID_COUNT); | ||
| irq_local_disable(irq_flags); | ||
| /* Find already registered event of this type */ | ||
| if (flags & NOTIFIER_FLAG_AGGREGATE && | ||
| !list_is_empty(¬ify->list[type])) { | ||
| handle = container_of((¬ify->list[type])->next, | ||
tlauda marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| struct callback_handle, list); | ||
| handle->num_registrations++; | ||
| goto out; | ||
| } | ||
| handle = rzalloc(SOF_MEM_ZONE_SYS_RUNTIME, 0, SOF_MEM_CAPS_RAM, | ||
| sizeof(*handle)); | ||
| if (!handle) { | ||
| trace_notifier_error("notifier_register(): callback handle allocation failed."); | ||
| return -ENOMEM; | ||
| ret = -ENOMEM; | ||
| goto out; | ||
| } | ||
| handle->receiver = receiver; | ||
| handle->caller = caller; | ||
| handle->cb = cb; | ||
| handle->num_registrations = 1; | ||
| list_item_prepend(&handle->list, ¬ify->list[type]); | ||
| return 0; | ||
| out: | ||
| irq_local_enable(irq_flags); | ||
| return ret; | ||
| } | ||
| void notifier_unregister(void *receiver, void *caller, enum notify_id type) | ||
| @@ -63,9 +86,12 @@ void notifier_unregister(void *receiver, void *caller, enum notify_id type) | ||
| struct list_item *wlist; | ||
| struct list_item *tlist; | ||
| struct callback_handle *handle; | ||
| uint32_t flags; | ||
| assert(type >= NOTIFIER_ID_CPU_FREQ && type < NOTIFIER_ID_COUNT); | ||
| irq_local_disable(flags); | ||
| /* | ||
| * Unregister all matching callbacks | ||
| * If receiver is NULL, unregister all callbacks with matching callers | ||
| @@ -80,10 +106,14 @@ void notifier_unregister(void *receiver, void *caller, enum notify_id type) | ||
| handle = container_of(wlist, struct callback_handle, list); | ||
| if ((!receiver || handle->receiver == receiver) && | ||
| (!caller || handle->caller == caller)) { | ||
| list_item_del(&handle->list); | ||
| rfree(handle); | ||
| if (!--handle->num_registrations) { | ||
| list_item_del(&handle->list); | ||
| rfree(handle); | ||
| } | ||
| } | ||
| } | ||
| irq_local_enable(flags); | ||
| } | ||
| void notifier_unregister_all(void *receiver, void *caller) | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.