You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suspend doesn't seem to work properly. Part of it may be #26, but there may be other remaining issues. This should only be an overall tracking issues, specific problems should be handled in their own issue. The device should at least support S2Idle, hopefully we can also support suspend to ram.
Suspend seems to work (mostly?) fine when I boot the system fully to ram and disable PCIe in the device tree. There are a couple of USB related errors/warnings, so that might also cause problems (could be "only" higher power draw when suspended).
In essence, this looks like PCIe is the main culprit, causing the observed lock-ups and device reboots (maybe caused by an SError).
Adapting steev/linux@9ec798b for sc8180x prevents the PCIe suspend problems. There are still some pciehp timeouts and USB PHY power-state warnings as well as an xHC error. Also, the system takes quite a bit to resume. So there are still some kinks to work out.
prevents the PCIe suspend problems. There are still some pciehp timeouts and USB PHY power-state warnings as well as an xHC error. Also, the system takes quite a bit to resume
Just sent the first version of the series clk: qcom: sc8180x: PM-related fixes that tackles this stuff. It was PCIe/USB recovery slowing down resume, with both having their register state retained the resume is faster than on Windows :)
hopefully we can also support suspend to ram
Not "real" s2ram, that was only introduced on Hamoa (X1E). See this thread.
S2ram is not the important thing you thought it was, anyway :) What actually saves a ton of power is reaching CXPC (CX rail power collapse) state, which can be reached from s2idle. This series fixes the PCIe root controller being the big culprit preventing CXPC, however NVMe needs a bit more work for some reason. And we do need to make sure the rest of the SoC survives CXPC as well :)
Confirming on Surface Pro X SQ2 (7.3.1-1-surface, EL1 boot): with the SC8180X PCIe/USB PWRSTS_RET_ON fixes now in 7.3, s2idle suspend/resume is fast and reliable (~0.9 s suspend, ~1.2 s resume, NVMe PCIe Gen.3 x2 link comes right back up, instant wake via Hall-sensor SW_LID GPIO 121 and pm8941_pwrkey).
On top of stock 7.3.1-1-surface, a few subsystem PM gaps still needed fixes so all peripherals survive suspend/resume cleanly:
drm/msm DPU & DP AUX (0012-drm-msm-sc8180x-dpu-dp-s2idle-resume.patch): call dp_phy_intf_sel from dpu_runtime_resume() so MDP_DP_PHY_INTF_SEL is restored after MDSS_GDSC collapses, clear REG_DP_AUX_TRANS_CTRL on reset, keep DP_DP_HPD_REFTIMER_ENABLE set, and check aux->enable_xfers for external HPD bridges.
spi-hid touchscreen (spi0.0) (0014-hid-spi-hid-add-s2idle-system-pm-ops.patch): spi-hid-core.c currently has no dev_pm_ops, so the unmasked digitizer IRQ fires before spi0 resumes (Failed to receive header: -108 / -ESHUTDOWN) and kills touch. Adding SIMPLE_DEV_PM_OPS (spi_hid_suspend/spi_hid_resume powering down vreg_ts_5p0, pulsing reset for 100 ms, and clearing stale IRQ pending state via irq_set_irqchip_state) fixes it cleanly.
qcom-venus EL1 TZ PM (if using the SQ2 Iris1/HFI4 Venus decoder stack, 0013-media-qcom-venus-sq2-el1-tz-s2idle-pm.patch): HFI PC_PREP + qcom_pas_set_remote_state(0/1, 0) + AXI halt/reset pulse lets venus_gdsc/vcodec0_gdsc/mmcx collapse and restores 4K H.264/HEVC decode on wake without unloading PAS 9.
Userspace hooks:
Stopping hexagonrpcd-sdsp in pre/* (and restarting with --no-block in post/*) prevents SLPI EX:sensor_process:0x1:frpc_dsp faults during userspace freeze.
Stopping iptsd in pre/* and restarting it asynchronously after /sys/bus/spi/devices/spi0.0/ready reports ready keeps touch/stylus working across every cycle.
Launching ModemManager --test-quick-suspend-resume keeps qcom-soc (qrtr0 / rmnet_ipa0) registered across wake.
Matches @valpackett's note on power states: in /sys/kernel/debug/qcom_stats/, Hexagon DSPs (modem, cdsp, slpi_island) enter sleep cleanly during s2idle, while cxsd/aosd counters stay at 0 pending the PCIe/NVMe D3cold work.
Oh wtf, there's a 4000+ line slop patch that enables venus now?! I've tried to get it working, barely managed to not make the init stall rpmh but the arm9 wasn't being kicked on. Interesting. Looks like the firmware requires a lot of extra bullshit compared to sm8150 android phones, oof.
Maybe generic FW would just load in EL2, that'd be a million times better than that nonsense.
SLPI EX:sensor_process:0x1:frpc_dsp faults during userspace freeze
WTF… at least on all the devices I have where sensorspd is in ADSP, it never had any issue with userspace freeze.
Yeah, fair call — 0010 is a straight port of lhf1a/googlebookos_surface_pro_x's out-of-tree research stack to 7.3 (definitely not upstream material as-is; it carries both the EL1 PAS 9 path, an experimental EL2 sq2_no_tz path, and the Windows HFI4/OMX quirks).
In case it's useful if you ever revisit SC8180X Venus/Iris1: the main reasons stock qcom-venus fails to kick the ARM9 on SQ2 (hw_ver 0x5010002f, VIDEO.IR.1.2-00042-PROD-1 / 00079-PROD-2) are:
MMCX / RPMh stall: probing videocc-sm8150 (0xab00000) concurrently with early display coldplug stalls/resets MMCX; deferring it past display bring-up avoids the stall.
ARM9 / CPU CS setup: Iris1 needs venus_iris1_clock_config() + its own venus_sq2_cpu_map() instead of the stock UC_REGION_ADDR/UC_REGION_SIZE write. Under EL1 TZ (PAS 9), the ELF also has to land inside TZ_PIL_GET_MEM_AREA (0x8b700000..0x9ab00000) with qcom_scm_mem_protect_video_var(); under EL2 no-TZ, releasing the ARM9 (base + 0xe3000BIT(4)) needs the 0xe1020..0xe1084 / 0xe2000..0xe2010 / 0xe304c..0xe308c wrapper sequence programmed first.
Agreed 100% that loading generic firmware at EL2 would be way cleaner than fighting Windows HFI4 and EL1 PAS 9's one-shot TZ lifecycle — the EL1 TZ PM hook (qcom_pas_set_remote_state) is just there for stock UEFI/EL1 setups.
On SLPI (EX:sensor_process:0x1:frpc_dsp): that's specifically the Windows qcslpi8180.mbn SLPI (remoteproc@2400000) paired with hexagonrpcd-sdsp (not ADSP sensorspd). Leaving hexagonrpcd-sdsp's FastRPC reverse-RPC session open across systemd-sleep's userspace freeze makes SLPI's sensor_process PD fault and trigger an SSR restart on resume; stopping hexagonrpcd-sdsp right before freeze closes the FastRPC session cleanly and keeps SLPI quiet through s2idle.
Activity
qzed commentedon Jul 14, 2022
Suspend seems to work (mostly?) fine when I boot the system fully to ram and disable PCIe in the device tree. There are a couple of USB related errors/warnings, so that might also cause problems (could be "only" higher power draw when suspended).
In essence, this looks like PCIe is the main culprit, causing the observed lock-ups and device reboots (maybe caused by an SError).
qzed commentedon Aug 5, 2022
Adapting steev/linux@9ec798b for sc8180x prevents the PCIe suspend problems. There are still some pciehp timeouts and USB PHY power-state warnings as well as an xHC error. Also, the system takes quite a bit to resume. So there are still some kinks to work out.
valpackett commentedon Mar 9, 2026
Just sent the first version of the series clk: qcom: sc8180x: PM-related fixes that tackles this stuff. It was PCIe/USB recovery slowing down resume, with both having their register state retained the resume is faster than on Windows :)
Not "real" s2ram, that was only introduced on Hamoa (X1E). See this thread.
S2ram is not the important thing you thought it was, anyway :) What actually saves a ton of power is reaching CXPC (CX rail power collapse) state, which can be reached from s2idle. This series fixes the PCIe root controller being the big culprit preventing CXPC, however NVMe needs a bit more work for some reason. And we do need to make sure the rest of the SoC survives CXPC as well :)
robertijtsma commentedon Nov 20, 2026
Confirming on Surface Pro X SQ2 (
7.3.1-1-surface, EL1 boot): with the SC8180X PCIe/USBPWRSTS_RET_ONfixes now in 7.3,s2idlesuspend/resume is fast and reliable (~0.9 s suspend, ~1.2 s resume, NVMe PCIe Gen.3 x2 link comes right back up, instant wake via Hall-sensorSW_LIDGPIO 121 andpm8941_pwrkey).On top of stock
7.3.1-1-surface, a few subsystem PM gaps still needed fixes so all peripherals survive suspend/resume cleanly:drm/msmDPU & DP AUX (0012-drm-msm-sc8180x-dpu-dp-s2idle-resume.patch): calldp_phy_intf_selfromdpu_runtime_resume()soMDP_DP_PHY_INTF_SELis restored afterMDSS_GDSCcollapses, clearREG_DP_AUX_TRANS_CTRLon reset, keepDP_DP_HPD_REFTIMER_ENABLEset, and checkaux->enable_xfersfor external HPD bridges.spi-hidtouchscreen (spi0.0) (0014-hid-spi-hid-add-s2idle-system-pm-ops.patch):spi-hid-core.ccurrently has nodev_pm_ops, so the unmasked digitizer IRQ fires beforespi0resumes (Failed to receive header: -108/-ESHUTDOWN) and kills touch. AddingSIMPLE_DEV_PM_OPS(spi_hid_suspend/spi_hid_resumepowering downvreg_ts_5p0, pulsing reset for 100 ms, and clearing stale IRQ pending state viairq_set_irqchip_state) fixes it cleanly.qcom-venusEL1 TZ PM (if using the SQ2 Iris1/HFI4 Venus decoder stack,0013-media-qcom-venus-sq2-el1-tz-s2idle-pm.patch):HFI PC_PREP+qcom_pas_set_remote_state(0/1, 0)+ AXI halt/reset pulse letsvenus_gdsc/vcodec0_gdsc/mmcxcollapse and restores 4K H.264/HEVC decode on wake without unloading PAS 9.hexagonrpcd-sdspinpre/*(and restarting with--no-blockinpost/*) prevents SLPIEX:sensor_process:0x1:frpc_dspfaults during userspace freeze.iptsdinpre/*and restarting it asynchronously after/sys/bus/spi/devices/spi0.0/readyreportsreadykeeps touch/stylus working across every cycle.ModemManager --test-quick-suspend-resumekeepsqcom-soc(qrtr0/rmnet_ipa0) registered across wake.Matches @valpackett's note on power states: in
/sys/kernel/debug/qcom_stats/, Hexagon DSPs (modem,cdsp,slpi_island) enter sleep cleanly durings2idle, whilecxsd/aosdcounters stay at0pending the PCIe/NVMe D3cold work.Full notes and
systemd/system-sleep/hooks are documented here:docs/S2IDLE_SUSPEND.md(v1.5.0).valpackett commentedon Nov 21, 2026
Oh wtf, there's a 4000+ line slop patch that enables venus now?! I've tried to get it working, barely managed to not make the init stall rpmh but the arm9 wasn't being kicked on. Interesting. Looks like the firmware requires a lot of extra bullshit compared to sm8150 android phones, oof.
Maybe generic FW would just load in EL2, that'd be a million times better than that nonsense.
WTF… at least on all the devices I have where sensorspd is in ADSP, it never had any issue with userspace freeze.
robertijtsma commentedon Nov 21, 2026
Yeah, fair call —
0010is a straight port oflhf1a/googlebookos_surface_pro_x's out-of-tree research stack to 7.3 (definitely not upstream material as-is; it carries both the EL1 PAS 9 path, an experimental EL2sq2_no_tzpath, and the Windows HFI4/OMX quirks).In case it's useful if you ever revisit SC8180X Venus/Iris1: the main reasons stock
qcom-venusfails to kick the ARM9 on SQ2 (hw_ver 0x5010002f,VIDEO.IR.1.2-00042-PROD-1/00079-PROD-2) are:videocc-sm8150(0xab00000) concurrently with early display coldplug stalls/resets MMCX; deferring it past display bring-up avoids the stall.venus_iris1_clock_config()+ its ownvenus_sq2_cpu_map()instead of the stockUC_REGION_ADDR/UC_REGION_SIZEwrite. Under EL1 TZ (PAS 9), the ELF also has to land insideTZ_PIL_GET_MEM_AREA(0x8b700000..0x9ab00000) withqcom_scm_mem_protect_video_var(); under EL2 no-TZ, releasing the ARM9 (base + 0xe3000BIT(4)) needs the0xe1020..0xe1084/0xe2000..0xe2010/0xe304c..0xe308cwrapper sequence programmed first.Agreed 100% that loading generic firmware at EL2 would be way cleaner than fighting Windows HFI4 and EL1 PAS 9's one-shot TZ lifecycle — the EL1 TZ PM hook (
qcom_pas_set_remote_state) is just there for stock UEFI/EL1 setups.On SLPI (
EX:sensor_process:0x1:frpc_dsp): that's specifically the Windowsqcslpi8180.mbnSLPI (remoteproc@2400000) paired withhexagonrpcd-sdsp(not ADSPsensorspd). Leavinghexagonrpcd-sdsp's FastRPC reverse-RPC session open acrosssystemd-sleep's userspace freeze makes SLPI'ssensor_processPD fault and trigger an SSR restart on resume; stoppinghexagonrpcd-sdspright before freeze closes the FastRPC session cleanly and keeps SLPI quiet throughs2idle.