From: Kendall Willis <k-willis@ti.com>
To: Nishanth Menon <nm@ti.com>, Tero Kristo <kristo@kernel.org>,
Santosh Shilimkar <ssantosh@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: <linux-arm-kernel@lists.infradead.org>,
<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<d-gole@ti.com>, <vishalm@ti.com>, <sebin.francis@ti.com>,
<msp@baylibre.com>, <khilman@baylibre.com>, <a-kaur@ti.com>,
<k-willis@ti.com>
Subject: [PATCH v2] pmdomain: ti_sci: Handle wakeup constraint if device has pinctrl wakeup state
Date: Wed, 10 Sep 2025 16:16:35 -0500 [thread overview]
Message-ID: <20250910-uart-daisy-chain-pmdomain-v2-1-6d0215f4af32@ti.com> (raw)
For TI K3 SoCs with IO daisy-chaining using pinctrl wakeup state, avoid
sending wakeup constraints to the PM co-processor. This allows the SoC to
enter deeper low power states while still maintaining wakeup capability
for peripherals using IO daisy-chain wakeup via pinctrl wakeup state,
similar to the existing wake IRQ mechanism added in commit b06bc47279919
("pmdomain: ti_sci: handle wake IRQs for IO daisy chain wakeups").
Detect the pinctrl wakeup state in the suspend path, and if it exists,
skip sending the constraint.
Signed-off-by: Kendall Willis <k-willis@ti.com>
---
Implementation
--------------
This patch is intended to be implemented along with the following
series. This patch has no dependencies on any of the other series:
1. "pmdomain: ti_sci: Handle wakeup constraint if device has pinctrl
wakeup state": (this patch) skips setting constraints for wakeup
sources that use pinctrl state 'wakeup'.
2. "serial: 8250: omap: Add wakeup support": Implements wakeup from
the UARTs for TI K3 SoCs
https://github.com/kwillis01/linux/tree/b4/uart-daisy-chain-8250-omap
3. "arm64: dts: ti: k3-am62: Support Main UART wakeup": Implements the
functionality to wakeup the system from the Main UART
https://github.com/kwillis01/linux/tree/b4/uart-daisy-chain-dts
Testing
-------
Tested on a AM62P SK EVM board with all series and dependencies
implemented. Suspend/resume verified with the Main UART wakeup source
by entering a keypress on the console.
This github branch has all the necessary patches to test the series
using linux-next:
https://github.com/kwillis01/linux/tree/uart-daisy-chain
Version History
---------------
Changes from v1 to v2:
- Reworded commit message to be concise and to reference commit
b06bc47279919
v1: https://lore.kernel.org/all/20250904211607.3725897-1-k-willis@ti.com/
---
drivers/pmdomain/ti/ti_sci_pm_domains.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/pmdomain/ti/ti_sci_pm_domains.c b/drivers/pmdomain/ti/ti_sci_pm_domains.c
index 82df7e44250bb64f9c4a2108b5e97bd782a5976d..884905fd0686c1b94aba68c03da038e577428adf 100644
--- a/drivers/pmdomain/ti/ti_sci_pm_domains.c
+++ b/drivers/pmdomain/ti/ti_sci_pm_domains.c
@@ -10,6 +10,7 @@
#include <linux/err.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
#include <linux/pm_qos.h>
@@ -84,9 +85,24 @@ static inline void ti_sci_pd_set_wkup_constraint(struct device *dev)
struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
struct ti_sci_pm_domain *pd = genpd_to_ti_sci_pd(genpd);
const struct ti_sci_handle *ti_sci = pd->parent->ti_sci;
+ struct pinctrl *pinctrl = devm_pinctrl_get(dev);
+ struct pinctrl_state *pinctrl_state_wakeup;
int ret;
if (device_may_wakeup(dev)) {
+ /*
+ * If device can wakeup using pinctrl wakeup state,
+ * we do not want to set a constraint
+ */
+ if (!IS_ERR_OR_NULL(pinctrl)) {
+ pinctrl_state_wakeup = pinctrl_lookup_state(pinctrl, "wakeup");
+ if (!IS_ERR_OR_NULL(pinctrl_state_wakeup)) {
+ dev_dbg(dev, "%s: has wake pinctrl wakeup state, not setting " \
+ "constraints\n", __func__);
+ return;
+ }
+ }
+
/*
* If device can wakeup using IO daisy chain wakeups,
* we do not want to set a constraint.
---
base-commit: 5f540c4aade9f1d58fb7b9490b4b7d5214ec9746
change-id: 20250910-uart-daisy-chain-pmdomain-b83b2db2c3cc
Best regards,
--
Kendall Willis <k-willis@ti.com>
next reply other threads:[~2025-09-10 21:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 21:16 Kendall Willis [this message]
2025-10-21 12:22 ` Ulf Hansson
2025-11-11 20:17 ` Kendall Willis
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=20250910-uart-daisy-chain-pmdomain-v2-1-6d0215f4af32@ti.com \
--to=k-willis@ti.com \
--cc=a-kaur@ti.com \
--cc=d-gole@ti.com \
--cc=khilman@baylibre.com \
--cc=kristo@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=msp@baylibre.com \
--cc=nm@ti.com \
--cc=sebin.francis@ti.com \
--cc=ssantosh@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=vishalm@ti.com \
/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®