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

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

serial: msm_geni_serial: Bailout from suspend if RX data is pending



This change is to resolve potential race btw stop rx and cancel rx
due to interrupt latency in the system.

Change-Id: I7b510949f75bac5ec9f8f42f3d139131b259600f
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent 8753585c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1492,6 +1492,7 @@ static int stop_rx_sequencer(struct uart_port *uport)
	bool is_rx_active;
	unsigned int stale_delay;
	u32 dma_rx_status, s_irq_status;
	int usage_count;

	IPC_LOG_MSG(port->ipc_log_misc, "%s\n", __func__);

@@ -1535,6 +1536,15 @@ static int stop_rx_sequencer(struct uart_port *uport)
			IPC_LOG_MSG(port->ipc_log_misc, "%s: Interrupt delay\n",
					 __func__);
			handle_rx_dma_xfer(s_irq_status, uport);
			if (!port->ioctl_count) {
				usage_count = atomic_read(
						&uport->dev->power.usage_count);
				IPC_LOG_MSG(port->ipc_log_misc,
					"%s: Abort Stop Rx, extend the PM timer, usage_count:%d\n",
					__func__, usage_count);
				pm_runtime_mark_last_busy(uport->dev);
				return -EBUSY;
			}
		}
	}