Repository navigation
ASoC: SOF: Intel: fix kconfig related if statements in machine drivers - #502
Conversation
There was a problem hiding this comment.
The diagnosis is correct but the fix isn't.
This should be if !IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) so that we only touch these drivers if they are indeed selected.
In addition we should remove all these SOF-dependent cases by adding virtual widgets in the topology to remove spurious error messages and add support for Baytrail CR instead. Can you please work on the virtual widgets part?
plbossart
left a comment
There was a problem hiding this comment.
NAK, this needs to be a topology change for the widgets, and the kernel parts should only see the removal of the IS_ENABLED stuff
There was a problem hiding this comment.
NAK? It looks like a complete misunderstanding, the ask was to create virtual widgets in the topology file e.g. https://github.com/thesofproject/sof/blob/a2e6f82ef810a6a838783467472dfceb7933afc1/tools/topology/sof-apl-da7219.m4#L174
There was a problem hiding this comment.
ok, I misunderstood your request that I need to create some widgets in the kernel, while these should all be done in the sof part. I'll remove them all.
|
I've removed all if statements and the widgets I created. Now this pull request will actually not fix the error message until corresponding SOF topology is changed. By the way, in topology, I notice that there is a small inconsistent thing between the files I'm gonna modify and those already have virtual widgets on them. For example, in
while in
I'm not sure about the difference and still checking. |
plbossart
left a comment
There was a problem hiding this comment.
if you don't follow the guidance I provided then not sure how we are going to progress.
btw the topology differences between codec_in0 and codec0_in are due to the drivers themselves, don't even think about trying to unify things.
There was a problem hiding this comment.
I believe I was clear that this needed to be removed?
All SOF-dependent statement are removed, virtual widgets shall be added in SOF topology in order to avoid missing of some codec widgets. Signed-off-by: Xun Zhang <xun2.zhang@intel.com>
|
@plbossart I have rebased and updated this pr, please check. |
|
@plbossart SOF topology part is here |
| endif ## SND_SOC_SOF_INTEL_PCI | ||
|
|
||
| endif ## SND_SOC_SOF_INTEL | ||
| endif ## SND_SOC_SOF_INTEL_TOPLEVEL |
There was a problem hiding this comment.
good catch, I missed this one. Thanks!
The .BTF_ids section is pre-filled with zeroed BTF ID entries during the build and afterwards patched by resolve_btfids with correct values. Since resolve_btfids always writes in host-native endianness, it relies on libelf to do the translation when the target ELF is cross-compiled to a different endianness (this was introduced in commit 61e8aed ("bpf: Fix libelf endian handling in resolv_btfids")). Unfortunately, the translation will corrupt the flags fields of SET8 entries because these were written during vmlinux compilation and are in the correct endianness already. This will lead to numerous selftests failures such as: $ sudo ./test_verifier 502 502 thesofproject#502/p sleepable fentry accept FAIL Failed to load prog 'Invalid argument'! bpf_fentry_test1 is not sleepable verification time 34 usec stack depth 0 processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0 Summary: 0 PASSED, 0 SKIPPED, 1 FAILED Since it's not possible to instruct libelf to translate just certain values, let's manually bswap the flags (both global and entry flags) in resolve_btfids when needed, so that libelf then translates everything correctly. Fixes: ef2c6f3 ("tools/resolve_btfids: Add support for 8-byte BTF sets") Signed-off-by: Viktor Malik <vmalik@redhat.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/7b6bff690919555574ce0f13d2a5996cacf7bf69.1707223196.git.vmalik@redhat.com
…endianness' Viktor Malik says: ==================== tools/resolve_btfids: fix cross-compilation to non-host endianness The .BTF_ids section is pre-filled with zeroed BTF ID entries during the build and afterwards patched by resolve_btfids with correct values. Since resolve_btfids always writes in host-native endianness, it relies on libelf to do the translation when the target ELF is cross-compiled to a different endianness (this was introduced in commit 61e8aed ("bpf: Fix libelf endian handling in resolv_btfids")). Unfortunately, the translation will corrupt the flags fields of SET8 entries because these were written during vmlinux compilation and are in the correct endianness already. This will lead to numerous selftests failures such as: $ sudo ./test_verifier 502 502 thesofproject#502/p sleepable fentry accept FAIL Failed to load prog 'Invalid argument'! bpf_fentry_test1 is not sleepable verification time 34 usec stack depth 0 processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0 Summary: 0 PASSED, 0 SKIPPED, 1 FAILED Since it's not possible to instruct libelf to translate just certain values, let's manually bswap the flags (both global and entry flags) in resolve_btfids when needed, so that libelf then translates everything correctly. The first patch of the series refactors resolve_btfids by using types from btf_ids.h instead of accessing the BTF ID data using magic offsets. Acked-by: Jiri Olsa <jolsa@kernel.org> --- Changes in v4: - remove unnecessary vars and pointer casts (suggested by Daniel Xu) Changes in v3: - add byte swap of global 'flags' field in btf_id_set8 (suggested by Jiri Olsa) - cleaner refactoring of sets_patch (suggested by Jiri Olsa) - add compile-time assertion that IDs are at the beginning of pairs struct in btf_id_set8 (suggested by Daniel Borkmann) Changes in v2: - use type defs from btf_ids.h (suggested by Andrii Nakryiko) ==================== Link: https://lore.kernel.org/r/cover.1707223196.git.vmalik@redhat.com Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Use SND_SOC_SOF_INTEL_TOPLEVEL configuration in some if statements of
machine drivers (SND_SOC_SOF_INTEL no longer exists)
This is to fix issue #474 , which blocks SOF from loading topology file.