From: Jacob Procee <sn125164@gmail.com>
To: Janne Grunau <j@jannau.net>
Cc: Sven Peter <sven@kernel.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: tipd: cd321x: replay the plug on resume
Date: Fri, 20 Nov 2026 11:58:33 +0100 [thread overview]
Message-ID: <20261120115833.53ab9076@nixos-macbook> (raw)
In-Reply-To: <20261117124710.GA515128@robin.jannau.net>
On Tue, 17 Nov 2026 13:47:10 +0100
Janne Grunau <j@jannau.net> 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
prev parent reply other threads:[~2026-11-20 10:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 11:30 Jacob Procee
2026-11-17 11:08 ` Heikki Krogerus
2026-11-17 12:03 ` Sven Peter
2026-11-17 12:17 ` Jacob Procee
2026-11-17 12:47 ` Janne Grunau
2026-11-20 10:58 ` Jacob Procee [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261120115833.53ab9076@nixos-macbook \
--to=sn125164@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=j@jannau.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sven@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®