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

Commit 81ae4135 authored by Dilip Kota's avatar Dilip Kota Committed by Gerrit - the friendly Code Review server
Browse files

msm_serial_hs: Disable RX PIPE before sps_disconnect



We need to disable RX PIPE interrupt to avoid any
race condition between sps_disconnect and bam_isr

CRs-Fixed: 606112
Change-Id: Id5192668d7001b1e3021b1751e7d818316722d5c
Signed-off-by: default avatarDilip Kota <c_dkota@codeaurora.org>
parent 07929a3e
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -583,6 +583,25 @@ static inline void msm_hs_write(struct uart_port *uport, unsigned int index,
	writel_relaxed(value, uport->membase + offset);
}

static int sps_rx_disconnect(struct sps_pipe *sps_pipe_handler)
{
	struct sps_connect config;
	int ret;

	ret = sps_get_config(sps_pipe_handler, &config);
	if (ret) {
		pr_err("%s: sps_get_config() failed ret %d\n", __func__, ret);
		return ret;
	}
	config.options |= SPS_O_POLL;
	ret = sps_set_config(sps_pipe_handler, &config);
	if (ret) {
		pr_err("%s: sps_set_config() failed ret %d\n", __func__, ret);
		return ret;
	}
	return sps_disconnect(sps_pipe_handler);
}

static void hex_dump_ipc(char *prefix, char *string, int size)
{
	char linebuf[512];
@@ -1244,7 +1263,7 @@ static void msm_hs_set_termios(struct uart_port *uport,
				ret = wait_event_timeout(msm_uport->rx.wait,
					msm_uport->rx_bam_inprogress == false,
					RX_FLUSH_COMPLETE_TIMEOUT);
			ret = sps_disconnect(sps_pipe_handle);
			ret = sps_rx_disconnect(sps_pipe_handle);
			if (ret)
				MSM_HS_ERR("%s(): sps_disconnect failed\n",
							__func__);
@@ -1330,7 +1349,7 @@ static void hsuart_disconnect_rx_endpoint_work(struct work_struct *w)
	struct sps_pipe *sps_pipe_handle = rx->prod.pipe_handle;
	int ret = 0;

	ret = sps_disconnect(sps_pipe_handle);
	ret = sps_rx_disconnect(sps_pipe_handle);
	if (ret)
		MSM_HS_ERR("%s(): sps_disconnect failed\n", __func__);