Repository navigation
Conversation
The Pixel 9 Pro Fold (Tensor G4) runs its USB 2.0 gadget through a glue driver that initialises the USB2 PHY before the DWC3 core's first register access. Add its google,zumapro-dwc3 compatible: peripheral only, high speed, three clocks (bus_early, ref, ctrl) and a single USB2 PHY. Existing snps,dwc3 users are unchanged. Assisted-by: LLM Signed-off-by: Nate Crawford <nate@kdegeek.com>
The DWC3 core reads GSNPSID before it initialises its generic PHYs. On Tensor, a read of the link while the USB2 PHY is isolated or in reset can hang. Initialise the USB2 PHY under the three enabled clocks before handing over to dwc3_core_probe(), and hold that reference until removal; the core balances its own. Host and dual-role modes need their own power sequencing and are rejected. The probe structure follows dwc3-generic-plat. It gets its own Kconfig symbol, USB_DWC3_ZUMAPRO. The Pixel 9 Pro Fold (comet) brings up its USB gadget, and with it its only link during bring-up, through this glue on its daily v7.3-rc6 based kernel. The Pixel 9a, the same SoC, binds plain snps,dwc3; why comet needed the PHY first was not isolated: the bring-up boots that lost USB were fixed together with two unrelated changes. System sleep is added by the next patch. Assisted-by: LLM Signed-off-by: Nate Crawford <nate@kdegeek.com>
The glue refused system sleep with -EBUSY, so every suspend attempt on
the Pixel 9 Pro Fold failed at 11210000.usb ("failed to suspend: error
-16"), even at the PM core's "devices" test level.
Use the generic DWC3 system sleep path, as dwc3-generic-plat does, but
keep the inherited clocks on and hold an extra PHY power reference over
the sleep. The usbdrd PHY's last power_off isolates the link, and
dwc3_core_init() reads core registers (dwc3_phy_setup()) before it
powers the PHY again; the probe comment already records that such a
read can hang on Tensor. With the extra reference the core is re-inited
against the same initialised, powered PHY that it found at probe. In
peripheral mode the core soft-disconnects the gadget on suspend and
reconnects on resume.
Tested on a Pixel 9 Pro Fold with a v7.3-rc6 based kernel: pm_test
"devices" passes, every device suspends and resumes, the USB gadget
comes back and the host reconnects, with no storage or ACPM errors.
Before this change the same test failed at 11210000.usb with -EBUSY.
Three real suspend-to-idle cycles on a 30 s RTC alarm and one
power-key wake then passed, with SSH over the gadget back after each.
Assisted-by: LLM
Signed-off-by: Nate Crawford <nate@kdegeek.com>
|
Thanks, Nate, and thank you especially for the "What isn't established" section: it is the most useful part of the description, and it is where I'd like to start. The driver is cleanly separated: a new file, a new compatible and a new Kconfig symbol, so no phone on Before it merges, though, I think the published tree already has an answer to the problem this glue works around, and I'd like to know whether comet needs anything more:
One small thing: the Kconfig entry wants |
derekross
left a comment
There was a problem hiding this comment.
CI has run on this head and passes: clean merge onto today's omamobile, sign-offs, prefixes, checkpatch --strict, a W=1 build of dwc3-zumapro.c, and dt_binding_check on snps,dwc3.yaml, which is the check I had run by hand. The one skipped line is "device trees: none touched": CI validates no board against the changed schema when a pull request touches no device tree, so for the 9a, the 7 Pro and the 6 Pro that still rests on my hand run.
Nothing in my comment above changes: the boot with the 9a's plain snps,dwc3 node is still the next step, and it decides whether the other three points matter.
|
Derek, The plain node works on comet. On 2026-11-18 I booted our running kernel (
That run was a On the module: I put the missing binder down to the old images carrying only So I'm withdrawing the glue and closing this PR. USB is enabled in #273 the 9a's way, with the node above. |
Is this the 9a's glue?
No. The Pixel 9a's
&usbuses plainsnps,dwc3fromzumapro.dtsi, and nothing onomamobileinitialises the PHY before the core.dwc3-google.cis for Tensor G5 (Laguna), not G4. So this is its own PR, as asked on omarchy-mobile#203.Evidence
Tested on a Pixel 9 Pro Fold (comet). The phone's daily kernel (
7.3.0-rc6-omamobile-comet-rc2-cand21) binds11210000.usbasgoogle,zumapro-dwc3at every boot, withdwc3-zumaproin the initramfs. That glue gives the phone its USB gadget, which is the only link while the phone is being brought up. The driver code is the same as in this branch; the only change here is the Kconfig symbol.System sleep (commit 3), on the int-k9f and int-k9g integration kernels, 2026-11-01:
pm_test devicesfailed atdwc3-zumapro 11210000.usb: failed to suspend: error -16, because the glue's suspend callback was an-EBUSYstub.pm_test devicespasses. Every device suspends and resumes, the gadget reconnects by itself, success 1, fail 0, and no storage or ACPM errors.What isn't established
Why comet needed the PHY initialised before the core while the 9a doesn't. The bring-up boots that lost USB were fixed together with two unrelated changes (symbol exports, and loading the mailbox driver before ACPM), so the glue's own effect was never isolated. One attended boot of comet with plain
snps,dwc3would settle it. If that boot works, commits 1 and 2 aren't needed. Commit 3's PHY reference would then belong in the core's own suspend path.Commits
dt-bindings: usb: snps,dwc3: Describe Tensor G4 peripheral glue:google,zumapro-dwc3, peripheral only, high speed, clocksbus_early/ref/ctrl, one USB2 PHY.usb: dwc3: Add Tensor G4 PHY-before-core glue:phy_init()under the enabled clocks beforedwc3_core_probe(). Host and dual-role are rejected. New symbolCONFIG_USB_DWC3_ZUMAPRO.usb: dwc3: zumapro: Suspend and resume through the DWC3 core: uses the core's system sleep path, with an extra PHY power reference held across it.Checks
tools/kernel-pr-check --build OUT --merge origin/omamobile HEAD: merges cleanly; prefixes,checkpatch --strict(0 warnings), policy, the W=1 build ofdwc3-zumapro.canddt_binding_checkall pass, and every commit is signed off by its author. Also built withCONFIG_USB_DWC3_ZUMAPRO=mand W=1; every core symbol it uses isEXPORT_SYMBOL_GPL.To use it,
kernel/configs/omamobile.configneedsCONFIG_USB_DWC3_ZUMAPRO=m(omarchy-mobile side), and the comet board needscompatible = "google,zumapro-dwc3"and clocksbus_early/ref/ctrlon&usb. That is a one-line board follow-up once both this PR and the comet DTS PR have merged.🤖 Generated with Claude Code