Skip to content

Commit 6eefc68

Browse files
geertugregkh
authored andcommitted
serial: sh-sci: Stop using deprecated dmaengine_terminate_all()
As of commit b36f09c ("dmaengine: Add transfer termination synchronization support"), dmaengine_terminate_all() is deprecated. Replace calls to dmaengine_terminate_all() in DMA release code by calls to dmaengine_terminate_sync(), as the latter waits until all running completion callbacks have finished. Replace calls to dmaengine_terminate_all() in DMA failure paths by calls to dmaengine_terminate_async(), as these are usually done in atomic context. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f661131 commit 6eefc68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/tty/serial/sh-sci.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ static void sci_rx_dma_release(struct sci_port *s)
12201220

12211221
s->chan_rx_saved = s->chan_rx = NULL;
12221222
s->cookie_rx[0] = s->cookie_rx[1] = -EINVAL;
1223-
dmaengine_terminate_all(chan);
1223+
dmaengine_terminate_sync(chan);
12241224
dma_free_coherent(chan->device->dev, s->buf_len_rx * 2, s->rx_buf[0],
12251225
sg_dma_address(&s->sg_rx[0]));
12261226
dma_release_channel(chan);
@@ -1296,7 +1296,7 @@ static void sci_tx_dma_release(struct sci_port *s)
12961296
cancel_work_sync(&s->work_tx);
12971297
s->chan_tx_saved = s->chan_tx = NULL;
12981298
s->cookie_tx = -EINVAL;
1299-
dmaengine_terminate_all(chan);
1299+
dmaengine_terminate_sync(chan);
13001300
dma_unmap_single(chan->device->dev, s->tx_dma_addr, UART_XMIT_SIZE,
13011301
DMA_TO_DEVICE);
13021302
dma_release_channel(chan);
@@ -1334,7 +1334,7 @@ static void sci_submit_rx(struct sci_port *s)
13341334

13351335
fail:
13361336
if (i)
1337-
dmaengine_terminate_all(chan);
1337+
dmaengine_terminate_async(chan);
13381338
for (i = 0; i < 2; i++)
13391339
s->cookie_rx[i] = -EINVAL;
13401340
s->active_rx = -EINVAL;
@@ -1452,7 +1452,7 @@ static enum hrtimer_restart rx_timer_fn(struct hrtimer *t)
14521452
}
14531453

14541454
/* Handle incomplete DMA receive */
1455-
dmaengine_terminate_all(s->chan_rx);
1455+
dmaengine_terminate_async(s->chan_rx);
14561456
read = sg_dma_len(&s->sg_rx[active]) - state.residue;
14571457

14581458
if (read) {

0 commit comments

Comments
 (0)