From: "André Draszik" <andre.draszik@linaro.org>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Badhri Jagan Sridharan <badhri@google.com>
Cc: "Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
"Clark Williams" <clrkwllms@kernel.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Peter Griffin" <peter.griffin@linaro.org>,
"Tudor Ambarus" <tudor.ambarus@linaro.org>,
"Juan Yescas" <jyescas@google.com>,
"Amit Sunil Dhamne" <amitsd@google.com>,
kernel-team@android.com, linux-usb@vger.kernel.org,
linux-rt-devel@lists.linux.dev,
"André Draszik" <andre.draszik@linaro.org>,
stable@vger.kernel.org
Subject: [PATCH 2/2] usb: typec: tcpm/tcpci_maxim: init wakeup before irq
Date: Mon, 23 Nov 2026 13:03:07 +0000 [thread overview]
Message-ID: <20261123-max77759-wait-v1-2-6fa54a751bb7@linaro.org> (raw)
In-Reply-To: <20261123-max77759-wait-v1-0-6fa54a751bb7@linaro.org>
max_tcpci_probe() requests the TCPC interrupt before it initialises
the wakeup source of the device. Since the interrupt is level
triggered, an already asserted alert can trigger the interrupt handler
before devm_device_init_wakeup() is called. Its pm_wakeup_event() does
nothing while the device has no wakeup source, so the wakeup event of
such an early interrupt is not recorded, meaning the system is then not
prevented from suspending for PD_ACTIVITY_TIMEOUT_MS while handling
that alert.
When the driver unbinds, devres works in reverse order and in this case
removes the wakeup source before it frees the interrupt, which leaves a
similar window.
Call devm_device_init_wakeup() before devm_request_threaded_irq(), so
that the wakeup source exists for as long as the interrupt handler can
run.
Fixes: 6f413b559f86 ("usb: typec: tcpci_maxim: Chip level TCPC driver")
Cc: stable@vger.kernel.org
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
drivers/usb/typec/tcpm/tcpci_maxim_core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/typec/tcpm/tcpci_maxim_core.c b/drivers/usb/typec/tcpm/tcpci_maxim_core.c
index 6e202171f57a..2bb306b6b1f9 100644
--- a/drivers/usb/typec/tcpm/tcpci_maxim_core.c
+++ b/drivers/usb/typec/tcpm/tcpci_maxim_core.c
@@ -528,16 +528,16 @@ static int max_tcpci_probe(struct i2c_client *client)
chip->port = tcpci_get_tcpm_port(chip->tcpci);
+ ret = devm_device_init_wakeup(chip->dev);
+ if (ret)
+ return dev_err_probe(chip->dev, ret, "Failed to init wakeup\n");
+
ret = devm_request_threaded_irq(&client->dev, client->irq, NULL, max_tcpci_irq,
(IRQF_TRIGGER_LOW | IRQF_ONESHOT), dev_name(chip->dev),
chip);
if (ret < 0)
return ret;
- ret = devm_device_init_wakeup(chip->dev);
- if (ret)
- return dev_err_probe(chip->dev, ret, "Failed to init wakeup\n");
-
return 0;
}
--
2.56.1.750.gf70dc682cf-goog
next prev parent reply other threads:[~2026-11-23 13:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 13:03 [PATCH 0/2] usb: typec: tcpm/tcpci_maxim: lockdep and PM wakeup fixes André Draszik
2026-11-23 13:03 ` [PATCH 1/2] usb: typec: tcpm/tcpci_maxim: fix invalid wait context André Draszik
2026-11-23 13:03 ` André Draszik [this message]
2026-11-23 13:06 ` [PATCH 0/2] usb: typec: tcpm/tcpci_maxim: lockdep and PM wakeup fixes sashiko-bot
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=20261123-max77759-wait-v1-2-6fa54a751bb7@linaro.org \
--to=andre.draszik@linaro.org \
--cc=amitsd@google.com \
--cc=badhri@google.com \
--cc=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=jyescas@google.com \
--cc=kernel-team@android.com \
--cc=linux-rt-devel@lists.linux.dev \
--cc=linux-usb@vger.kernel.org \
--cc=peter.griffin@linaro.org \
--cc=rostedt@goodmis.org \
--cc=stable@vger.kernel.org \
--cc=tudor.ambarus@linaro.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