Skip to content

FROMLIST: soundwire: qcom: switch system sleep to the guarded v2 callbacks - #1593

Open
Gopi Chandra Sekhar Reddy Kanala (gkanala-qc) wants to merge 1 commit into
qualcomm-linux:qcom-7.3from
gkanala-qc:swr-system-sleep-v2-qcom-7.3
Open

Gopi Chandra Sekhar Reddy Kanala (gkanala-qc) wants to merge 1 commit into
qualcomm-linux:qcom-7.3from
gkanala-qc:swr-system-sleep-v2-qcom-7.3

Conversation

@gkanala-qc

Move the SoundWire controller system sleep callbacks to v2 of the upstream
series, replacing the unconditional forced suspend.

swrm_suspend() now skips the controller if it is already runtime suspended,
if the bus does not support clock stop, or if a stream is set up; otherwise
it forces runtime suspend, and swrm_resume() undoes only that. A lane
provider is forced only if its consumer was.

Tested on Glymur CRD (s2idle): controller held active, suspend right after
playback, suspend during playback, and suspend while idle.

CRs-fixed: 4762865

…backs

The system sleep callbacks were pm_runtime_force_suspend() and
pm_runtime_force_resume(), which run the runtime suspend path on every
controller that is runtime active when system suspend starts. That path
is only safe in the state runtime PM itself suspends the controller in,
with the peripherals suspended and no stream set up:

 - A set up stream stays prepared and enabled across system sleep, and
   nothing programs its ports again on resume. With the forced suspend,
   playback that was running when s2idle was entered stayed silent
   after resume on Glymur CRD.

 - Without clock stop, runtime resume resets the bus and only
   re-initializes the peripherals it saw detach, which peripherals that
   were never runtime suspended have not done.

 - A controller that was already runtime suspended had runtime PM
   disabled from the suspend phase on, instead of from suspend_late as
   the PM core does, which makes the window in which the wake IRQ
   handler cannot resume it longer.

Replace them with swrm_suspend() and swrm_resume(). swrm_suspend() leaves
the controller alone if it is already runtime suspended, if the bus does
not support clock stop, or if a stream is set up. Otherwise it forces the
controller into runtime suspend and records that in sleep_forced, and
swrm_resume() only undoes a forced suspend. A controller that is left
running keeps its bus clock and hclk on across system sleep, as before
the forced suspend was added.

A lane provider has no bus of its own: probe returns before
sdw_bus_master_add(), so bus.bus_lock and bus.m_rt_list are not
initialized. Its consumer is suspended before it through the device
link, so only force the provider into runtime suspend if the consumer
was.

While at it, move to SYSTEM_SLEEP_PM_OPS(), RUNTIME_PM_OPS() and
pm_ptr(), and drop the __maybe_unused annotations.

Signed-off-by: Gopi Chandra Sekhar Reddy Kanala <gopi.kanala@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20261130-qcom-swr-system-sleep-v2-2-4f65a868813d@oss.qualcomm.com/
@qcomlnxci

Copy link
Copy Markdown

Test results

Workflow run: 46425942415 attempt 1

Known failures configured: 0

Target Pass Non-pass Total
kbdev-glymur-crd-multimedia 32 9 41

Test Matrix

Test Case kbdev-glymur-crd-multimedia
LAVA result ✅ Results
Audio_Card_Registration ✅ Pass
BT_FW_KMD_Service ✅ Pass
BT_ON_OFF ✅ Pass
BT_SCAN ✅ Pass
CPUFreq_Validation ✅ Pass
CPU_affinity ✅ Pass
DSP_AudioPD ⚠️ skip
Ethernet_Basic_Validation ⚠️ skip
Ethernet_Inventory_Validation ⚠️ skip
FastRPC_Runtime_Validation ❌ Fail
Freq_Scaling ✅ Pass
GIC ✅ Pass
IPA ✅ Pass
Interrupts ✅ Pass
KVM_Driver ✅ Pass
KVM_EL2_DTB ✅ Pass
KVM_Infra ✅ Pass
KVM_Runtime_Validation ✅ Pass
OpenCV ✅ Pass
PCIe ✅ Pass
Probe_Failure_Check ❌ Fail
RMNET ✅ Pass
Reboot_health_check ✅ Pass
UFS_Validation ⚠️ skip
USBHost ✅ Pass
WiFi_Firmware_Driver ✅ Pass
WiFi_OnOff ✅ Pass
adsp_remoteproc ✅ Pass
cdsp_remoteproc ✅ Pass
gpdsp_remoteproc ⚠️ skip
hotplug ✅ Pass
irq ✅ Pass
kaslr ❌ Fail
pinctrl ✅ Pass
qcom_hwrng ✅ Pass
remoteproc ❌ Fail
rngtest ✅ Pass
shmbridge ✅ Pass
smmu ✅ Pass
watchdog ✅ Pass
wpss_remoteproc ✅ Pass
Failure summary

Unexpected failures

  • kbdev-glymur-crd-multimedia: gpdsp_remoteproc => skip.
  • kbdev-glymur-crd-multimedia: kaslr => fail.
  • kbdev-glymur-crd-multimedia: remoteproc => fail.
  • kbdev-glymur-crd-multimedia: Probe_Failure_Check => fail.
  • kbdev-glymur-crd-multimedia: UFS_Validation => skip.
  • kbdev-glymur-crd-multimedia: Ethernet_Inventory_Validation => skip.
  • kbdev-glymur-crd-multimedia: Ethernet_Basic_Validation => skip.
  • kbdev-glymur-crd-multimedia: FastRPC_Runtime_Validation => fail.
  • kbdev-glymur-crd-multimedia: DSP_AudioPD => skip.

Result: blocked because unexpected failures were found.

@qlijarvis

Copy link
Copy Markdown

LAVA Failed Case Triage Summary

PR: #1593

Job 302890 | SoC glymur-qli-crd

LAVA job: https://lava-oss.qualcomm.com/scheduler/job/302890

Failed test cases in LAVA job 302890 (SoC: glymur-qli-crd).

  Case 1: ** kaslr
  1. Failed case: ** kaslr
  2. Root cause: ** The kernel was built with CONFIG_RANDOMIZE_BASE=n (KASLR disabled), but the LAVA test suite expects CONFIG_RANDOMIZE_BASE=y to validate kernel address space layout randomization security feature. This is a test environment configuration mismatch, not a kernel functional bug.
  3. Possible fix: Enable KASLR in the kernel build configuration by setting CONFIG_RANDOMIZE_BASE=y in the defconfig or Qualcomm-specific config fragment (e.g., arch/arm64/configs/qcom.config) used for glymur-qli-crd builds, then rebuild and reflash the kernel. Alternatively, if KASLR is intentionally disabled for this build variant, update the test suite to skip (not fail) the kaslr test when CONFIG_RANDOMIZE_BASE=n is detected.
  4. Detail analysis attachment: failed_case_job302890_1_detailed.md
  Case 2: remoteproc
  1. Failed case: remoteproc
  2. Root cause: Could not be determined confidently from available logs.
  3. Possible fix: Add the optional "qcom,shutdown-state" property to the soccp remoteproc device tree node (d00000.remoteproc) in the Glymur DTS. The property should specify the SMEM state used for graceful shutdown signaling. Reference upstream qcom_q6v5_pas driver documentation and existing DT examples for adsp/cdsp nodes. If the property is intentionally omitted for soccp (because it is always-on and does not support graceful shutdown), update the driver to suppress the error message for attached remoteprocs, or update the test framework to exclude this specific error pattern from failure classification.
  4. Detail analysis attachment: failed_case_job302890_2_detailed.md
  Case 3: ** Probe_Failure_Check — Audio Codec Register Access Failure
  1. Failed case: ** Probe_Failure_Check — Audio Codec Register Access Failure
  2. Root cause: ** The PR introduces new system sleep callbacks (swrm_suspend/swrm_resume) for the Qualcomm SoundWire controller that conditionally force runtime suspend based on stream state and clock-stop support. During boot-time audio subsystem initialization on glymur-crd, the wsa_macro audio codec drivers (6c90000.codec and 6cb0000.codec) attempt to access hardware registers (0x5dc) but receive -EIO errors because the underlying SoundWire controller (6a80000.soundwire) is in an unexpected power/link state ("link status not disconnected"), preventing register I/O from completing successfully.
  3. Possible fix: Revert the PR or add explicit runtime PM state validation in swrm_suspend() to ensure the controller is not forced into suspend when dependent audio codec components are actively probing. Specifically, check if any child devices on the SoundWire bus are in the middle of probe before calling pm_runtime_force_suspend(), or defer the new sleep logic until after all audio subsystem components have completed initial probe and card registration.
  4. Detail analysis attachment: failed_case_job302890_3_detailed.md
  Case 4: FastRPC_Runtime_Validation
  1. Failed case: FastRPC_Runtime_Validation
  2. Root cause: Could not be determined confidently from available logs.
  3. Possible fix: Add the optional qcom,shutdown-state property to the ADSP remoteproc device tree node in arch/arm64/boot/dts/qcom/glymur.dtsi to suppress the warning. Alternatively, update the FastRPC_Runtime_Validation test to exclude this specific non-fatal warning from its error detection logic, as the ADSP subsystem functions correctly (all FastRPC endpoints are accessible and QRTR services are operational).
  4. Detail analysis attachment: failed_case_job302890_4_detailed.md

@mohsRafi mohsRafi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

5 participants