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

Commit 46cea860 authored by Mukesh Kumar Savaliya's avatar Mukesh Kumar Savaliya
Browse files

serial: msm_geni_serial: Make sure to have buffer for stop rx



This patch creates RX buffer required to handle EOT event as part
of stop rx operation. In some rare scenario it may happen that stop rx
may not find the DMA buffer if there is some unexpected sequence gets
executed for any reason.

Change-Id: Iaf74170ca71b4247b46af2e69a8a19ccf4166cdf
Signed-off-by: default avatarMukesh Kumar Savaliya <msavaliy@codeaurora.org>
parent 21a4d468
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -1015,8 +1015,21 @@ static void start_rx_sequencer(struct uart_port *uport)
	u32 geni_se_param = UART_PARAM_RFR_OPEN;

	geni_status = geni_read_reg_nolog(uport->membase, SE_GENI_STATUS);
	if (geni_status & S_GENI_CMD_ACTIVE)
	if (geni_status & S_GENI_CMD_ACTIVE) {
		if (port->xfer_mode == SE_DMA && !port->rx_dma) {
			IPC_LOG_MSG(port->ipc_log_misc,
				"%s: GENI: 0x%x\n", __func__, geni_status);
			ret = geni_se_rx_dma_prep(port->wrapper_dev,
				uport->membase, port->rx_buf, DMA_RX_BUF_SIZE,
				&port->rx_dma);
			if (ret) {
				IPC_LOG_MSG(port->ipc_log_misc,
					"%s: RX buff Fail %d\n", __func__, ret);
				goto exit_start_rx_sequencer;
			}
		}
		msm_geni_serial_stop_rx(uport);
	}

	/* Start RX with the RFR_OPEN to keep RFR in always ready state */
	geni_setup_s_cmd(uport->membase, UART_START_READ, geni_se_param);