Skip to content

Commit fa17ed8

Browse files
jhovoldgregkh
authored andcommitted
serial: qcom-geni: revert broken hibernation support
commit 19df766 upstream. 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: stable@vger.kernel.org # 6.2 Cc: Aniket Randive <quic_arandive@quicinc.com> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20241009145110.16847-3-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3321944 commit fa17ed8

1 file changed

Lines changed: 2 additions & 39 deletions

File tree

drivers/tty/serial/qcom_geni_serial.c

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,6 @@ static int qcom_geni_serial_port_setup(struct uart_port *uport)
11521152
false, true, true);
11531153
geni_se_init(&port->se, UART_RX_WM, port->rx_fifo_depth - 2);
11541154
geni_se_select_mode(&port->se, port->dev_data->mode);
1155-
qcom_geni_serial_start_rx(uport);
11561155
port->setup = true;
11571156

11581157
return 0;
@@ -1781,38 +1780,6 @@ static int qcom_geni_serial_sys_resume(struct device *dev)
17811780
return ret;
17821781
}
17831782

1784-
static int qcom_geni_serial_sys_hib_resume(struct device *dev)
1785-
{
1786-
int ret = 0;
1787-
struct uart_port *uport;
1788-
struct qcom_geni_private_data *private_data;
1789-
struct qcom_geni_serial_port *port = dev_get_drvdata(dev);
1790-
1791-
uport = &port->uport;
1792-
private_data = uport->private_data;
1793-
1794-
if (uart_console(uport)) {
1795-
geni_icc_set_tag(&port->se, QCOM_ICC_TAG_ALWAYS);
1796-
geni_icc_set_bw(&port->se);
1797-
ret = uart_resume_port(private_data->drv, uport);
1798-
/*
1799-
* For hibernation usecase clients for
1800-
* console UART won't call port setup during restore,
1801-
* hence call port setup for console uart.
1802-
*/
1803-
qcom_geni_serial_port_setup(uport);
1804-
} else {
1805-
/*
1806-
* Peripheral register settings are lost during hibernation.
1807-
* Update setup flag such that port setup happens again
1808-
* during next session. Clients of HS-UART will close and
1809-
* open the port during hibernation.
1810-
*/
1811-
port->setup = false;
1812-
}
1813-
return ret;
1814-
}
1815-
18161783
static const struct qcom_geni_device_data qcom_geni_console_data = {
18171784
.console = true,
18181785
.mode = GENI_SE_FIFO,
@@ -1824,12 +1791,8 @@ static const struct qcom_geni_device_data qcom_geni_uart_data = {
18241791
};
18251792

18261793
static const struct dev_pm_ops qcom_geni_serial_pm_ops = {
1827-
.suspend = pm_sleep_ptr(qcom_geni_serial_sys_suspend),
1828-
.resume = pm_sleep_ptr(qcom_geni_serial_sys_resume),
1829-
.freeze = pm_sleep_ptr(qcom_geni_serial_sys_suspend),
1830-
.poweroff = pm_sleep_ptr(qcom_geni_serial_sys_suspend),
1831-
.restore = pm_sleep_ptr(qcom_geni_serial_sys_hib_resume),
1832-
.thaw = pm_sleep_ptr(qcom_geni_serial_sys_hib_resume),
1794+
SYSTEM_SLEEP_PM_OPS(qcom_geni_serial_sys_suspend,
1795+
qcom_geni_serial_sys_resume)
18331796
};
18341797

18351798
static const struct of_device_id qcom_geni_serial_match_table[] = {

0 commit comments

Comments
 (0)