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

Commit 479a0803 authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru
Browse files

serial: msm_geni_serial: Do not unvote UFFI voted clocks for console



Currently driver turning off the QUP clocks during probe. At this
time early console is still active and transfers are in-coming.
This is resulting in NOC error during early console write or causing
console stuck issues on RUMI.
This change is to make sure UART doesn't turn on/off clocks from
msm_geni_serial_get_ver_info() API for console usecase. HSUART
tries to store firmware version for debug purpose which
needs clocks to be ON, hence keep clks vote in
msm_geni_serial_get_ver_info() only for HSUART.

Change-Id: Ifaaee81a2b4708ed8c02472ecd3b057c11876a57
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent e710aa3f
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/bitmap.h>
@@ -174,6 +174,7 @@ struct msm_geni_serial_port {
	struct msm_geni_serial_ver_info ver_info;
	u32 cur_tx_remaining;
	bool startup_in_progress;
	bool is_console;
};

static const struct uart_ops msm_geni_serial_pops;
@@ -2529,6 +2530,12 @@ static int msm_geni_serial_get_ver_info(struct uart_port *uport)
	int hw_ver, ret = 0;
	struct msm_geni_serial_port *msm_port = GET_DEV_PORT(uport);

	/*
	 * At this time early console is still active and transfers are
	 * in-coming. Make sure UART doesn't turn on/off clocks for
	 * console usecase.
	 */
	if (!msm_port->is_console)
		se_geni_clks_on(&msm_port->serial_rsc);
	/* Basic HW and FW info */
	if (unlikely(get_se_proto(uport->membase) != UART)) {
@@ -2557,6 +2564,7 @@ static int msm_geni_serial_get_ver_info(struct uart_port *uport)
			msm_port->ver_info.hw_minor_ver,
			msm_port->ver_info.hw_step_ver);
exit_ver_info:
	if (!msm_port->is_console)
		se_geni_clks_off(&msm_port->serial_rsc);
	return ret;
}
@@ -2609,6 +2617,7 @@ static int msm_geni_serial_probe(struct platform_device *pdev)
					line, ret);
		goto exit_geni_serial_probe;
	}
	dev_port->is_console = is_console;

	uport = &dev_port->uport;