aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <[email protected]>2023-08-14 18:41:23 +0800
committerUlf Hansson <[email protected]>2023-08-17 11:33:54 +0200
commit309864dcf92b76fc601a579adf9eb389e4ca4c5c (patch)
tree55df719a0bbbd261b1644de968ee6a9afc316b03
parenta67d780720ff406943d56286bc06aa60c2b59d3a (diff)
genpd: imx: scu-pd: do not power off console if no_console_suspend
Do not power off console if no_console_suspend, this will leave the serial device's corresponding PM domain on during system suspend, which is useful for debug system suspend. Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
-rw-r--r--drivers/genpd/imx/scu-pd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/genpd/imx/scu-pd.c b/drivers/genpd/imx/scu-pd.c
index 08583a10ac62..d69da79d3130 100644
--- a/drivers/genpd/imx/scu-pd.c
+++ b/drivers/genpd/imx/scu-pd.c
@@ -52,6 +52,7 @@
*/
#include <dt-bindings/firmware/imx/rsrc.h>
+#include <linux/console.h>
#include <linux/firmware/imx/sci.h>
#include <linux/firmware/imx/svc/rm.h>
#include <linux/io.h>
@@ -324,6 +325,10 @@ static int imx_sc_pd_power(struct generic_pm_domain *domain, bool power_on)
msg.resource = pd->rsrc;
msg.mode = power_on ? IMX_SC_PM_PW_MODE_ON : IMX_SC_PM_PW_MODE_LP;
+ /* keep uart console power on for no_console_suspend */
+ if (imx_con_rsrc == pd->rsrc && !console_suspend_enabled && !power_on)
+ return -EBUSY;
+
ret = imx_scu_call_rpc(pm_ipc_handle, &msg, true);
if (ret)
dev_err(&domain->dev, "failed to power %s resource %d ret %d\n",