Skip to content

Conversation

@okias
Copy link
Owner

@okias okias commented Nov 19, 2025

Summary

  • remove the tfa_family field and helper so the DSP logic always uses the TFA2 register and IRQ paths
  • simplify the container/profile code to treat all payloads as TFA2 formats and manage SBSL/MANSCONF without conditional branches
  • drop the unused TFA1 mute helper so mute, MTP and status paths consistently call the TFA2 routines

Testing

  • make sound/soc/codecs/tfa98xx-downstream/tfa98xx.o (fails: requires generated .config)

Codex Task

okias and others added 3 commits November 19, 2025 13:02
Temporary solution, until proper driver gets into mainline!

Please, preferably do not waste time on improving except import or
security/crash bugfixes. Rather invest time into upstreaming if possible.

Need firmware (the one from j0sh1x works just fine).

Imported with small adjustments:
 - `{lib/,src/} -> tfa98xx-downstream/`
 - small few unimportant lines of changes to compile

Imported from: https://github.com/j0sh1x/tfa98xx
Discussion w/ Goodix about upstreaming: Goodix-vas/tfa98xx#1

Signed-off-by: David Heidelberg <david@ixit.cz>

[multiple fixups from sdm845-mainline community]
Signed-off-by: Joel Selvaraj <foss@joelselvaraj.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
…er codec

The codec relies on a downstream driver which would need to be entirely
rewritten to submit upstream. Unfortunately we have to carry this DTS
patch for now...

[David]
 - Sort properties.
 - Use GPIO_ACTIVE_HIGH const instead of number.
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
Signed-off-by: David Heidelberg <david@ixit.cz>
okias pushed a commit that referenced this pull request Nov 22, 2025
Provide inline memcpy and memset functions that can be used instead of
the GCC builtins when necessary. The immediate use case is for the text
poking functions to avoid the standard memcpy()/memset() calls because
objtool complains about such dynamic calls within an AC=1 region. See
tools/objtool/Documentation/objtool.txt, warning #9, regarding function
calls with UACCESS enabled.

Some user copy functions such as copy_user_generic() and __clear_user()
have similar rep_{movs,stos} usages. But, those are highly specialized
and hard to combine or reuse for other things. Define these new helpers
for all other usages that need a completely unoptimized, strictly inline
version of memcpy() or memset().

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://patch.msgid.link/20251118182911.2983253-4-sohil.mehta%40intel.com
okias pushed a commit that referenced this pull request Nov 22, 2025
For patching, the kernel initializes a temporary mm area in the lower
half of the address range. LASS blocks these accesses because its
enforcement relies on bit 63 of the virtual address as opposed to SMAP
which depends on the _PAGE_BIT_USER bit in the page table. Disable LASS
enforcement by toggling the RFLAGS.AC bit during patching to avoid
triggering a #GP fault.

Introduce LASS-specific STAC/CLAC helpers to set the AC bit only on
platforms that need it. Name the wrappers as lass_stac()/_clac() instead
of lass_disable()/_enable() because they only control the kernel data
access enforcement. The entire LASS mechanism (including instruction
fetch enforcement) is controlled by the CR4.LASS bit.

Describe the usage of the new helpers in comparison to the ones used for
SMAP. Also, add comments to explain when the existing stac()/clac()
should be used. While at it, move the duplicated "barrier" comment to
the same block.

The Text poking functions use standard memcpy()/memset() while patching
kernel code. However, objtool complains about calling such dynamic
functions within an AC=1 region. See warning #9, regarding function
calls with UACCESS enabled, in tools/objtool/Documentation/objtool.txt.

To pacify objtool, one option is to add memcpy() and memset() to the
list of allowed-functions. However, that would provide a blanket
exemption for all usages of memcpy() and memset(). Instead, replace the
standard calls in the text poking functions with their unoptimized,
always-inlined versions. Considering that patching is usually small,
there is no performance impact expected.

Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://patch.msgid.link/20251118182911.2983253-5-sohil.mehta%40intel.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants