d40d 634 drivers/dma/ste_dma40.c static int d40_pool_lli_alloc(struct d40_chan *d40c, struct d40_desc *d40d, d40d 647 drivers/dma/ste_dma40.c base = d40d->lli_pool.pre_alloc_lli; d40d 648 drivers/dma/ste_dma40.c d40d->lli_pool.size = sizeof(d40d->lli_pool.pre_alloc_lli); d40d 649 drivers/dma/ste_dma40.c d40d->lli_pool.base = NULL; d40d 651 drivers/dma/ste_dma40.c d40d->lli_pool.size = lli_len * 2 * align; d40d 653 drivers/dma/ste_dma40.c base = kmalloc(d40d->lli_pool.size + align, GFP_NOWAIT); d40d 654 drivers/dma/ste_dma40.c d40d->lli_pool.base = base; d40d 656 drivers/dma/ste_dma40.c if (d40d->lli_pool.base == NULL) d40d 661 drivers/dma/ste_dma40.c d40d->lli_log.src = PTR_ALIGN(base, align); d40d 662 drivers/dma/ste_dma40.c d40d->lli_log.dst = d40d->lli_log.src + lli_len; d40d 664 drivers/dma/ste_dma40.c d40d->lli_pool.dma_addr = 0; d40d 666 drivers/dma/ste_dma40.c d40d->lli_phy.src = PTR_ALIGN(base, align); d40d 667 drivers/dma/ste_dma40.c d40d->lli_phy.dst = d40d->lli_phy.src + lli_len; d40d 669 drivers/dma/ste_dma40.c d40d->lli_pool.dma_addr = dma_map_single(d40c->base->dev, d40d 670 drivers/dma/ste_dma40.c d40d->lli_phy.src, d40d 671 drivers/dma/ste_dma40.c d40d->lli_pool.size, d40d 675 drivers/dma/ste_dma40.c d40d->lli_pool.dma_addr)) { d40d 676 drivers/dma/ste_dma40.c kfree(d40d->lli_pool.base); d40d 677 drivers/dma/ste_dma40.c d40d->lli_pool.base = NULL; d40d 678 drivers/dma/ste_dma40.c d40d->lli_pool.dma_addr = 0; d40d 686 drivers/dma/ste_dma40.c static void d40_pool_lli_free(struct d40_chan *d40c, struct d40_desc *d40d) d40d 688 drivers/dma/ste_dma40.c if (d40d->lli_pool.dma_addr) d40d 689 drivers/dma/ste_dma40.c dma_unmap_single(d40c->base->dev, d40d->lli_pool.dma_addr, d40d 690 drivers/dma/ste_dma40.c d40d->lli_pool.size, DMA_TO_DEVICE); d40d 692 drivers/dma/ste_dma40.c kfree(d40d->lli_pool.base); d40d 693 drivers/dma/ste_dma40.c d40d->lli_pool.base = NULL; d40d 694 drivers/dma/ste_dma40.c d40d->lli_pool.size = 0; d40d 695 drivers/dma/ste_dma40.c d40d->lli_log.src = NULL; d40d 696 drivers/dma/ste_dma40.c d40d->lli_log.dst = NULL; d40d 697 drivers/dma/ste_dma40.c d40d->lli_phy.src = NULL; d40d 698 drivers/dma/ste_dma40.c d40d->lli_phy.dst = NULL; d40d 702 drivers/dma/ste_dma40.c struct d40_desc *d40d) d40d 718 drivers/dma/ste_dma40.c d40c->base->lcla_pool.alloc_map[idx] = d40d; d40d 719 drivers/dma/ste_dma40.c d40d->lcla_alloc++; d40d 731 drivers/dma/ste_dma40.c struct d40_desc *d40d) d40d 745 drivers/dma/ste_dma40.c if (d40c->base->lcla_pool.alloc_map[idx] == d40d) { d40d 747 drivers/dma/ste_dma40.c d40d->lcla_alloc--; d40d 748 drivers/dma/ste_dma40.c if (d40d->lcla_alloc == 0) { d40d 761 drivers/dma/ste_dma40.c static void d40_desc_remove(struct d40_desc *d40d) d40d 763 drivers/dma/ste_dma40.c list_del(&d40d->node); d40d 793 drivers/dma/ste_dma40.c static void d40_desc_free(struct d40_chan *d40c, struct d40_desc *d40d) d40d 796 drivers/dma/ste_dma40.c d40_pool_lli_free(d40c, d40d); d40d 797 drivers/dma/ste_dma40.c d40_lcla_free_all(d40c, d40d); d40d 798 drivers/dma/ste_dma40.c kmem_cache_free(d40c->base->desc_slab, d40d); d40d 940 drivers/dma/ste_dma40.c static void d40_desc_load(struct d40_chan *d40c, struct d40_desc *d40d) d40d 943 drivers/dma/ste_dma40.c d40_phy_lli_load(d40c, d40d); d40d 944 drivers/dma/ste_dma40.c d40d->lli_current = d40d->lli_len; d40d 946 drivers/dma/ste_dma40.c d40_log_lli_to_lcxa(d40c, d40d); d40d 1110 drivers/dma/ste_dma40.c struct d40_desc *d40d; d40d 1114 drivers/dma/ste_dma40.c while ((d40d = d40_first_done(d40c))) { d40d 1115 drivers/dma/ste_dma40.c d40_desc_remove(d40d); d40d 1116 drivers/dma/ste_dma40.c d40_desc_free(d40c, d40d); d40d 1120 drivers/dma/ste_dma40.c while ((d40d = d40_first_active_get(d40c))) { d40d 1121 drivers/dma/ste_dma40.c d40_desc_remove(d40d); d40d 1122 drivers/dma/ste_dma40.c d40_desc_free(d40c, d40d); d40d 1126 drivers/dma/ste_dma40.c while ((d40d = d40_first_queued(d40c))) { d40d 1127 drivers/dma/ste_dma40.c d40_desc_remove(d40d); d40d 1128 drivers/dma/ste_dma40.c d40_desc_free(d40c, d40d); d40d 1132 drivers/dma/ste_dma40.c while ((d40d = d40_first_pending(d40c))) { d40d 1133 drivers/dma/ste_dma40.c d40_desc_remove(d40d); d40d 1134 drivers/dma/ste_dma40.c d40_desc_free(d40c, d40d); d40d 1139 drivers/dma/ste_dma40.c list_for_each_entry_safe(d40d, _d, &d40c->client, node) { d40d 1140 drivers/dma/ste_dma40.c d40_desc_remove(d40d); d40d 1141 drivers/dma/ste_dma40.c d40_desc_free(d40c, d40d); d40d 1146 drivers/dma/ste_dma40.c list_for_each_entry_safe(d40d, _d, d40d 1148 drivers/dma/ste_dma40.c d40_desc_remove(d40d); d40d 1149 drivers/dma/ste_dma40.c d40_desc_free(d40c, d40d); d40d 1470 drivers/dma/ste_dma40.c struct d40_desc *d40d = container_of(tx, struct d40_desc, txd); d40d 1476 drivers/dma/ste_dma40.c d40_desc_queue(d40c, d40d); d40d 1489 drivers/dma/ste_dma40.c struct d40_desc *d40d; d40d 1493 drivers/dma/ste_dma40.c d40d = d40_first_queued(d40c); d40d 1495 drivers/dma/ste_dma40.c if (d40d != NULL) { d40d 1502 drivers/dma/ste_dma40.c d40_desc_remove(d40d); d40d 1505 drivers/dma/ste_dma40.c d40_desc_submit(d40c, d40d); d40d 1508 drivers/dma/ste_dma40.c d40_desc_load(d40c, d40d); d40d 1517 drivers/dma/ste_dma40.c return d40d; d40d 1523 drivers/dma/ste_dma40.c struct d40_desc *d40d; d40d 1526 drivers/dma/ste_dma40.c d40d = d40_first_active_get(d40c); d40d 1528 drivers/dma/ste_dma40.c if (d40d == NULL) d40d 1531 drivers/dma/ste_dma40.c if (d40d->cyclic) { d40d 1538 drivers/dma/ste_dma40.c if (d40d->lli_current < d40d->lli_len d40d 1541 drivers/dma/ste_dma40.c d40_lcla_free_all(d40c, d40d); d40d 1542 drivers/dma/ste_dma40.c d40_desc_load(d40c, d40d); d40d 1545 drivers/dma/ste_dma40.c if (d40d->lli_current == d40d->lli_len) d40d 1546 drivers/dma/ste_dma40.c d40d->lli_current = 0; d40d 1549 drivers/dma/ste_dma40.c d40_lcla_free_all(d40c, d40d); d40d 1551 drivers/dma/ste_dma40.c if (d40d->lli_current < d40d->lli_len) { d40d 1552 drivers/dma/ste_dma40.c d40_desc_load(d40c, d40d); d40d 1565 drivers/dma/ste_dma40.c d40_desc_remove(d40d); d40d 1566 drivers/dma/ste_dma40.c d40_desc_done(d40c, d40d); d40d 1577 drivers/dma/ste_dma40.c struct d40_desc *d40d; d40d 1585 drivers/dma/ste_dma40.c d40d = d40_first_done(d40c); d40d 1586 drivers/dma/ste_dma40.c if (d40d == NULL) { d40d 1588 drivers/dma/ste_dma40.c d40d = d40_first_active_get(d40c); d40d 1589 drivers/dma/ste_dma40.c if (d40d == NULL || !d40d->cyclic) d40d 1593 drivers/dma/ste_dma40.c if (!d40d->cyclic) d40d 1594 drivers/dma/ste_dma40.c dma_cookie_complete(&d40d->txd); d40d 1606 drivers/dma/ste_dma40.c callback_active = !!(d40d->txd.flags & DMA_PREP_INTERRUPT); d40d 1607 drivers/dma/ste_dma40.c dmaengine_desc_get_callback(&d40d->txd, &cb); d40d 1609 drivers/dma/ste_dma40.c if (!d40d->cyclic) { d40d 1610 drivers/dma/ste_dma40.c if (async_tx_test_ack(&d40d->txd)) { d40d 1611 drivers/dma/ste_dma40.c d40_desc_remove(d40d); d40d 1612 drivers/dma/ste_dma40.c d40_desc_free(d40c, d40d); d40d 1613 drivers/dma/ste_dma40.c } else if (!d40d->is_in_client_list) { d40d 1614 drivers/dma/ste_dma40.c d40_desc_remove(d40d); d40d 1615 drivers/dma/ste_dma40.c d40_lcla_free_all(d40c, d40d); d40d 1616 drivers/dma/ste_dma40.c list_add_tail(&d40d->node, &d40c->client); d40d 1617 drivers/dma/ste_dma40.c d40d->is_in_client_list = true;