Skip to content

device/husky: a GNSS bring-up plan before the overlay - #739

Merged
derekross merged 3 commits into
derekross:mainfrom
Somnius:husky-gnss-plan-1113
Nov 15, 2026
Merged

derekross merged 3 commits into
derekross:mainfrom
Somnius:husky-gnss-plan-1113

Conversation

@Somnius

@Somnius Somnius commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

@derekross, the runbook you asked for on linux-omarchy-mobile#239 before the bring-up overlay, as device/husky/GNSS-PLAN.md. It is documentation only and nothing in it has run: I have no record that the chip has ever been powered.

What's in it: where the bus clocks (linux-omarchy-mobile#210), the rails (#211) and the receiver node (#239) stand, your three optional notes for the overlay and the first-boot rules in the order you wrote them (num-cs, usi3_hsi0 and pmic-2 next to spi21, swap-mode and dma-mode, load the driver before reading the chip, the usual first-boot rules), the gates for every boot, five stages with one change per boot (plain, bus, a late sec_acpm load, rails, receiver, each on top of the one before), what stops a stage, the revert, and what only the phone can settle.

The gates are strict on purpose: slot B's retry count read in the bootloader and refilled with set_active b alone, a boot only at 3; the phone not warmer than 50 C before a boot; the driver blacklisted until the last stage, and sec_acpm blacklisted from the third stage on and loaded by hand after 60 s of uptime; nothing that opens /dev/ttyBCM or writes nstandby, and a check on the first boot that no userspace like lhd is installed. The last stage repeats the late sec_acpm load and the rail reads before the one modprobe of the driver.

I wrote it against the kernel as it is on omamobile and your comments on #239. Two reviews caught problems in my first versions, which are fixed in the pushed commits: the controller is not called spi21 in sysfs, so the plan identifies it by address; the revert refills slot B before each boot; the late sec_acpm load is a stage of its own; and parts of my old runbook that I had dropped (the userspace check, the modprobe file staying in the shared rootfs) are back. Things I could not check from here are marked [I] or [U] in the file. The ROADMAP row for GNSS now says the three kernel changes are merged. tools/pr-check passes. The overlay itself comes after you've read this.

The runbook @derekross asked for on kernel derekross#239 before the bring-up overlay:
the state of the bus clocks, the rails and the node, his five points for the
overlay in his own order, the gates for every boot (retry count, heat, modules,
nothing that powers the chip), four stages with one change per boot (plain,
bus, rails, receiver, each on top of the one before), the stop rules, the
revert and what only the phone settles. The ROADMAP row now says the three
kernel changes are merged. Documentation only; nothing of it has run.
The controller is not called spi21 in sysfs: identify it by address. The
revert refills slot B with set_active b and reads 3 before each boot and says
where the phone is left. A live kernel log and the model check join the gates;
klog.dtso is described completely and not used. num-cs belongs to the bus
stage. The late sec_acpm load is its own stage so no stage changes two things.
The debugfs ban covers anything under /sys/kernel/debug once the driver is
loaded, and sspmcureq joins the never-write list. Derek's notes are worded as
his three optional notes and the first-boot rules. The ROADMAP row no longer
lists the pin controllers and the node as missing.
@derekross

Copy link
Copy Markdown
Owner

Thank you, Lef. This is a thorough plan and it follows my notes on linux-omarchy-mobile#239 closely: the driver blacklisted before the DTB, a log stream first, one change per boot, slot B read at 3 before every boot, nothing that opens /dev/ttyBCM or writes nstandby, and the userspace check before the driver ever loads. I checked it against the published tree: the gnss@0 node, the driver's sysfs and debugfs files and the module name are as you describe, and the ROADMAP row is right.

Two things don't hold on the kernel the plan will run on, and I'd like them fixed before I merge it:

  1. sec_acpm is built in. kernel/configs/omamobile.config has CONFIG_MFD_SEC_ACPM=y since kernel config: the Pixel 9a's USB at boot, battery and charger, camera regulator, Wi-Fi host and speaker amplifiers #227 (the 9a's USB PHY needs its PMIC rails at boot), and defconfig builds the S2MPS11 regulator driver in. So blacklist sec_acpm does nothing, lsmod never lists it, modprobe sec_acpm is a no-op, and stage 3 would pass without testing anything. With pmic-2 enabled in stage 4, the GNSS rails register at boot and the regulator core's 30 s cleanup turns off any of them the bootloader left on, so the vdd_gnss_*: disabling stop would fire on a correct boot. The 7 Pro is the same (the AGENTS gotcha on unused rails), and there it's harmless because LDO9S to LDO11S feed only GNSS; your board file says the same of husky's three. Could you drop stage 3 and the sec_acpm blacklist, read the three rails in stage 4 before 30 s of uptime and again after, and record a disabling line as the answer to "what the bootloader leaves" rather than as a stop?
  2. The watchdog. The plan says the watchdog you have is the 190 s uptime rule, but that's a stop, not a reset: on husky the watchdog driver stops the bootloader's watchdogs, so a hang that doesn't panic lasts until the buttons. You have two pieces already. The published bootargs turn lockups and RCU stalls into panics with panic=10, and tools/husky-deadman-phone arms /dev/watchdog0 with a feeder on this phone (its wd-drill, which stops feeding it on purpose, reset a Pixel 8a in 26 s in akita's test 43). For stages 2, 4 and 5, please arm the watchdog with a feeder before the first command, stop it cleanly after the reads, and say in the gates what covers a hang (the panics, the watchdog) and what doesn't (a freeze of every CPU, which only the buttons undo).

Smaller things, none blocking:

  • clk_ignore_unused and pd_ignore_unused are already in husky's published bootargs, so stage 2's clk_summary read can't tell whether the USI3 clocks are on because the controller enabled them; the probe and a first transfer are the proof there. The same fact removes one of your reasons for leaving out klog.dtso.
  • A few of your [I]s are settled by the tree: the controller is spi@111e0000 (reg = <0x111e0000 0xc0>, with usi3_hsi0 at 111e00c0), and the S2MPG15 chip ID is 0x0b with the GNSS LDO controls at 0x37 to 0x39 (include/linux/mfd/samsung/s2mpg15.h).
  • Your worry about reading a regmap registers file: drivers/mfd/sec-acpm.c gives the S2MPG15 maps read tables with only the chip ID and seven LDO control registers, uncached, so the file reads those and nothing that clears on read.
  • Husky packs no modules into its initramfs, which answers the stage 1 [U].

With those two changes I'll merge the plan, and then the overlay can come.

…om the tree

The late sec_acpm stage and its blacklist are gone: the shared kernel builds
the driver in, so they tested nothing. The rails stage reads the three GNSS
rails before and after the regulator cleanup and records a disabling line as
what the bootloader left. Stages 2 to 4 arm /dev/watchdog0 with
tools/husky-deadman first, and each says what covers a hang and what does not.
The controller address, the S2MPG15 registers, the regmap read tables and the
initramfs are now read from the tree.

Signed-off-by: Lef <me@lefteros.com>
@Somnius

Somnius commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @derekross, you're right on both and it's in the new commit on the branch.

You're right about sec_acpm: it's =y in omamobile.config, so the late-load stage and the blacklist did nothing. I dropped that stage and the blacklist. The rails stage (now stage 3) reads the three vdd_gnss_* rails in one ssh line before 30 s of uptime and again after the cleanup, and a disabling line now counts as the answer to what the bootloader leaves, not as a stop. The old stages 4 and 5 are 3 and 4, and the plan says so.

Watchdog: stages 2 to 4 arm husky-deadman noop with its feeder before the first command, and each gate says what covers a hang (the panic=10 bootargs and the feeder) and what doesn't (every CPU frozen, or the boot before it is armed, which only the buttons undo). The tool has no stop command, so I wait for its soak to end and for watchdog: disarmed. One exception I should flag: stage 3's first read happens before the watchdog can be armed, because arming takes longer than the time before the 30 s cleanup, so only the panics cover that read. If you'd rather arm first, that read would come from the kernel log's disabling lines alone.

The small ones are done too: clk_ignore_unused and pd_ignore_unused are in the bootargs, so stage 2's proof is the probe, and I dropped the klog.dtso reason that rested on it. The controller is spi@111e0000, the S2MPG15 chip ID register is 0x0b with the LDO controls at 0x37 to 0x39, and the regmap read tables hold only the chip ID and seven LDO controls, so reading them clears nothing. Husky packs no modules into its initramfs. I also fixed the roadmap row that still said the PMIC modules load late.

Not verified: how long the watchdog takes to reset this phone (the 26 s from the 8a isn't in our tree and I haven't measured it on husky), whether noop's checks pass on these images, and whether ssh answers before 30 s. I haven't run any of this plan on the phone.

@derekross

Copy link
Copy Markdown
Owner

Thank you, Lef. Both points are in, and better than I asked. Stage 1 now checks modules.builtin for sec-acpm instead of trusting lsmod, the rails stage reads before and after the cleanup, and every stage says what covers a hang and what doesn't. I read husky-deadman-phone to check the watchdog part. noop applies nothing and its undo writes nothing, the soak ends with the magic close and soaked, and a trip disarms the watchdog without a reset. So waiting for soaked before the reboot is the right way to stop it.

On your question about stage 3's first read: keep it as you have it. That read goes through the same ACPM path as the reads you repeat under the watchdog a few seconds later, and the PMIC's own probe at boot is unguarded either way. The panics cover it, and you say so in the gate.

One practical thing for the first session, not for this PR to wait on: noop checks more than your list. It refuses when the battery is outside 30-80 % (--allow-soc lifts only that), when the voltage is above 4.15 V, or when the battery temperature is outside 10-40 C, and its guard trips above 4.3 V. On the 8a it tripped straight away on the cable, at 4.3125 V against the bootloader's 4.35 V float (akita's BRINGUP-M4, test 43). The 26 s reset after wd-drill is recorded in that same test, so it is in the tree after all. A phone that charged overnight will probably get refused before stage 2. Your rules make that a stop, so it's safe, but starting between 30 and 80 % would save you a trip. A line in the gates would help whoever runs it next.

I'm merging the plan. The overlay can come next.

@derekross
derekross merged commit 7808d28 into derekross:main Nov 15, 2026
2 checks passed
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