Repository navigation
ASoC: SOF: topology: fix cpu_dai_name for links with multi cpu DAIs - #2832
Conversation
6ad33e3 to
965fff5
Compare
| if (link->num_cpus == 1) | ||
| dai->cpu_dai_name = link->cpus->dai_name; | ||
| else | ||
| dai->cpu_dai_name = link->cpus[j++].dai_name; |
There was a problem hiding this comment.
only "dai->cpu_dai_name = link->cpus[j++].dai_name;" can work ?
There was a problem hiding this comment.
ha thats what I had but that will increment j for HDA DAIs and it wont work.
There was a problem hiding this comment.
Should we test if (j < link->num_cpus)?
There was a problem hiding this comment.
so does this mean that if .num_cpus > 1 then the number of DAI widgets must not exceed it, but if .num_cpus == 1 then we can have an arbitrary number of DAI widgets?
|
Confirmed that this PR can fix issue #2821. |
965fff5 to
51658a5
Compare
|
Found a new issue after applying this PR. Please refer to:#2821 (comment) |
| dai->cpu_dai_name = link->cpus->dai_name; | ||
| if (j >= link->num_cpus) { | ||
| dev_err(sdev->dev, | ||
| "error: DAI widget count exceeds link cpus count\n"); |
There was a problem hiding this comment.
can we capitalise "CPUs" too, in fact wouldn't "link CPU count" (without the "s") be more correct - like in the first part "DAI widget count" - not "DAI widgets count?"
| if (link->num_cpus == 1) | ||
| dai->cpu_dai_name = link->cpus->dai_name; | ||
| else | ||
| dai->cpu_dai_name = link->cpus[j++].dai_name; |
There was a problem hiding this comment.
so does this mean that if .num_cpus > 1 then the number of DAI widgets must not exceed it, but if .num_cpus == 1 then we can have an arbitrary number of DAI widgets?
51658a5 to
1ce58c6
Compare
7bf5e3b to
31732eb
Compare
31732eb to
f46c91d
Compare
lyakh
left a comment
There was a problem hiding this comment.
just some optional comments
| if (ret < 0) { | ||
| dev_err(sdev->dev, "error: setting up DAI widget %s\n", w->name); | ||
| return ret; | ||
| } |
There was a problem hiding this comment.
the return value was ignored before this patch? So, it's a separate fix?
There was a problem hiding this comment.
It's a fixup to the patch that added the function so I'd say ok to bake into this one.
There was a problem hiding this comment.
yes, it willbe squashed anyway.
kv2019i
left a comment
There was a problem hiding this comment.
Looks good to me and easier to follow. These big fixups will be challenging to be send, but in this case should be ok as Ranjani you can do the cleanup (if needed) to the "fixed-up" commit messages. In general, might be a good practise to have an updated commit message to be part of the fixup commit (or a comment stating that no change is needed).
I did thumb-up one Guennadi's comment, but as that's minor enough, I'll go ahead and approve.
| if (ret < 0) { | ||
| dev_err(sdev->dev, "error: setting up DAI widget %s\n", w->name); | ||
| return ret; | ||
| } |
There was a problem hiding this comment.
It's a fixup to the patch that added the function so I'd say ok to bake into this one.
| struct sof_ipc_dai_config *config = dai->dai_config; | ||
| int ret; | ||
|
|
||
| config = &dai->dai_config[dai->current_config]; |
There was a problem hiding this comment.
this should be a formal Fixes: at this point, the original commit was merged by Mark Brown if I am mistaken?
There was a problem hiding this comment.
hmm thats right. I'll leave this one here and submit a separate PR to fix the upstream code.
There was a problem hiding this comment.
Not following @ranj063. The fixup! mechanism is only useful if the base commit is still in topic/sof-dev-rebase. we will squash the result before sending upstream
If the ship has sailed and the base commit to be fixed is already in Mark's tree, then we can't use fixup! but only a bona fide patch with a Fixes tag.
f46c91d to
26b9e62
Compare
plbossart
left a comment
There was a problem hiding this comment.
minor nits on 'Fix' and fixup!
| struct sof_ipc_dai_config *config = dai->dai_config; | ||
| int ret; | ||
|
|
||
| config = &dai->dai_config[dai->current_config]; |
There was a problem hiding this comment.
this should be a formal Fixes: at this point, the original commit was merged by Mark Brown if I am mistaken?
| */ | ||
| if (!cpu_dai->playback_widget) { | ||
| cpu_dai->playback_widget = w; | ||
| dai->cpu_dai_name = cpu_dai->name; |
There was a problem hiding this comment.
do we need a Fixes tag as well here?
There was a problem hiding this comment.
@plbossart I want to squash the first 2 commits and remove cpu_dai_name from struct snd_sof_dai altogether. With the new logic to use the playback/capture_widget assocuated with the CPU DAI, we dont really need this at all. What do you think? But then its not really a fx anymore but rather a change in logic.
There was a problem hiding this comment.
Sounds good to me to remove something we don't need :-)
Simplify the widget lookup logic by simply using the playback/capture widget associated with the CPU DAI. With this change in logic the cpu_dai_name field in struct snd_sof_dai is no longer needed. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
…ai config set up Use the current config instead of the first config. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
26b9e62 to
2f1fbf7
Compare
|
approval is subject to clarifying where and how the second patch should go, presumably it will be dropped from this PR. |
plbossart
left a comment
There was a problem hiding this comment.
looks good to me, with the only open the point made by Rander
Use the correct cpu_dai_name when a link has multiple cpu
DAIs.
Fixes #2821