Commit 7fb5b880 authored by Karthikeyan Ramasubramanian's avatar Karthikeyan Ramasubramanian Committed by Greg Kroah-Hartman

tty: serial: qcom_geni_serial: Remove unnecessary memory barrier

While initiating TX, only the register reads need to be ordered. The
register write order either is achieved due to data dependency or is
not required.

Use readl to achieve the read order and remove the unnecessary barrier.
Signed-off-by: default avatarKarthikeyan Ramasubramanian <kramasub@codeaurora.org>
Reviewed-by: default avatarEvan Green <evgreen@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f7371750
...@@ -417,20 +417,18 @@ static void qcom_geni_serial_start_tx(struct uart_port *uport) ...@@ -417,20 +417,18 @@ static void qcom_geni_serial_start_tx(struct uart_port *uport)
u32 status; u32 status;
if (port->xfer_mode == GENI_SE_FIFO) { if (port->xfer_mode == GENI_SE_FIFO) {
status = readl_relaxed(uport->membase + SE_GENI_STATUS); /*
* readl ensures reading & writing of IRQ_EN register
* is not re-ordered before checking the status of the
* Serial Engine.
*/
status = readl(uport->membase + SE_GENI_STATUS);
if (status & M_GENI_CMD_ACTIVE) if (status & M_GENI_CMD_ACTIVE)
return; return;
if (!qcom_geni_serial_tx_empty(uport)) if (!qcom_geni_serial_tx_empty(uport))
return; return;
/*
* Ensure writing to IRQ_EN & watermark registers are not
* re-ordered before checking the status of the Serial
* Engine and TX FIFO
*/
mb();
irq_en = readl_relaxed(uport->membase + SE_GENI_M_IRQ_EN); irq_en = readl_relaxed(uport->membase + SE_GENI_M_IRQ_EN);
irq_en |= M_TX_FIFO_WATERMARK_EN | M_CMD_DONE_EN; irq_en |= M_TX_FIFO_WATERMARK_EN | M_CMD_DONE_EN;
...@@ -894,7 +892,7 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport, ...@@ -894,7 +892,7 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport,
static unsigned int qcom_geni_serial_tx_empty(struct uart_port *uport) static unsigned int qcom_geni_serial_tx_empty(struct uart_port *uport)
{ {
return !readl_relaxed(uport->membase + SE_GENI_TX_FIFO_STATUS); return !readl(uport->membase + SE_GENI_TX_FIFO_STATUS);
} }
#ifdef CONFIG_SERIAL_QCOM_GENI_CONSOLE #ifdef CONFIG_SERIAL_QCOM_GENI_CONSOLE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment