[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJd=RBBU7SvVLmVqR_LmJMWG=rgya80DbdPNEc-nR=_d4YQrDQ@mail.gmail.com>
Date: Wed, 27 Jul 2011 21:24:45 +0800
From: Hillf Danton <dhillf@...il.com>
To: Vinod Koul <vinod.koul@...el.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Steven Rostedt <rostedt@...dmis.org>
Subject: [RFC patch] DMA engine/Langwell: release LLI pool
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@...il.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)
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists