Skip to content

ASoC: qcom: add Surface Pro 11 Golden v33 protected playback - #89

Closed
ooaklee wants to merge 745 commits into
jglathe:jg/ubuntu-qcom-x1e-7.2.yfrom
ooaklee:x/sp11-golden-audio
Closed

ooaklee wants to merge 745 commits into
jglathe:jg/ubuntu-qcom-x1e-7.2.yfrom
ooaklee:x/sp11-golden-audio

Conversation

@ooaklee

@ooaklee ooaklee commented Sep 1, 2026

Copy link
Copy Markdown

Summary

  • add the opt-in Surface Pro 11 Denali WSA8845 VI/CPS feedback paths required by FullIO protected speaker playback
  • teach SoundWire and AudioReach to consume the FullIO v19c protected-render topology through graph-scoped state and configuration
  • contain the new DAIs, transport metadata, 2S/4-ohm amplifier profile, and protection-clock coordination to Denali and explicitly opted-in amplifiers
  • harden command correlation, teardown, PA completion, and the confirmed DSP bypass path so uncertain state is not reused

Series, base, and dependencies

This PR targets jg/ubuntu-qcom-x1e-7.2.y directly and follows the ordered SP11 release-line topics:

#88 is the immediate prerequisite. This branch is based directly on the release branch; it does not merge any prerequisite head, the broad -sp11 staging branch, or the staging correction merged through #81.

  • base: 032e174490d2ede881771cb368e86540b3a8818b
  • head: 766f34d63900cf897ed9902005c5a5bac1b1ec5b
  • final tree: b2c7e8c5f1c5be3b9cd5b72db3622fd305c0ec75
  • range: 19 linear commits, 22 files, 4,265 insertions, 365 deletions

The bindings and providers precede their consumers, and the two Denali DTS activation commits are last. Reordering changed commit hashes only: the final tree is byte-identical to the reviewed pre-reorder combined head d803e8c2c9173d494420fd5773858f513bf67843.

This PR is intentionally a draft. It must not be marked ready until its dependencies, personal author attestation, exact package build, paired userspace policy, and SP11/non-SP11 hardware gates below are complete.

FullIO v19c userspace pairing and volume safety

Protected playback must be tested with the immutable FullIO v19c UCM source and the sp11-audio-v19c release, whose target commit is 2f97c3d672c7c28acfe39173679a9924489b3c69.

Release asset SHA-256
X1E80100-Microsoft-Surface-Pro-11-tplg.bin e7bb06a03e7bd9b869825a51775355a6743477d1579d78eb09fad5881cfb20f0
MICROSOFT-Surface-Pro-11in.conf 225976f925624f156d9fab84e15a5126a60a236783cfcb82d43d2a2aec028d7b
SP11-HiFi.conf 9d36df8570b85f1dcecc385a8f85fa2d1e1058ef8efedee6ae2ce49dc259a06a

The topology contains protected/vendor-derived data and remains an external userspace artifact; it is not copied into this kernel PR.

There is one deliberate safety difference that must remain visible during review. The v19c UCM requests PA volume 24, while this focused kernel retains the release-line limit of 6 (0 dB). With alsa-lib 1.2.14, UCM cset is passed through snd_ctl_ascii_value_parse(), whose integer parser clamps values to the control's advertised range; the request should therefore resolve to 6 rather than program 24. Hardware testing must verify that behavior instead of assuming it.

For the first hardware pass, use a separately pinned test copy of SP11-HiFi.conf that changes only its four PA-volume requests from 24 to 6, record its digest, and confirm with amixer cget that both controls advertise a maximum of 6 and hold an effective value of 6. This validates protected playback at the retained cap; it does not establish acoustic or production-volume parity with v19c. Any proposal to expose 24 belongs in a later Denali-only safety change, must retain the limit of 6 for other devices, and needs its own acoustic, thermal, fault, and bypass review.

Containment and failure behavior

  • the board graph is selected by microsoft,denali-sndcard; only the common Denali description adds WSA VI/CPS links
  • only the two Denali WSA8845 nodes opt into CPS, transport metadata, and qcom,speaker-load-ohms = <4>
  • the 4-ohm profile is selected only after a fresh 2S VPHX classification; absent or mismatched properties retain the existing 8-ohm/default profile
  • Qualcomm companion feedback DAIs are limited to the Denali root compatible, WSA controller, and DAI IDs 9 and 10; generic SoundWire transport fields default to zero
  • the WSA macro adds its feedback graph only on Denali, and WSA8845 exposes feedback DAIs only for explicitly opted-in codec nodes
  • PA accounting, protection clocks, OOB state, VI/CPS readiness, and protected-render state are owned by the relevant macro or AudioReach graph, not global module state
  • ordinary and protected modes are immutable for the lifetime of a shared graph; an incompatible reuse attempt fails with -EBUSY
  • malformed or partial protected topology profiles fail closed
  • a complete protected profile may use only its topology-derived SP/SPVI bypass when protected setup, calibration, VI, or CPS is unavailable; playback start is refused if the DSP does not confirm that bypass
  • uncertain map, SET_CFG, unmap, stop, or close ownership quarantines the affected callback/client/DMA state rather than allowing reuse before reboot or a future proven reset hook
  • compressed and non-Denali paths retain the ordinary behavior when the protected tokens and Denali markers are absent

The extraction deliberately omits global readiness statics, diagnostic module parameters, hard-coded diagnostic or volume module-instance IDs, soft-pause support, and wholesale driver-file replay.

PA completion hardening

For an opted-in protected amplifier, feedback startup now requires a freshly confirmed 2S/4-ohm profile. PA unmute checks both register writes, waits 1–1.1 ms, reads PA_FSM_STA1, and publishes the macro PA event only when the status read succeeds without an error bit. A failure rolls back DRE and global PA enable and does not advance paired-PA clock state.

The ASoC core may ignore a codec mute_stream return value, so an ALSA start call can still appear successful while this path has correctly left the hardware disabled. The hardware gate must therefore inspect playback, mixer state, and kernel logs rather than treating the start syscall alone as proof of PA readiness.

Provenance and DCO

The focused history preserves authorship according to the substantive source:

  • 13 commits retain geoca <272055834+geocausa@users.noreply.github.com> and their verified source author dates
  • 6 containment/integration commits retain Leon Silcott <leon@boasi.io>
  • each derived commit links to immutable source and integration revisions and includes a factual [Leon: ...] note where the extraction changed structure or containment

The reordered history preserves every author identity, author date, commit body, stable patch ID, and all 48 immutable Link: trailers from the reviewed pre-reorder series.

Every rewritten commit carries exactly one authorized Signed-off-by: Leon Silcott <leon@boasi.io> from the submitter. No personal geoca sign-off exists in the immutable source commits, so none has been invented. Raw strict checkpatch consequently reports NO_AUTHOR_SIGN_OFF for the 13 geoca-authored commits. I will ask @geocausa to attest to the rewritten commits personally before this draft is marked ready.

Validation completed at the exact head

  • git diff --check 032e174490d2ede881771cb368e86540b3a8818b..766f34d63900cf897ed9902005c5a5bac1b1ec5b: pass
  • 19 per-commit strict checkpatch runs with only NO_AUTHOR_SIGN_OFF excluded: 0 errors, 0 warnings, 0 checks; raw strict output contains only the 13 documented nominal-author findings
  • independent history audit: 19 linear commits, no merges, direct merge base, 13/6 author split, exactly one Leon sign-off per commit, no other sign-off, all 48 links preserved, and final tree identical to the pre-reorder tree
  • ARM64 ubuntu_x1e_defconfig W=1 builds of APR, SoundWire bus/controller/stream, WSA macro, WSA8845, AudioReach, Q6APM, LPASS port, topology, and X1E80100 machine-driver objects: pass
  • built-in/module compile coverage for all six WSA8845/WSA-macro y, m, and disabled combinations: pass
  • modified qcom,sm8250.yaml and qcom,wsa8840.yaml binding/schema checks: pass, apart from unrelated pre-existing warnings
  • x1e80100-microsoft-denali-oled.dtb, x1p64100-microsoft-denali.dtb, and non-SP11 x1e80100-dell-xps13-9345.dtb: pass
  • lifecycle/source audit of command correlation, teardown, graph-mode immutability, OOB ownership, confirmed bypass, 2S/default restoration, PA rollback, duplicate events, and per-macro clock ordering: pass
  • source audit confirming that non-Denali devices retain existing DAI, transport, amplifier-profile, and PA defaults: pass
  • public commit/body leakage scans: pass

A focused partial-module build cannot provide meaningful final modpost coverage without the complete kernel's vmlinux and Module.symvers; no full exact-head package or full modpost result is claimed here.

Remaining draft gates

  • merge or otherwise resolve the ordered prerequisite PRs through ASoC: qcom: add Surface Pro 11 TX DMIC capture #88
  • obtain @geocausa's personal attestation for the 13 rewritten commits attributed to geoca
  • pin and hash the PA-volume-6 test UCM described above
  • build the complete exact-head kernel package set and retain its provenance and hashes
  • complete full-tree linkage/modpost validation
  • complete the SP11 and non-SP11 hardware matrices below and attach relevant logs

SP11 hardware gates

  • boot packages built from exact head 766f34d63900cf897ed9902005c5a5bac1b1ec5b with the pinned FullIO topology and PA-volume-6 test UCM
  • verify both PA controls advertise and retain maximum/effective value 6 before any acoustic test; begin at low user-facing volume
  • verify normal left/right speaker playback, balance, volume changes, mute/unmute, and clean open/close
  • confirm VI and CPS become ready for the same AudioReach graph before protected setup, with no graph-calibration, OOB-map, SoundWire, underrun, or -ENODEV error
  • confirm both amplifiers report 2S before the 4-ohm profile is selected, and both PA completion events precede protection-clock enable
  • verify clocks stop before the first PA is torn down and remain balanced over repeated Speaker enable/disable and playback start/stop cycles
  • in controlled low-volume negative tests, make each protection prerequisite unavailable in turn and confirm only a DSP-confirmed bypass can start; an unconfirmed bypass must leave the PA disabled
  • exercise amplifier fault/recovery, suspend/resume, DSP PDR/recovery, driver reprobe where safe, and reboot; check for pops, stuck clocks, channel loss, stale graph state, leaks, thermal warnings, or unbounded retries
  • repeat the playback smoke test on each supported SP11 variant for which hardware is available

Non-SP11 hardware gates

  • boot the exact head on at least one non-Denali X1E device exercising the touched AudioReach and Qualcomm SoundWire paths
  • verify ordinary topology loading plus playback/capture open, close, suspend, resume, DSP PDR/recovery, and safe reprobe remain unchanged when FullIO protected tokens are absent
  • exercise compressed/offload playback as well as ordinary PCM so the protected graph-mode changes cannot silently capture those paths
  • verify no Denali VI/CPS backend, companion DAI, protection OOB setup, 4-ohm profile, or paired-PA clock coordination activates
  • verify a WSA884x device without the opt-in properties retains its existing DAI table, SoundWire ports, 8-ohm/default profile, and PA lifecycle; use a second device if the X1E cross-check does not contain WSA884x

jglathe and others added 30 commits August 30, 2026 10:33
…ncept ISO

needs to boot and have efivars - use Thinkpad T14s as compatible
also added Vivobook 15 x1p42100
also added HP Omnibook X 14-fe1
also added Thinkbook 16
also added Acer Swift Go 14
also added Surface Pro 12"

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
fix typos in tlmm definition

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
since calculating tlmmgpio was unsuccessfful, use the common known one: tlmm 3

remove all possible touchpads except for the actual detected one, @38
disable all sophisticated pinctrl, only on the i2c devices

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
shared with keyboard, f yeah

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
since its apparently shared with the keyboard, disable it for now
there needs to be a mux driver which does the handling for it

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
required for 6.17

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
add dependency for python3-libfdt
add stubble-script hwids/finddtbs.py as debian/scripts/misc/find-dtbs.py

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
… T14s

T14s is powerful, but the fan doesn't cool it enough for full load.
Tone it down to the experimentally determined limits
QMP Combo PHYs default to USB3DP lane routing, which can break static setups like
DP-to-HDMI bridges by misallocating lanes to USB3.
Revive the optional "qcom,combo-initial-mode" DT property [1] to explicitly
set the initial mode ("usb3dp", "dp", "usb3"). In static configs (no mode-switch
or orientation-switch props), honor it and skip lane inference to avoid overrides.
This simplifies HDMI enablement on undocumented Snapdragon X laptops while
preserving dynamic Type-C behavior.

[1]: https://lore.kernel.org/r/20250821-topic-x1e80100-hdmi-v1-2-f14ad9430e88@linaro.org

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
Microsoft Surface Pro 12 is using this (well, my definition of it), changed to
Stephan Gerhold's one.

Remove the edp0_hpd_default reference from Thinkbook 16 as TLMM 119 is used by the HDMI bridge
as enable pin.

Link: https://lore.kernel.org/r/20250822-x1e80100-add-edp-hpd-v2-1-6310176239a6@linaro.org

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
…to dp controller, fix backlight"

now duplicate template, therefore remove it

Link: https://lore.kernel.org/r/20250822-x1e80100-add-edp-hpd-v2-1-6310176239a6@linaro.org

This reverts commit 22f5ffacc9cd4f5a5074b863223f80bc0f0d6b33.
…lt pinctrl

seems to be needed

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
Relates-to commit 8c0b058.

Signed-off-by: James Addison <jay@jp-hosting.net>
adding the remaining commits of 20251101-asus_usbc_dp-v1-0-9fd4eb9935e8@hotmail.com
... but on the generalized x1-asus-vivobook-s15.dtsi

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
this works with Ubuntu kernel builds that don't know the SPRCHRGD in QSEECOM

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
found in Lenovo Ideapad Slim 3 15Q8X10

raw EDID:

00 ff ff ff ff ff ff 00 09 e5 ea 0c 00 00 00 00
0c 22 01 04 a5 21 15 78 03 af e5 97 5e 58 92 28
1f 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 9c 3e 80 c8 70 b0 3c 40 30 20
36 00 49 ce 10 00 00 1a 00 00 00 fd 00 28 3c 4c
4c 10 01 0a 20 20 20 20 20 20 00 00 00 fe 00 42
4f 45 20 43 51 0a 20 20 20 20 20 20 00 00 00 fc
00 4e 56 31 35 33 57 55 4d 2d 4e 34 31 0a 01 63

70 20 79 02 00 81 00 15 74 1a 00 00 03 01 28 3c
00 00 53 4a 53 4a 3c 00 00 00 00 80 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 e3 90

Detailed Timing Descriptors:
DTD 1:
1920x1200   60.002995 Hz  16:10    75.604 kHz    160.280000 MHz (329 mm x 206 mm)
   Hfront   48 Hsync  32 Hback  120 Hpol P
   Vfront    3 Vsync   6 Vback   51 Vpol N

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
…iants

LCD: Panel is CMN N140JCE-EL1, selecting the odd backlight PWM like on
ThinkBook 16 G7 QOY

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
like on Thinkbook 16 and Ideapad 5

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
seem to be problematic

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
as tested out by Anthony Ruhier and Val Packett [1]

[1]: https://lore.kernel.org/all/a5efb372-1a2a-4262-abc8-49bbeffa6961@packett.cool/

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
name change from x1e80100 and x1p42100

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
There is a small window where the device can suspend after
pm_runtime_enable() and before pm_runtime_forbid(), causing an
unnecessary suspend/resume cycle while the PHY is not yet registered.

Move pm_runtime_forbid() before pm_runtime_enable() to eliminate
this race.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
add Purwa-specific dts

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
Put the firmware paths into the separate dts

also correct the gpu firmware path to consistent naming.

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
…ible for older kernels

Add this compatible to get efivars on kernels that are not aware
of the sp11 in scm.

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
ooaklee and others added 12 commits September 1, 2026 05:29
Add playback capabilities for the WSA TX0 and TX1 backend DAIs used by
Denali's VI and CPS protection links. Build the modified table as a
device-managed copy only for the Denali AudioReach backend provider.

Other machines and the legacy Q6AFE provider keep the existing capture-
only definitions. Propagate allocation failure from the AudioReach DAI
probe.

Link: geocausa/SP11X1e-audio@31466d6
Link: 22bdec2
Signed-off-by: Leon Silcott <leon@boasi.io>
APR receive processing can hold a service pointer after dropping
svcs_lock, while dynamic port removal used to remove and immediately
free that service. A concurrent callback could therefore use freed
memory.

Give every service a registrar reference and take callback references
while holding svcs_lock. Remove the service from the IDR first, then wait
for admitted callbacks to drain before freeing it. Apply the same unwind
discipline to static service registration failures.

gpr_free_port() may sleep and must run in process context outside the
port's own callback. This avoids self-deadlock while preserving a simple
removal contract.

Signed-off-by: Leon Silcott <leon@boasi.io>
Global AudioReach commands reused token zero and shared one result slot.
Late responses after a timeout could complete a later command or mutate
the wrong mapping handle. Dynamic graph clients could also disappear
while callbacks or command users still held them.

Assign unique tokens to synchronous global and per-client commands while
preserving the graph and position-buffer token fields. Claim replies only
when token and opcode match the active command, and update mapping handles
inside the same critical section.

Publish graph clients under a lifecycle lock, reject new users once
teardown begins, abort pending waits, and drain admitted users and
callbacks before releasing ports. This also corrects the position-buffer
unmap token.

Link: geocausa/SP11X1e-audio@33d5145
Link: geocausa/SP11X1e-audio@39499f0
Link: 22bdec2
Signed-off-by: Leon Silcott <leon@boasi.io>
FullIO v19c topologies add raw module stage classes and data, graph
control links, extended container placement, and integrated-backend
metadata. The 7.2 parser did not retain or emit those fields.

Parse the extended tokens and build matching graph-open payloads without
hard-coded diagnostic or volume instance IDs. Use one checked iterator
for vendor arrays and known raw records, reject truncated, reordered,
duplicate, oversized, or overflowing input before packet allocation, and
preserve the historical no-op for unsupported legacy module extensions.

[Leon: ported the format to 7.2, preserved legacy-topology no-op
behavior, and hardened raw-block bounds, ordering, duplicates, ownership,
and aggregate allocation arithmetic.]

Link: geocausa/SP11X1e-audio@31466d6
Link: geocausa/SP11X1e-audio@7af8f21
Link: 4bcfa10
Link: 22bdec2
Signed-off-by: Leon Silcott <leon@boasi.io>
FullIO protection calibration can exceed the in-band SET_CFG limit, and
its storage belongs to the DSP graph rather than global card state.

Size each graph payload from topology, allocate coherent memory through
the APM DMA device, translate the address for the DSP SID, and map it
with a graph-scoped token. Serialize buffer writes and correlate MAP,
SET_CFG, and UNMAP replies to the exact command before changing mapping
state.

Close the DSP graph before unmapping its OOB buffer. If a reply leaves
ownership ambiguous, retain the coherent memory and device reference
until reboot or a future proven reset hook rather than allowing the DMA
range to be reused.

[Leon: made OOB ownership graph-scoped, keyed reply mutation to the
current command, and retained ambiguous mappings instead of reusing DMA.]

Link: geocausa/SP11X1e-audio@9de3dc9
Link: geocausa/SP11X1e-audio@af28565
Link: geocausa/SP11X1e-audio@1ca3820
Link: geocausa/SP11X1e-audio@31466d6
Link: 22bdec2
Signed-off-by: Leon Silcott <leon@boasi.io>
FullIO v19c describes protected-speaker calibration and runtime stages
in topology. Execute graph calibration and ordered protection or bypass
SET_CFG payloads on the owning graph instead of using global card state
or hard-coded module instance IDs.

Keep configuration, bypass proof, backend readiness, start references,
and faults per graph. Enable this path only for Denali PCM clients and a
topology-declared protected graph; reject partial profiles and mixed
ordinary or protected clients. Start only after protected configuration
or both SP and SPVI bypass commands are confirmed.

Correlate every state transition and make final close consume-on-success.
If execution, close, OOB, or mapping ownership is unconfirmed, block
reuse and retain the complete client, callback context, and DMA ownership
until reboot or a future proven reset hook.

[Leon: limited the runtime to Denali plus a topology-declared protected
graph, made malformed or unconfirmed setup fail closed, serialized
backend/readiness and start references, enforced immutable shared runtime
modes, and quarantined callbacks, clients, and DMA after unconfirmed
teardown.]

Link: geocausa/SP11X1e-audio@db2af54
Link: geocausa/SP11X1e-audio@1ca3820
Link: geocausa/SP11X1e-audio@33d5145
Link: geocausa/SP11X1e-audio@31466d6
Link: geocausa/SP11X1e-audio@7af8f21
Link: 22bdec2
Signed-off-by: Leon Silcott <leon@boasi.io>
Denali speaker protection needs both VI feedback and CPS telemetry before
the protected path can be enabled. Map those backend DAIs to the graph
that owns their topology-declared integrated backend, and publish
readiness as the SoundWire links prepare or tear down.

Keep the mapping and lifecycle limited to microsoft,denali-sndcard.
Require a valid, prepared SoundWire runtime before publishing readiness,
reject readiness transitions while the graph is started, and drain the
matching FE and BE start references symmetrically. Refuse SoundWire
teardown until the graph is known stopped. Other machines and ordinary
graphs keep their existing DAI behavior.

Link: geocausa/SP11X1e-audio@31466d6
Link: geocausa/SP11X1e-audio@7af8f21
Link: 22bdec2
Link: 4f9ac01
Signed-off-by: Leon Silcott <leon@boasi.io>
Describe the optional nominal speaker load used to select board-specific
PA gain and PBR thresholds. An absent property retains the existing
8-ohm defaults.

Link: geocausa/SP11X1e-audio@967b539
Link: 40932bb
Signed-off-by: Leon Silcott <leon@boasi.io>
Read the nominal speaker load from firmware and apply the 2S 4-ohm PA
gain, PBR, class-H, VCM, and UVLO values only when the amplifier also
reports a 2S VPHX supply. Devices without the property retain the current
defaults.

[Leon: Re-lifted the profile onto the current driver, gated it by
qcom,speaker-load-ohms and a fresh hardware-confirmed 2S status, and added
explicit default restoration after failed re-attach reads.]

Link: geocausa/SP11X1e-audio@967b539
Link: 40932bb
Signed-off-by: Leon Silcott <leon@boasi.io>
Have each opted-in WSA884x report a successful, error-free PA
enable to the WSA macro. Enable both protection paths after the
second confirmed PA and disable them before the first PA teardown.

Require protected feedback DAIs to have a live 2S/4-ohm
classification so VI/CPS readiness cannot outrun the PA profile.
Roll back PA and DRE state when an enable write, PA status check,
or macro lookup fails. Keep the counters, lock, and enabled state
in each WSA macro instance so non-protected cards remain unchanged.

[Leon: Replaced the source globals with per-macro state, scoped
lookup to the source card, balanced duplicate/remove events per
amp, made the helper Kconfig-safe, required a confirmed 2S/4-ohm
feedback profile, and withheld the PA event after write or FSM
errors.]

Link: geocausa/SP11X1e-audio@31466d6
Link: e72bffc
Signed-off-by: Leon Silcott <leon@boasi.io>
Describe the WSA8845 VISENSE and CPS feedback links used by the protected
speaker graph. Select them only from the Denali sound card and give that
card a board-specific compatible ahead of the generic X1E80100 fallback.

[Leon: Re-lifted only the common Denali VI/CPS graph and transport data,
added the board-specific compatible, and omitted the experimental board
target.]

Link: geocausa/SP11X1e-audio@31466d6
Link: 6035b3e
Signed-off-by: Leon Silcott <leon@boasi.io>
Describe both integrated WSA8845 speaker loads as 4 ohms so the codec can
select the matching PA profile after confirming the hardware 2S supply.

Link: geocausa/SP11X1e-audio@967b539
Link: 6035b3e
Signed-off-by: Leon Silcott <leon@boasi.io>
ooaklee added a commit to ooaklee/linux_ms_dev_kit-sp11 that referenced this pull request Sep 1, 2026
Integrate jglathe#89 for combined SP11 testing.
The SP11 FullIO topology SAL module declares ten input ports.
AR_MAX_MOD_LINKS bounds the stored output connection arrays, but it
does not bound this module metadata. Rejecting the input count prevents
the sound card from probing with -EINVAL. Keep the output-port array
bound while accepting the valid SAL declaration.

Signed-off-by: Leon Silcott <leon@boasi.io>
ooaklee referenced this pull request in ooaklee/linux_ms_dev_kit-sp11 Sep 2, 2026
@ooaklee

ooaklee commented Sep 2, 2026

Copy link
Copy Markdown
Author

Follow-up validation for the SP11 7.2.2 retrospective:

  • This PR head is now 61c0ef0695da.
  • The follow-up accepts valid AudioReach modules with more than eight input ports while retaining the fixed-array output-port bound. This matches the SP11 FullIO v19c sp11.sal.4001 topology, which declares ten inputs.
  • The combined demonstration target (sp11/ubuntu-qcom-x1e-7.2.y-target, b807d9e52ac9) and retrospective branch (sp11/ubuntu-qcom-x1e-7.2.y-target-fix-pt-2, dd928de48c03) include this change.
  • A clean Lexr container build from the pushed retrospective branch completed successfully as 7.2.2-jg-0sp11v2-qcom-x1e; snd-q6apm.ko.zst and snd-soc-x1e80100.ko.zst are present in the resulting bundle.

The microphone did not need a separate route patch: the reported failure occurs because the whole card aborts topology loading at sp11.sal.4001; the target already retains its TX/VA capture paths. This is build/package validation, so playback and capture still require a physical boot test.

@ooaklee

ooaklee commented Oct 4, 2026

Copy link
Copy Markdown
Author

Withdrawing this older 7.2.2-era submission version without merging while we continue qualification of the repaired 7.2.5 source on the fork. Current source/dependency review is tracked in ooaklee/linux_ms_dev_kit-sp11#57, ooaklee/linux_ms_dev_kit-sp11#58 and the combined candidate ooaklee/linux_ms_dev_kit-sp11#68. These are review vehicles, not an upstream-ready replacement or proof of equivalence to this old PR head.

The current combined source is 8ba2b75713feb5c72bbc11dd8cce4048e23cdeea, ABI 7.2.5-jg-0sp11v8-qcom-x1e; see the experimental v8 release. Ordinary-use results on one X1E/OLED unit are recorded, but the release remains experimental and the detailed hardware, lifecycle, deviation, CI and provenance gates in ooaklee/linux_ms_dev_kit-sp11#68 remain open.

This PR's branch and exact head 61c0ef0695da, authored history, discussion and test evidence are retained unchanged. Closing is administrative supersession, not a merge, an acceptance decision, or a claim that the old and current trees are identical. Beta and the repository default are unchanged.

TX ooaklee/linux_ms_dev_kit-sp11#57 precedes protected playback ooaklee/linux_ms_dev_kit-sp11#58. The maintainer's non-SP11 X1E boot requirement remains necessary before shared audio reaches the release line; an ordinary SP11 test or a representative DTB build does not satisfy it.

Fresh focused upstream submissions will preserve the contributing authors, source links and dependencies after exact combined acceptance and the appropriate shared-driver checks. Fork-only integration scripts/workflows and repository policy will be excluded. PR #79 remains open as the maintainer's coordination/provenance thread.

@ooaklee ooaklee closed this Oct 4, 2026
jglathe pushed a commit that referenced this pull request Oct 9, 2026
[ Upstream commit db82fbe ]

smbdirect_socket_destroy() releases the listener's pending/ready child
sockets while still holding the listener's handler lock, the
&id_priv->handler_mutex taken via rdma_lock_handler(), not
sc->listen.lock, and before the listener's own rdma_destroy_id().
That ordering has one real consequence and one cosmetic one.

The real one: smbdirect_socket_release() drops the child's last
reference, which destroys the child's cm_id.  Doing that before the
listener's rdma_destroy_id() lets _cma_cancel_listens(), running from
the listener's _destroy_id(), walk an already freed child id_priv,
which KASAN catches as a slab-use-after-free during listener shutdown:

[ 4758.909130] BUG: KASAN: slab-use-after-free in __mutex_lock+0x1469/0x1560
[ 4758.911450] Read of size 1 at addr ffff88821c381db4 by task ksmbd.control/1652
[ 4758.913262] Call Trace:
[ 4758.913267]  <TASK>
[ 4758.913299]  __mutex_lock+0x1469/0x1560
[ 4758.913408]  _cma_cancel_listens+0x312/0x3b0
[ 4758.913413]  _destroy_id+0x363/0xee0
[ 4758.913417]  smbdirect_socket_destroy_sync+0x17d5/0x2440
[ 4758.913443]  smbdirect_socket_release+0x124/0x230
[ 4758.913451]  ksmbd_rdma_stop_listening+0x9f/0x190
[ 4758.913457]  ksmbd_conn_transport_destroy+0x65/0x3c0
[ 4758.913463]  kill_server_store+0x1fb/0x2b0
[ 4758.913501]  kernfs_fop_write_iter+0x349/0x4d0
[ 4758.913507]  vfs_write+0x5e7/0xc70
[ 4758.913528]  ksys_write+0x12a/0x210
[ 4758.913541]  do_syscall_64+0x135/0x460
[ 4758.913555]  entry_SYSCALL_64_after_hwframe+0x77/0x7f

The cosmetic one: releasing a child recurses into
smbdirect_socket_destroy(), which takes the child's own
rdma_lock_handler() lock nested under the listener's.  The listener's
and the child's cm_id are always different instances, so this cannot
deadlock for real; the CM core itself nests a new connection id's
handler_mutex under the listening id's in cma_ib_req_handler().  But
lockdep only sees one lock class, reports possible recursive locking,
and then disables itself, hiding real locking bugs for the rest of the
run:

[ 2424.579653] WARNING: possible recursive locking detected
[ 2424.581180] 7.1.0-next-20260623+ #89 Not tainted
[ 2424.582548] --------------------------------------------
[ 2424.584500] ksmbd.control/8854 is trying to acquire lock:
[ 2424.586817] ffff888102303c20 (&id_priv->handler_mutex){+.+.}-{4:4}, at: smbdirect_socket_destroy_sync+0xc39/0x2440
[ 2424.590590]
[ 2424.590590] but task is already holding lock:
[ 2424.591601] ffff888102046c20 (&id_priv->handler_mutex){+.+.}-{4:4}, at: smbdirect_socket_destroy_sync+0xc39/0x2440
[ 2424.594178]
[ 2424.594178] other info that might help us debug this:
[ 2424.596634]  Possible unsafe locking scenario:
[ 2424.596634]
[ 2424.598841]        CPU0
[ 2424.599765]        ----
[ 2424.600695]   lock(&id_priv->handler_mutex);
[ 2424.601836]   lock(&id_priv->handler_mutex);
[ 2424.602590]
[ 2424.602590]  *** DEADLOCK ***
[ 2424.602590]
[ 2424.604512]  May be due to missing lock nesting notation

Splice the pending/ready children onto a local list under the
listener's listen.lock, while the handler lock is held so a concurrent
CM CONNECT_REQUEST cannot add more, but defer the actual
smbdirect_socket_release() calls until after the listener's cm_id has
been destroyed and its handler lock dropped.  The children are
independent sockets whose teardown needs neither the listener's
handler lock nor its cm_id.

Found with ksmbdzzer [2], a KSMBD fuzzer that drives libFuzzer with a
kcov-dataflow [1] coverage vector: it folds each instrumented
comparison/argument's runtime operand value together with its PC (the
default arm mixes them as pc⊕val) so that a new operand value at a known
site counts as new coverage.

[1] https://lwn.net/Articles/1077606/
[2] https://github.com/yskzalloc/kcov-dataflow

Fixes: dc691b9 ("smb: smbdirect: introduce smbdirect_socket_{listen,accept}()")
Signed-off-by: Yunseong Kim <yunseong.kim@est.tech>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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.