Commit 0c32269d813c148194524fc8272f7ec1f7c90e6a
Committed by
Dan Williams
1 parent
2292b880e4
Exists in
master
and in
4 other branches
DMAENGINE: ste_dma40: avoid doing unnessecary suspend
Avoid doing unnessecary suspend when modifying logical channels. Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Showing 1 changed file with 7 additions and 32 deletions Side-by-side Diff
drivers/dma/ste_dma40.c
... | ... | @@ -595,6 +595,7 @@ |
595 | 595 | u32 val; |
596 | 596 | unsigned long flags; |
597 | 597 | |
598 | + /* Notice, that disable requires the physical channel to be stopped */ | |
598 | 599 | if (do_enable) |
599 | 600 | val = D40_ACTIVATE_EVENTLINE; |
600 | 601 | else |
601 | 602 | |
602 | 603 | |
... | ... | @@ -740,18 +741,10 @@ |
740 | 741 | |
741 | 742 | static int d40_start(struct d40_chan *d40c) |
742 | 743 | { |
743 | - int err; | |
744 | - | |
745 | - if (d40c->log_num != D40_PHY_CHAN) { | |
746 | - err = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ); | |
747 | - if (err) | |
748 | - return err; | |
744 | + if (d40c->log_num != D40_PHY_CHAN) | |
749 | 745 | d40_config_set_event(d40c, true); |
750 | - } | |
751 | 746 | |
752 | - err = d40_channel_execute_command(d40c, D40_DMA_RUN); | |
753 | - | |
754 | - return err; | |
747 | + return d40_channel_execute_command(d40c, D40_DMA_RUN); | |
755 | 748 | } |
756 | 749 | |
757 | 750 | static struct d40_desc *d40_queue_start(struct d40_chan *d40c) |
... | ... | @@ -1340,7 +1333,6 @@ |
1340 | 1333 | void __iomem *active_reg; |
1341 | 1334 | u32 status; |
1342 | 1335 | u32 event; |
1343 | - int res; | |
1344 | 1336 | |
1345 | 1337 | spin_lock_irqsave(&d40c->lock, flags); |
1346 | 1338 | |
... | ... | @@ -1359,10 +1351,6 @@ |
1359 | 1351 | goto _exit; |
1360 | 1352 | } |
1361 | 1353 | |
1362 | - res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ); | |
1363 | - if (res != 0) | |
1364 | - goto _exit; | |
1365 | - | |
1366 | 1354 | if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH || |
1367 | 1355 | d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) |
1368 | 1356 | event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dst_dev_type); |
... | ... | @@ -1379,12 +1367,6 @@ |
1379 | 1367 | |
1380 | 1368 | if (status != D40_DMA_RUN) |
1381 | 1369 | is_paused = true; |
1382 | - | |
1383 | - /* Resume the other logical channels if any */ | |
1384 | - if (d40_chan_has_events(d40c)) | |
1385 | - res = d40_channel_execute_command(d40c, | |
1386 | - D40_DMA_RUN); | |
1387 | - | |
1388 | 1370 | _exit: |
1389 | 1371 | spin_unlock_irqrestore(&d40c->lock, flags); |
1390 | 1372 | return is_paused; |
1391 | 1373 | |
1392 | 1374 | |
1393 | 1375 | |
... | ... | @@ -1430,20 +1412,13 @@ |
1430 | 1412 | |
1431 | 1413 | spin_lock_irqsave(&d40c->lock, flags); |
1432 | 1414 | |
1433 | - if (d40c->log_num != D40_PHY_CHAN) { | |
1434 | - res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ); | |
1435 | - if (res) | |
1436 | - goto out; | |
1437 | - | |
1438 | - /* If bytes left to transfer or linked tx resume job */ | |
1439 | - if (d40_residue(d40c) || d40_tx_is_linked(d40c)) { | |
1415 | + /* If bytes left to transfer or linked tx resume job */ | |
1416 | + if (d40_residue(d40c) || d40_tx_is_linked(d40c)) { | |
1417 | + if (d40c->log_num != D40_PHY_CHAN) | |
1440 | 1418 | d40_config_set_event(d40c, true); |
1441 | - res = d40_channel_execute_command(d40c, D40_DMA_RUN); | |
1442 | - } | |
1443 | - } else if (d40_residue(d40c) || d40_tx_is_linked(d40c)) | |
1444 | 1419 | res = d40_channel_execute_command(d40c, D40_DMA_RUN); |
1420 | + } | |
1445 | 1421 | |
1446 | -out: | |
1447 | 1422 | spin_unlock_irqrestore(&d40c->lock, flags); |
1448 | 1423 | return res; |
1449 | 1424 | } |