lkml.org 
[lkml]   [2011]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC patch] DMA engine/Langwell: release LLI pool
From
Date
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@gmail.com>
> ---
> 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@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/


--
~Vinod



\
 
 \ /
  Last update: 2011-08-08 19:27    [W:0.046 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site