[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081107114525.25190.7557.stgit@linux.site>
Date: Fri, 07 Nov 2008 12:45:52 +0100
From: Maciej Sosnowski <maciej.sosnowski@...el.com>
To: dan.j.williams@...el.com
Cc: tom.s.picard@...el.com, mark_rustad@...tech.com,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
stable@...nel.org
Subject: [PATCH 1/4] I/OAT: fix channel resources free for not allocated
channels
From: Maciej Sosnowski <maciej.sosnowski@...el.com>
If the ioatdma driver is loaded but not used it does not allocate descriptors.
Before it frees channel resources it should first be sure
that they have been previously allocated.
Cc: <stable@...nel.org>
Signed-off-by: Maciej Sosnowski <maciej.sosnowski@...el.com>
Tested-by: Tom Picard <tom.s.picard@...el.com>
Signed-off-by: Dan Williams <dan.j.williams@...el.com>
---
drivers/dma/ioat_dma.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
index b0438c4..687eef7 100644
--- a/drivers/dma/ioat_dma.c
+++ b/drivers/dma/ioat_dma.c
@@ -807,6 +807,12 @@ static void ioat_dma_free_chan_resources
struct ioat_desc_sw *desc, *_desc;
int in_use_descs = 0;
+ /* Before freeing channel resources first check
+ * if they have been previously allocated for this channel.
+ */
+ if (ioat_chan->desccount == 0)
+ return;
+
tasklet_disable(&ioat_chan->cleanup_task);
ioat_dma_memcpy_cleanup(ioat_chan);
@@ -869,6 +875,7 @@ static void ioat_dma_free_chan_resources
ioat_chan->last_completion = ioat_chan->completion_addr = 0;
ioat_chan->pending = 0;
ioat_chan->dmacount = 0;
+ ioat_chan->desccount = 0;
ioat_chan->watchdog_completion = 0;
ioat_chan->last_compl_desc_addr_hw = 0;
ioat_chan->watchdog_tcp_cookie =
--
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