Re: [RFC patch] DMA engine/Langwell: release LLI pool

From: Koul, Vinod
Date: Mon Aug 08 2011 - 13:25:00 EST


On Wed, 2011-07-27 at 21:24 +0800, Hillf Danton wrote:
> When releasing resources allocated before for DMA channel, checking LLI pool is
> added and it is reclaimed if still available.
>
> Signed-off-by: Hillf Danton <dhillf@xxxxxxxxx>
> ---
> drivers/dma/intel_mid_dma.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
> index f653517..4c758fc 100644
> --- a/drivers/dma/intel_mid_dma.c
> +++ b/drivers/dma/intel_mid_dma.c
> @@ -833,6 +833,10 @@ static void
> intel_mid_dma_free_chan_resources(struct dma_chan *chan)
And this one, as well
> midc->descs_allocated = 0;
> list_for_each_entry_safe(desc, _desc, &midc->active_list, desc_node) {
> list_del(&desc->desc_node);
> + if (desc->lli != NULL) {
> + pci_pool_free(desc->lli_pool, desc->lli, desc->lli_phys);
> + pci_pool_destroy(desc->lli_pool);
> + }
> pci_pool_free(mid->dma_pool, desc, desc->txd.phys);
> }
> list_for_each_entry_safe(desc, _desc, &midc->free_list, desc_node) {
> @@ -841,6 +845,10 @@ static void
> intel_mid_dma_free_chan_resources(struct dma_chan *chan)
> }
> list_for_each_entry_safe(desc, _desc, &midc->queue, desc_node) {
> list_del(&desc->desc_node);
> + if (desc->lli != NULL) {
> + pci_pool_free(desc->lli_pool, desc->lli, desc->lli_phys);
> + pci_pool_destroy(desc->lli_pool);
> + }
> pci_pool_free(mid->dma_pool, desc, desc->txd.phys);
> }
> spin_unlock_bh(&midc->lock);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/


--
~Vinod

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/