summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/qcom_geni_serial.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 3e460b0358eb..949e16ead7b5 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1985,6 +1985,7 @@ static int qcom_geni_serial_suspend(struct device *dev)
struct qcom_geni_serial_port *port = dev_get_drvdata(dev);
struct uart_port *uport = &port->uport;
struct qcom_geni_private_data *private_data = uport->private_data;
+ int ret;
/*
* This is done so we can hit the lowest possible state in suspend
@@ -1994,7 +1995,19 @@ static int qcom_geni_serial_suspend(struct device *dev)
geni_icc_set_tag(&port->se, QCOM_ICC_TAG_ACTIVE_ONLY);
geni_icc_set_bw(&port->se);
}
- return uart_suspend_port(private_data->drv, uport);
+
+ ret = uart_suspend_port(private_data->drv, uport);
+ if (ret)
+ return ret;
+
+ /*
+ * When no_console_suspend is set the console must remain active
+ * across system sleep, so skip the force suspend path.
+ */
+ if (!console_suspend_enabled && uart_console(uport))
+ return 0;
+
+ return pm_runtime_force_suspend(dev);
}
static int qcom_geni_serial_resume(struct device *dev)
@@ -2004,6 +2017,10 @@ static int qcom_geni_serial_resume(struct device *dev)
struct uart_port *uport = &port->uport;
struct qcom_geni_private_data *private_data = uport->private_data;
+ ret = pm_runtime_force_resume(dev);
+ if (ret)
+ return ret;
+
ret = uart_resume_port(private_data->drv, uport);
if (uart_console(uport)) {
geni_icc_set_tag(&port->se, QCOM_ICC_TAG_ALWAYS);