Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7304a7bf authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru Committed by Gerrit - the friendly Code Review server
Browse files

serial: msm_geni_serial: Avoid unclocked access from start_tx



During system suspend/resume testing, when console is in suspended
state and clocks are OFF. Seems UART console used to dump some info on
console and leading to NOC fault.

To fix this issue add defensive check in msm_geni_serial_start_tx() api.

Change-Id: I27edd7814e28946449afe256f72f7cb1c868822e
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent 1eb2027a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1225,6 +1225,13 @@ static void msm_geni_serial_start_tx(struct uart_port *uport)
	unsigned int geni_ios;
	static unsigned int ios_log_limit;

	/* when start_tx is called with UART clocks OFF return. */
	if (uart_console(uport) && msm_port->is_clock_off) {
		IPC_LOG_MSG(msm_port->console_log,
			"%s. Console in suspend state\n", __func__);
		return;
	}

	if (!uart_console(uport) && !pm_runtime_active(uport->dev)) {
		IPC_LOG_MSG(msm_port->ipc_log_misc,
				"%s.Putting in async RPM vote\n", __func__);
@@ -3562,6 +3569,7 @@ static int msm_geni_serial_sys_suspend(struct device *dev)
	if (uart_console(uport) || port->pm_auto_suspend_disable) {
		uart_suspend_port((struct uart_driver *)uport->private_data,
					uport);
		IPC_LOG_MSG(port->console_log, "%s\n", __func__);
	} else {
		struct uart_state *state = uport->state;
		struct tty_port *tty_port = &state->port;
@@ -3593,6 +3601,7 @@ static int msm_geni_serial_sys_resume(struct device *dev)
		port->pm_auto_suspend_disable) {
		uart_resume_port((struct uart_driver *)uport->private_data,
									uport);
		IPC_LOG_MSG(port->console_log, "%s\n", __func__);
	}
	return 0;
}