Skip to content

omamobile-device-husky 0.1.4: the USB replug rescue and the MAX77759 blocklist - #250

Closed
Somnius wants to merge 1 commit into
derekross:mainfrom
Somnius:husky-usb-rescue
Closed

Somnius wants to merge 1 commit into
derekross:mainfrom
Somnius:husky-usb-rescue

Conversation

@Somnius

@Somnius Somnius commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Unplug the cable and plug it back in and the 8 Pro never comes back on the USB link until it is rebooted. The package README already says "a replug may need a reboot". I looked at why: the kernel log shows nothing at the unplug, and the MAX77759's Type-C side opens its USB2 data switch (TCPC 0x25, vendor register 0x93, 0x09 closed and 0x00 open) with nothing to close it again until the bootloader runs at the next boot. Cheetah and raven already ship omamobile-usb-rescue for this and husky has none, so this adds it on husky's bus (10cb0000.i2c, hsi2c_11). While VBUS is valid (CHG_DETAILS_00.CHGIN_DTLS == 3) it writes 0x09 to 0x25:0x93 when the switch isn't 0x09, it writes that one register only, it logs every change of the switch, VBUS and the UDC state to the journal, and it stands aside once a Type-C driver owns 0x25. It needs i2c-tools. Without the bus (the base DT keeps it disabled) it says so and exits, so the unit does nothing until the bring-up overlay of kernel #163 enables hsi2c_11.

It also adds the MAX77759 blocklist @derekross asked for on kernel #163: binding the PMIC creates its charger, GPIO and NVMEM cells, and the charger driver programs charge limits from the battery node, so max77759_charger, gpio_max77759, nvmem_max77759 and tcpci_maxim must not autoload before their steps. Blacklist only (a manual modprobe still works), plus max77759_charger on top of the Pixel 7 Pro's list; the fuel gauge and the MFD core still autoload. The package test's rule "modprobe.d only sets options" now has this one file as an exception, and the test checks what the file contains.

Related: kernel #163 (the bus), and the bring-up PR (#249) with the runbook and results.

Device and build

Checks (no phone needed)

  • tools/pr-check origin/main passes
  • tests/all passes
  • tests/packages: omamobile-device-husky's test/all passes. The run over every package fails in omamobile-mmd, omamobile-sensors and omamobile-shell on my desktop only because python dbus and gi are not installed here, none of them touched by this change
  • Each changed package has its version bumped, and the new version is in the commit subject
  • Commits have area prefixes and bodies that say why; any AI help is a Co-Authored-By: or Assisted-by: trailer, never a Signed-off-by:

On the phone

  • I ran this on my own phone, booted into this build: the script and the unit by hand from the files in this PR (not installed as a package yet), on the kernel above
  • Runbook steps passed: unplug at 11:37:08 (usbsw=0x00 vbus=0), replug at 11:37:26 (vbus=1), the service wrote 0x09 and the desktop had the link back at 11:37:28 with no reboot (uptime 587 s); the same with the cable moved to a wall charger and back; it also came up by itself after a reboot
  • What I did not test: installing the package with pacman (I used the files directly); a phone without the bring-up overlay, where the bus doesn't exist and the script is meant to just exit; the blocklist file from /usr/lib/modprobe.d (my phone has its own copy in /etc, which does the same job)
  • Nothing in this change writes outside slot B and userdata or weakens the storage guard. It does read two registers and write one on the external MAX77759 over I2C with i2cget/i2cset (not the SoC's PMU, no devmem), the same as cheetah's and raven's rescue, so the last box is ticked with that said out loud (AGENTS.md §1)
tools/phone-smoke report

phone-smoke: husky

Kernel 7.3.0-rc6-omamobile-push1-gc7a0b2ef2f66-dirty, tools at bb11919, 2026-11-01T11:15Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-gc7a0b2ef2f66-dirty, slot b, up 3292s
storage guard (required) ok 62 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 215G free
kernel health (required) ok no oops or BUG; 0 WARN, 0 error lines in dmesg
systemd units ok none failed
USB gadget (required) ok bound to 11210000.usb
display ok card0-Unknown-1 connected, 1344x2992
GPU not ok no render node
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked true)
touch ok SALIXP Touchscreen
buttons ok gpio-keys
Wi-Fi skip no wireless interface
Bluetooth skip no controller
battery ok 75% Discharging, 33 °C
sound cards skip none
sensors skip no sensor proxy
cameras skip no libcamera tools
thermal ok hottest zone 33 °C

Packages: hyprland 0.56.2-5.1, libcamera 0.7.2-4.22, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamobile-apps 0.2.0-1, omamobile-device-husky 0.1.1-1, omamobile-firstboot 0.1.2-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-omarchy 0.1.20-1, omamobile-owl-widgets 0.1.1-1, omamobile-shell 0.2.45-1, omarchy 4.0.6-1, quickshell 0.3.2.r7.g2b4501a-1

@derekross

Copy link
Copy Markdown
Owner

Thank you, Lef. This is the right fix, and a careful port. I diffed omamobile-usb-rescue against the Pixel 7 Pro's. The only changes are the bus (10cb0000.i2c, which matches the hsi2c_11 node in kernel #163), the extra journal lines, and reading the switch on every pass instead of only while VBUS is valid. The write is still the one register, only while VBUS is valid, and the script still stands aside once a Type-C driver owns 0x25. On a DT without the bus it exits 0, so Restart=on-failure leaves it alone. Your unplug/replug timeline is just the evidence I'd want.

The blocklist also matches what the MFD creates. In our tree max77759 registers three cells, nvmem, gpio and charger, and all three are blacklisted, along with tcpci_maxim. It's blacklist only, with no install line, so your dead-man tool's modprobe still works. I also checked that letting the gauge autoload is safe on #163's DT. Without maxim,fg-model the driver's power-on path writes no model (on the MAX77759 the simple-battery properties don't feed config_data), so it really only reads until the model overlay is in.

Two things before it lands:

  1. The version. Brett's display PR (omamobile-device-husky 0.1.3: the display at 120 Hz, with brightness #228) also takes omamobile-device-husky 0.1.3, and git won't flag the clash, because both set the version file to the same text. omamobile-device-husky 0.1.3: the display at 120 Hz, with brightness #228 has been through two rounds and is ready, so I'd like to merge it first. After that, this one needs to be 0.1.4 and a rebase: install and test/all conflict (both add lines in the same places), and the README rows sit next to each other. Since you've allowed edits, I'm happy to do the rebase myself if you prefer. Just say so.
  2. One boot from the package. I asked Brett for the same thing on omamobile-device-husky 0.1.3: the display at 120 Hz, with brightness #228. Please install the built package with tools/phone-install-package, then remove the hand-copied script and unit and your /etc/modprobe.d/omamobile-battery-test.conf (a unit or modprobe.d file in /etc overrides the package's). Then post tools/phone-smoke with uname -r, systemctl status omamobile-usb-rescue, the rescue's journal lines across one unplug and replug, and modprobe -c | grep -E 'blacklist (max77759_charger|tcpci_maxim|gpio_max77759|nvmem_max77759)'. That covers the two things your PR says weren't tested: the pacman install and the blocklist from /usr/lib/modprobe.d.

A small one, not blocking: the header comment's second line runs well past 80 columns.

Thanks also for spelling out the I2C register access in the checklist instead of just ticking the box.

…blocklist

Unplugging the cable and plugging it back in leaves a Pixel 8 Pro off the
USB link until it is rebooted: the MAX77759's Type-C side opens its USB2
data switch (TCPC 0x25, vendor register 0x93) on unplug, and with no Type-C
driver nothing closes it again, only the bootloader does at the next boot.
The README said so ("a replug may need a reboot"); on a Pixel 8 Pro the
kernel log shows nothing at all at the unplug, and the switch reads 0x00
after it and 0x09 once the rescue has written it back.

Add omamobile-usb-rescue, the Pixel 7 Pro's service on husky's bus
(10cb0000.i2c, hsi2c_11): while VBUS is valid (CHG_DETAILS_00.CHGIN_DTLS
== 3) it writes 0x09 to 0x25:0x93 when the switch is not 0x09, and it
stands aside once a Type-C driver owns the chip. It writes that one
register only, and logs every change of the switch, VBUS and the UDC
state to the journal. Without the bus (the base DT disables it) it says
so and exits, so the unit is inert until the bring-up overlay enables
hsi2c_11 (kernel derekross#163). Depends on i2c-tools.

Also add the MAX77759 blocklist the Pixel 7 Pro has, plus max77759_charger:
binding the PMIC creates its charger, GPIO and NVMEM cells, and the
charger driver programs the charge limits from the battery node, so
those and tcpci_maxim must not load before their bring-up steps.
Blacklist only, so a manual modprobe still works; the fuel gauge and the
MFD core still autoload. The test's "modprobe.d only sets options" rule
now has this one file as its exception, checked for what it contains.

Tested on a Pixel 8 Pro (7.3.0-rc6, slot B): unplug at 11:37:08 (switch
0x00, VBUS 0), replug at 11:37:26 (VBUS 1), the service wrote 0x09 and
the desktop had the link back at 11:37:28, no reboot; the same on a wall
charger. test/all passes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Somnius Somnius changed the title omamobile-device-husky 0.1.3: the USB replug rescue and the MAX77759 blocklist omamobile-device-husky 0.1.4: the USB replug rescue and the MAX77759 blocklist Nov 1, 2026
@Somnius

Somnius commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @derekross. Rebased onto main with #228 in, version is 0.1.4 now. install and test/all conflicted as you said. The one real clash was test/all's "modprobe.d only sets options" rule and the display start's "only gs_decon is guarded" line, so both now name their own file (the display file guards gs_decon, the max77759 file guards the four drivers). test/all and test/display-start pass.

The install of the built package on the phone and the phone-smoke output are still to do, I'll post them here when I've done it.

@Somnius

Somnius commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Here's the boot from the package, as you asked. omamobile-device-husky 0.1.4-1 is built on the phone with tools/phone-install-package from this branch. I removed my hand-copied files first (the old rescue unit and script, the display script, both files in /etc/modprobe.d), so /etc/modprobe.d only has hid_apple.conf and /usr/local/bin only has husky-deadman-phone. Then I re-flashed the same images to slot B and did a normal boot.

uname -r: 7.3.0-rc6-omamobile-push1-g5899fec2bd28

systemctl status omamobile-usb-rescue: active (running) since 18:30:00, which is the boot. systemd says 'disabled; preset: disabled' but it started on its own at boot through the vendor wants link.

The journal across a real unplug and replug. I moved the cable from the desktop to a wall charger, so it's not a desktop-to-desktop replug, but the switch did what it should:

18:30:00 watching the USB data switch on I2C bus 1
18:30:00 usbsw=0x09 vbus=1 udc=configured
18:42:32 usbsw=0x00 vbus=0 udc=configured
18:42:34 usbsw=0x00 vbus=1 udc=configured
18:42:34 VBUS valid, USBSW_CTRL 0x00: closing the data switch
18:42:36 usbsw=0x09 vbus=1 udc=configured

modprobe -c shows the four blacklists from /usr/lib/modprobe.d (max77759_charger, tcpci_maxim, gpio_max77759, nvmem_max77759), and none of those modules is loaded unless I load them by hand under the dead-man tool.

I also ran tools/phone-smoke on this kernel, all required checks ok. It only differs from @greenbrettmichael's by showing a battery (54% at the time). I haven't done a desktop-to-desktop replug on the package build, I can do that too if you want that exact case.

@derekross

Copy link
Copy Markdown
Owner

Thank you, Lef, that's exactly the evidence I asked for. 0.1.4 was built from this branch and installed with your hand-copied files and both /etc/modprobe.d files removed first. The rescue started at boot from the package's wants link, closed the switch on a real replug (0x00 to 0x09 within two seconds of VBUS), and the four blacklists come from /usr/lib/modprobe.d. Resolving the test/all clash by giving each modprobe.d file its own rule was the right call, too.

I re-ran the checks on the rebased head: it sits on main with #228 in, 0.1.4 follows main's 0.1.3, the package tests pass merged onto today's main (together with #249), and CI is green on this commit. The wall-charger replug is fine. A desktop-to-desktop replug isn't needed.

It's ready to merge, and #249 right after it. (The long second line of the header comment can be wrapped another time.)

@derekross derekross closed this in 05cf35e Nov 1, 2026
derekross pushed a commit that referenced this pull request Nov 1, 2026
…sults (#249)

The 8 Pro's battery bring-up: the overlays that enable the gauge's bus,
the gauge model and the pack EEPROM, the husky-deadman tool for charger
steps, and BATTERY-NOTES with the results and the recovery steps. The
battery and charging cells in DEVICES say "on a test kernel".

Maintainer edits at merge: the notes' file list names the overlays in
this change, the USB rescue's version is 0.1.4 (#250), the summary table
points at the slot B marking hold (#252), and the dead-man's recovery
text no longer assumes the block is in /etc/modprobe.d.

Closes #249

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Landed on main as 05cf35e (squashed, authored by you). Thanks, Lef.

@Somnius

Somnius commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@derekross thanks. If you'd rather not wrap the long second header line at merge, I'll do it in a small follow-up.

@derekross

Copy link
Copy Markdown
Owner

@Somnius thanks. No need for a PR of its own: fold the wrap into your next change to the husky package.

robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…blocklist (derekross#250)

The MAX77759 opens the USB2 data switch on unplug, and on the Pixel 8
Pro nothing closed it again, so the phone stayed off the bus after a
replug. The package now starts omamobile-usb-rescue at boot, which closes
the switch while VBUS is valid, and ships the MAX77759 blocklist in
/usr/lib/modprobe.d. Tested on the 8 Pro from the built package with the
hand-copied files removed: the switch closed on a real replug (0x00 to
0x09 within two seconds of VBUS), and the blacklists come from the
package.

Closes derekross#250

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…sults (derekross#249)

The 8 Pro's battery bring-up: the overlays that enable the gauge's bus,
the gauge model and the pack EEPROM, the husky-deadman tool for charger
steps, and BATTERY-NOTES with the results and the recovery steps. The
battery and charging cells in DEVICES say "on a test kernel".

Maintainer edits at merge: the notes' file list names the overlays in
this change, the USB rescue's version is 0.1.4 (derekross#250), the summary table
points at the slot B marking hold (derekross#252), and the dead-man's recovery
text no longer assumes the block is in /etc/modprobe.d.

Closes derekross#249

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derekross added a commit that referenced this pull request Nov 15, 2026
L-776: a fallback helper is checked against every exception its transport raises (#754). L-777: a DMA master running vendor firmware with its IOMMU in bypass stays disabled behind an overlay until the IOMMU is described (kernel #250, the maintainer's decision of 2026-11-15).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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