Skip to content

Commit 309864d

Browse files
MrVanstorulf
authored andcommitted
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 <peng.fan@nxp.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent a67d780 commit 309864d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/genpd/imx/scu-pd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
*/
5353

5454
#include <dt-bindings/firmware/imx/rsrc.h>
55+
#include <linux/console.h>
5556
#include <linux/firmware/imx/sci.h>
5657
#include <linux/firmware/imx/svc/rm.h>
5758
#include <linux/io.h>
@@ -324,6 +325,10 @@ static int imx_sc_pd_power(struct generic_pm_domain *domain, bool power_on)
324325
msg.resource = pd->rsrc;
325326
msg.mode = power_on ? IMX_SC_PM_PW_MODE_ON : IMX_SC_PM_PW_MODE_LP;
326327

328+
/* keep uart console power on for no_console_suspend */
329+
if (imx_con_rsrc == pd->rsrc && !console_suspend_enabled && !power_on)
330+
return -EBUSY;
331+
327332
ret = imx_scu_call_rpc(pm_ipc_handle, &msg, true);
328333
if (ret)
329334
dev_err(&domain->dev, "failed to power %s resource %d ret %d\n",

0 commit comments

Comments
 (0)