Repository navigation
dmic: change spin_lock to spin_try_lock in dmic_work() - #2078
Merged
lgirdwood merged 3 commits intoNov 11, 2019
Merged
Conversation
After trigger stop we should cancel dmic task from low latency scheduler. Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Adds return to spin_try_lock() in order to retrieve status from arch_try_lock() function. Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
In order to avoid dead locks in dmic_work I've replaced spin_lock() with spin_try_lock(). In case when spin_try_lock() fails we reschedule dmic work. Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
bkokoszx
requested review from
lbetlej,
lgirdwood,
mmaka1,
plbossart and
singalsu
as code owners
November 8, 2019 11:29
| do { \ | ||
| spin_lock_dbg(); \ | ||
| arch_try_lock(lock); \ | ||
| ret = arch_try_lock(lock); \ |
Collaborator
There was a problem hiding this comment.
Wouldn't a better approach be to use a block expression? (GNU extension). As in,
#define spin_try_lock(lock) ({ \
spin_lock_dbg(); \
arch_try_lock(lock); \
})(with the proper alignment)? That would also be of lower impact to the remainder of the code.
Collaborator
Author
There was a problem hiding this comment.
For consistency I think that we can change it for every spin_lock*() macro in another PR.
Member
There was a problem hiding this comment.
ok, we could make this an incremental update in another PR.
jajanusz
approved these changes
Nov 8, 2019
jajanusz
left a comment
Contributor
There was a problem hiding this comment.
Looks legit, if it really fixes reported issues we can merge it.
Good job
Contributor
|
@bkokoszx please fix checkpatch warning |
lgirdwood
approved these changes
Nov 11, 2019
| do { \ | ||
| spin_lock_dbg(); \ | ||
| arch_try_lock(lock); \ | ||
| ret = arch_try_lock(lock); \ |
Member
There was a problem hiding this comment.
ok, we could make this an incremental update in another PR.
Member
|
CI look unrelated. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR fixes 2 bugs with dmic:
dmic_stop()functionIn
dmic_stop()function we invokedspin_lock(dai->lock),then we had irq from low latency scheduler and run
dmic_work().At the beginning of
dmic_work()there was spin_lock(dai->lock)invocation which led to deadlock.
This PR fixes #2044.