Skip to content

Add CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY and use it to fix UAOL regression#10672

Open
kv2019i wants to merge 2 commits intothesofproject:mainfrom
kv2019i:202604-fix-uaol
Open

Add CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY and use it to fix UAOL regression#10672
kv2019i wants to merge 2 commits intothesofproject:mainfrom
kv2019i:202604-fix-uaol

Conversation

@kv2019i
Copy link
Copy Markdown
Collaborator

@kv2019i kv2019i commented Apr 1, 2026

Fix the regression with Linux SOF driver and #10567 by adding a new compatibility build option and using it to fix this issue.

Copilot AI review requested due to automatic review settings April 1, 2026 12:36
@kv2019i
Copy link
Copy Markdown
Collaborator Author

kv2019i commented Apr 1, 2026

@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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_PRIORITY Kconfig 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)
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
#if !defined(CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY) && defined(CONFIG_UAOL_INTEL_ADSP)
#if !CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY && CONFIG_UAOL_INTEL_ADSP

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

# with SOF driver in Linux kernel
#

# As general rule, update of SOF firmware shall never
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar in comment: "As general rule" should be "As a general rule".

Suggested change
# As general rule, update of SOF firmware shall never
# As a general rule, update of SOF firmware shall never

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in V2.

kv2019i added 2 commits April 1, 2026 18:21
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants