Skip to content

scsi: ufs: exynos: power the gs101 device down in system suspend too - #188

Merged
derekross merged 1 commit into
derekross:omamobilefrom
robotosaith:omamobile-gs101-ufs-spm
Nov 4, 2026
Merged

derekross merged 1 commit into
derekross:omamobilefrom
robotosaith:omamobile-gs101-ufs-spm

Conversation

@robotosaith

Copy link
Copy Markdown
Contributor

gs101_ufs_suspend() asserts the UFS device reset on gs101 exactly as on gs201 (gs201 shares it), but only gs201's init raises spm_lvl to 5. On a Pixel 6 Pro at the core's default level 3, every s2idle resume fails its first Hibern8 exit and the error handler resets the host before the link comes back.

The change: the spm_lvl = UFS_PM_LVL_5 assignment (and its comment) moves from gs201_ufs_drv_init() into gs101_ufs_drv_init(), which gs201's init only wrapped, and gs201_ufs_drvs.drv_init points at gs101_ufs_drv_init directly. The Pixel 7 Pro still gets level 5 from the same assignment, in the same init, before the link comes up: nothing changes for gs201. zuma and zumapro are untouched.

Tested on raven (Pixel 6 Pro), the same test kernel with and without this commit (omamobile + #116 + raven's NOT FOR MERGE USB override), three systemctl suspend cycles each, woken by Power:

without (gb0a658e17f21) with (g1094d975a193)
spm_lvl at boot 3 5
resumes 3 of 3 3 of 3
UFS errors hibern8 exit failed. ret = 5, host_reset: total cnt=2, register dumps none
I/O errors 0 0

The dme-set: attr-id 0x4021 ... failed 0 retries line after each resume is there in both and is already known to tools/phone-smoke.

Checks: tools/kernel-pr-check --build --merge origin/omamobile in the project container: merges cleanly, checkpatch --strict clean, W=1 build of ufs-exynos.c clean, no device trees touched.

Not tested: cheetah on this branch (the assignment it runs is the same one, now reached through gs101_ufs_drv_init()).

🤖 Generated with Claude Code

gs101_ufs_suspend() asserts the device reset on gs101 as it does on
gs201, which shares that function, but only gs201's init raised spm_lvl
to 5. On a Pixel 6 Pro (gs101) at the core's default level 3 every
s2idle resume failed its first Hibern8 exit and the error handler reset
the host twice before the link came back (three Power-woken cycles on
2026-11-03: "ufshcd_uic_hibern8_exit: hibern8 exit failed. ret = 5",
"host_reset: total cnt=2", then FAST series_B G4 L2 again, no I/O
errors). At level 5 the same phone resumes through a full re-init with
no error-handler pass.

Set the level in gs101_ufs_drv_init(), which gs201's init only wrapped,
and use it for gs201 directly: gs201 still gets level 5 from the same
assignment, so the Pixel 7 Pro is unchanged.

Assisted-by: Claude Opus 5.5
Signed-off-by: saiththerobo <the.tom.sharp@gmail.com>
@derekross

Copy link
Copy Markdown
Owner

Thank you, @robotosaith. This is a tidy fix, and the with/without table on raven is exactly the kind of evidence
I like: same kernel, one commit apart, three Power-woken cycles each, and the error-handler passes gone.

I checked the Pixel 7 Pro side. I built ufs-exynos.o at the base and with your commit, with the same config, and
compared it function by function. Apart from the removed wrapper, only gs101_ufs_drv_init changes. For gs201 it
runs the same instructions the wrapper and the inlined gs101 init ran before, with the spm_lvl = 5 store moved a
few instructions later, still before the ACG write and the shareability setup. For gs101 it gains that one store.
So the 7 Pro is unchanged, as you said. Our gate passes on today's omamobile (clean merge, sign-off, checkpatch
--strict and W=1 clean), and CI is green.

One small thing before I merge: could you add a tools/phone-smoke report from the boot with this commit, with
its full uname -r? The kernel behind it isn't published (it also has #116 and the USB override), so the blob id
of drivers/ufs/host/ufs-exynos.c in that tree would also help (git rev-parse HEAD:drivers/ufs/host/ufs-exynos.c;
this head's is 4eadca2fe3ba). Optionally, one line in the message saying the Pixel 6 (oriole) shares this data
and wasn't tested.

Thanks also for tracing the UFS errors in #116's smoke report back to this.

@robotosaith

Copy link
Copy Markdown
Contributor Author

Thanks for comparing the object code on the 7 Pro. A boot of the tested tree today:

  • uname -r: 7.3.0-rc6-omamobile-push1-g1094d975a193, the published omamobile plus drm: google: add the Pixel 6 Pro's display (gs101 DECON and DSIM, S6E3HC3 panel) #116, raven's NOT FOR MERGE USB peripheral override and this commit (1094d975a), the same build as the with/without table.
  • git rev-parse HEAD:drivers/ufs/host/ufs-exynos.c in that tree: 4eadca2fe3ba, the same as this head's.
  • spm_lvl reads 5, and the boot has no UFS error-handler passes or host resets.
phone-smoke

phone-smoke: raven

Kernel 7.3.0-rc6-omamobile-push1-g1094d975a193, tools at 0d328a02, 2026-11-04T07:54Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-g1094d975a193, slot b, up 66s
storage guard (required) ok 49 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 97G free
kernel health (required) ok no oops or BUG; 0 WARN, 19 error lines in dmesg (14 known, 5 new)
new dmesg errors not ok OF: reserved mem: OVERLAP DETECTED! x1; N N: probe with driver N failed with error N x1; N N: error -ENOENT: no N x1
systemd units not ok failed: omamobile-modem.service
USB gadget (required) ok bound to 11110000.usb
display ok card2-DSI-1 connected, 1440x3120
GPU ok render node on panfrost
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked true)
touch ok s6sy761
buttons ok gpio-keys
Wi-Fi skip no wireless interface
Bluetooth ok hci0, powered true
battery ok 88% Discharging, 22 °C
sound cards skip none
sensors skip no sensor proxy
cameras skip no libcamera tools
thermal ok hottest zone 45 °C

Packages: hyprland 0.57.0-3.1, libcamera 0.7.2-4.22, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamessages 0.2.1-1, omamobile-apps 0.2.2-1, omamobile-audio 0.5.15-1, omamobile-device-raven 0.1.32-1, omamobile-firstboot 0.1.3-1, omamobile-gnss 0.2.7-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-mmd 0.1.2-1, omamobile-modem 0.1.17-1, omamobile-modem-sit 0.3.30-1, omamobile-omarchy 0.1.31-1, omamobile-owl-widgets 0.1.2-1, omamobile-sensors 0.2.1-1, omamobile-shell 0.2.94-1, omamobile-voice 0.1.0-1, omaphone 0.2.2-1, omarchy 4.0.6-1, omatel-agent 0.2.4-2, quickshell 0.3.2.r7.g2b4501a-1

The three flags are this test kernel's, not the commit's: the published branch's reserved-memory overlap line, cs40l25-vibra looking for a calibration firmware name this phone doesn't have, and omamobile-modem failing because this kernel has no CPIF.

On oriole: it shares gs101_ufs_drvs and wasn't tested. I've left the commit as it is so the sign-off stays; if you'd like the line in the message, please add it at merge, or tell me and I'll send a re-signed amend.

@derekross
derekross merged commit fb5d682 into derekross:omamobile Nov 4, 2026
1 check passed
@robotosaith
robotosaith deleted the omamobile-gs101-ufs-spm branch November 5, 2026 07:32
@derekross

Copy link
Copy Markdown
Owner

Thank you, @robotosaith. The smoke report, the release and the blob id are what I needed, and I confirmed the blob
against your test branch. Leaving the message as it is is fine. Merged.

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.

2 participants