Signed-off-by: Gerald Baeza <gerald.baeza@st.com>
Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
u32 sr;
+ spin_lock(&port->lock);
+
sr = readl_relaxed(port->membase + ofs->isr);
if ((sr & USART_SR_RXNE) && !(stm32_port->rx_ch))
if ((sr & USART_SR_TXE) && !(stm32_port->tx_ch))
stm32_transmit_chars(port);
+ spin_unlock(&port->lock);
+
if (stm32_port->rx_ch)
return IRQ_WAKE_THREAD;
else