Skip to content

Commit 19df766

Browse files
jhovoldgregkh
authored andcommitted
serial: qcom-geni: revert broken hibernation support
This reverts commit 35781d8. Hibernation is not supported on Qualcomm platforms with mainline kernels yet a broken vendor implementation for the GENI serial driver made it upstream. This is effectively dead code that cannot be tested and should just be removed, but if these paths were ever hit for an open non-console port they would crash the machine as the driver would fail to enable clocks during restore() (i.e. all ports would have to be closed by drivers and user space before hibernating the system to avoid this as a comment in the code hinted at). The broken implementation also added a random call to enable the receiver in the port setup code where it does not belong and which enables the receiver prematurely for console ports. Fixes: 35781d8 ("tty: serial: qcom-geni-serial: Add support for Hibernation feature") Cc: [email protected] # 6.2 Cc: Aniket Randive <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4bef7c6 commit 19df766

File tree

1 file changed

+2
-39
lines changed

1 file changed

+2
-39
lines changed

drivers/tty/serial/qcom_geni_serial.c

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,6 @@ static int qcom_geni_serial_port_setup(struct uart_port *uport)
11701170
false, true, true);
11711171
geni_se_init(&port->se, UART_RX_WM, port->rx_fifo_depth - 2);
11721172
geni_se_select_mode(&port->se, port->dev_data->mode);
1173-
qcom_geni_serial_start_rx(uport);
11741173
port->setup = true;
11751174

11761175
return 0;
@@ -1799,38 +1798,6 @@ static int qcom_geni_serial_sys_resume(struct device *dev)
17991798
return ret;
18001799
}
18011800

1802-
static int qcom_geni_serial_sys_hib_resume(struct device *dev)
1803-
{
1804-
int ret = 0;
1805-
struct uart_port *uport;
1806-
struct qcom_geni_private_data *private_data;
1807-
struct qcom_geni_serial_port *port = dev_get_drvdata(dev);
1808-
1809-
uport = &port->uport;
1810-
private_data = uport->private_data;
1811-
1812-
if (uart_console(uport)) {
1813-
geni_icc_set_tag(&port->se, QCOM_ICC_TAG_ALWAYS);
1814-
geni_icc_set_bw(&port->se);
1815-
ret = uart_resume_port(private_data->drv, uport);
1816-
/*
1817-
* For hibernation usecase clients for
1818-
* console UART won't call port setup during restore,
1819-
* hence call port setup for console uart.
1820-
*/
1821-
qcom_geni_serial_port_setup(uport);
1822-
} else {
1823-
/*
1824-
* Peripheral register settings are lost during hibernation.
1825-
* Update setup flag such that port setup happens again
1826-
* during next session. Clients of HS-UART will close and
1827-
* open the port during hibernation.
1828-
*/
1829-
port->setup = false;
1830-
}
1831-
return ret;
1832-
}
1833-
18341801
static const struct qcom_geni_device_data qcom_geni_console_data = {
18351802
.console = true,
18361803
.mode = GENI_SE_FIFO,
@@ -1842,12 +1809,8 @@ static const struct qcom_geni_device_data qcom_geni_uart_data = {
18421809
};
18431810

18441811
static const struct dev_pm_ops qcom_geni_serial_pm_ops = {
1845-
.suspend = pm_sleep_ptr(qcom_geni_serial_sys_suspend),
1846-
.resume = pm_sleep_ptr(qcom_geni_serial_sys_resume),
1847-
.freeze = pm_sleep_ptr(qcom_geni_serial_sys_suspend),
1848-
.poweroff = pm_sleep_ptr(qcom_geni_serial_sys_suspend),
1849-
.restore = pm_sleep_ptr(qcom_geni_serial_sys_hib_resume),
1850-
.thaw = pm_sleep_ptr(qcom_geni_serial_sys_hib_resume),
1812+
SYSTEM_SLEEP_PM_OPS(qcom_geni_serial_sys_suspend,
1813+
qcom_geni_serial_sys_resume)
18511814
};
18521815

18531816
static const struct of_device_id qcom_geni_serial_match_table[] = {

0 commit comments

Comments
 (0)