Re: [PATCH] usb: typec: tipd: cd321x: replay the plug on resume
From: Jacob Procee
Date: Fri Nov 20 2026 - 05:58:47 EST
On Tue, 17 Nov 2026 13:47:10 +0100
Janne Grunau <j@xxxxxxxxxx> wrote:
> The interrupt controller (AIC) doesn't have functionality to configure
> IRQs as wake up source so it should set IRQCHIP_SKIP_SET_WAKE. Does
> wake from USB keyboard work with that changed?
> You might also need to add "wakeup-source" to the dwc3 nodes.
No, it still doesn't wake. I tested on Asahi 7.3.4 (j314s) with a
local test patch:
- AIC and AIC2 irq_chip .flags = IRQCHIP_SKIP_SET_WAKE
- dwc3-apple: device_init_wakeup(dev, true) in probe, and PM ops
that call enable_irq_wake() on the dwc3 IRQ in suspend when in
host mode and device_may_wakeup(), disable_irq_wake() in resume
The keyboard is behind a USB2 hub on b02280000. I had to enable
power/wakeup on the hub by hand (usbhid only sets it on the keyboard
itself), plus the xhci and root hubs.
On suspend, enable_irq_wake() returns 0 for both IRQs (113 and 115),
so the AIC flag does what it should. The keyboard stays connected
through s2idle and is still there after resume. But a keypress doesn't
wake the machine, and /sys/power/pm_wakeup_irq is empty afterwards, so
no interrupt seems to reach the kernel at all.
I didn't add "wakeup-source" to the DT: as far as I can see, neither
dwc3 core nor dwc3-apple parses it (only some glue drivers like qcom
do), so it would add nothing beyond device_init_wakeup().
My guess is that the halted xHC doesn't raise its interrupt on remote
wake, and a separate wake interrupt is needed, like qcom's
hs_phy_irq/dp_hs_phy_irq. Do you know whether the ATC PHY or some
other block on Apple has such an interrupt, or how macOS gets woken
here?
Power cost, in case it matters for the default: overnight s2idle runs
with a key plugged into f02280000 (lid closed, battery) came to
2.29 W with wakeup enabled (atc2_usb stays on) against 1.96 W with
wakeup disabled (domain off, device re-enumerates on resume). So
keeping the domain on costs about 0.33 W.
Thanks,
Jacob