Add CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY and use it to fix UAOL regression#10672
Add CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY and use it to fix UAOL regression#10672kv2019i wants to merge 2 commits intothesofproject:mainfrom
Conversation
|
@ujfalusi @serhiy-katsyuba-intel how about this? If you can find some way to discover this from DSP side, that would be better, but in case it's not possible, we can go with this. Been meaning to add this anyways as a tool to add vendor specific Linux-compatibility hacks like this. |
There was a problem hiding this comment.
Pull request overview
Adds a Linux-compatibility build option to avoid a UAOL-related regression introduced by #10567 when running with older Linux SOF drivers.
Changes:
- Introduce
CONFIG_SOF_OS_LINUX_COMPAT_PRIORITYKconfig option to prioritize backward compatibility with older Linux kernels/drivers. - Enable this option in the Linux overlay configuration.
- Gate UAOL capability TLV reporting in
basefw_vendor_hw_config()based on the new compatibility option.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/audio/base_fw_intel.c |
Conditionally skips UAOL capability TLV emission when Linux compatibility priority is enabled. |
Kconfig.sof |
Adds the new SOF_OS_LINUX_COMPAT_PRIORITY build option. |
app/os_linux_overlay.conf |
Enables the new compatibility option for Linux overlay builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * hardware, so beloe capability check will lead to a DSP | ||
| * panic. In strict compatibility mode, bypass the capability | ||
| * check. */ | ||
| #if !defined(CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY) && defined(CONFIG_UAOL_INTEL_ADSP) |
There was a problem hiding this comment.
The preprocessor guard mixes !defined()/defined() with the rest of this file’s pattern of using #if CONFIG_... for Kconfig booleans (e.g., CONFIG_INTEL_ADSP_MIC_PRIVACY above). Consider switching this guard to use #if !CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY && CONFIG_UAOL_INTEL_ADSP (or IS_ENABLED()) to match local conventions and avoid differences if a symbol is ever defined to 0.
| #if !defined(CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY) && defined(CONFIG_UAOL_INTEL_ADSP) | |
| #if !CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY && CONFIG_UAOL_INTEL_ADSP |
There was a problem hiding this comment.
I prefer to keep original code. SOF has a lot of code that checks value of CONFIG_FOOBAR, but if you check other big projects using Kconfig (like Linux kernel and Zephyr), a Kconfig boolean is either defined, or not set, if option is set to 'n' in Kconfig. So it is actually more correct to check whether a CONFIG_FOOBAR is defined or not, and its value.
app/os_linux_overlay.conf
Outdated
| # with SOF driver in Linux kernel | ||
| # | ||
|
|
||
| # As general rule, update of SOF firmware shall never |
There was a problem hiding this comment.
Grammar in comment: "As general rule" should be "As a general rule".
| # As general rule, update of SOF firmware shall never | |
| # As a general rule, update of SOF firmware shall never |
Add a new Kconfig option to select strict Linux compatibility mode for SOF build. This is enabled when building with the Linux OS overlay (app/os_linux_overlay.conf). SOF is used in environments, where it is easier to force Linux version upgrade, and in environments (like the typical Linux desktop distribution), where kernel and SOF firwmare are integrated separately, and it is common place for end user to run custom kernels. This option allows to cater for both type of usages. For Intel platforms, we intend to use the strict compability approach also in the future, for the SOF firmware binaries we release via sof-bin. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
If SOF is built with Linux OS overlay and uses the strict compatibility mode, do not access UAOL hardware unconditionally on Intel platforms as old Linux kernel versions may not have enabled USB Audio Offload (UAOL) access and trying to read the capabilities from hardware will cause a DSP panic. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Fix the regression with Linux SOF driver and #10567 by adding a new compatibility build option and using it to fix this issue.