Commit 855c2e1
dmaengine: xilinx: xdma: Rework xdma_terminate_all()
Simplify xdma_xfer_stop(). Stop the dma engine and clear its status
register unconditionally - just do what its name states. This change
also allows to call it without grabbing a lock, which minimizes
the total time spent with a spinlock held.
Delete the currently processed vd.node from the vc.desc_issued list
prior to passing it to vchan_terminate_vdesc(). In case there's more
than one descriptor pending on vc.desc_issued list, calling
vchan_terminate_desc() results in losing the link between
vc.desc_issued list head and the second descriptor on the list. Doing so
results in resources leakege, as vchan_dma_desc_free_list() won't be
able to properly free memory resources attached to descriptors,
resulting in dma_pool_destroy() failure.
Don't call vchan_dma_desc_free_list() from within xdma_terminate_all().
Move all terminated descriptors to the vc.desc_terminated list instead.
This allows to postpone freeing memory resources associated with
descriptors until the call to vchan_synchronize(), which is called from
xdma_synchronize() callback. This is the right way to do it -
xdma_terminate_all() should return as soon as possible, while freeing
resources (that may be time consuming in case of large number of
descriptors) can be done safely later.
Fixes: f5c392d ("dmaengine: xilinx: xdma: Add terminate_all/synchronize callbacks")
Signed-off-by: Jan Kuliga <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>1 parent e5bc76b commit 855c2e1
1 file changed
+15
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
383 | | - | |
384 | 382 | | |
385 | | - | |
386 | | - | |
387 | | - | |
| 383 | + | |
| 384 | + | |
388 | 385 | | |
389 | 386 | | |
390 | 387 | | |
391 | 388 | | |
392 | 389 | | |
393 | 390 | | |
394 | 391 | | |
395 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
509 | 508 | | |
510 | 509 | | |
511 | 510 | | |
512 | 511 | | |
513 | | - | |
514 | 512 | | |
515 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
516 | 517 | | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
522 | 522 | | |
523 | | - | |
524 | 523 | | |
| 524 | + | |
| 525 | + | |
525 | 526 | | |
526 | | - | |
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| |||
0 commit comments