diff mbox series

serial: sh-sci: Call device_set_wakeup_path() for serial console

Message ID 20240422111123.1622967-1-claudiu.beznea.uj@bp.renesas.com
State New
Headers show
Series serial: sh-sci: Call device_set_wakeup_path() for serial console | expand

Commit Message

Claudiu April 22, 2024, 11:11 a.m. UTC
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

In case the SCI is used as a UART console, no_console_suspend is
available in bootargs and SCI is part of a software-controlled power
domain we need to call device_set_wakeup_path(). This lets the power
domain core code knows that this domain should not be powered off
durring system suspend. Otherwise, the SCI power domain is turned off,
nothing is printed while suspending and the suspend/resume process is
blocked. This was detected on the RZ/G3S SoC while adding support
for power domains.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/tty/serial/sh-sci.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 97031db26ae4..57a7f18e16e4 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3441,8 +3441,12 @@  static __maybe_unused int sci_suspend(struct device *dev)
 {
 	struct sci_port *sport = dev_get_drvdata(dev);
 
-	if (sport)
+	if (sport) {
+		if (uart_console(&sport->port) && !console_suspend_enabled)
+			device_set_wakeup_path(dev);
+
 		uart_suspend_port(&sci_uart_driver, &sport->port);
+	}
 
 	return 0;
 }