Commit 3b963042 authored by Muhammad Hamza Farooq's avatar Muhammad Hamza Farooq Committed by Greg Kroah-Hartman

serial: sh-sci: Do not terminate DMA engine when race condition occurs

When DMA packet completion and timer expiry take place at the same time,
do not terminate the DMA engine, leading by submission of new
descriptors, as the DMA communication hasn't necessarily stopped here.
Signed-off-by: default avatarMuhammad Hamza Farooq <mfarooq@visteon.com>
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1d3db608
......@@ -1296,9 +1296,14 @@ static void rx_timer_fn(unsigned long arg)
}
status = dmaengine_tx_status(s->chan_rx, s->active_rx, &state);
if (status == DMA_COMPLETE)
if (status == DMA_COMPLETE) {
dev_dbg(port->dev, "Cookie %d #%d has already completed\n",
s->active_rx, active);
spin_unlock_irqrestore(&port->lock, flags);
/* Let packet complete handler take care of the packet */
return;
}
/* Handle incomplete DMA receive */
dmaengine_terminate_all(s->chan_rx);
......
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