RE: [PATCH] DMA: Fix broken device refcounting

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Haavard Skinnemoen <hskinnemoen@...>
Cc: Williams, Dan J <dan.j.williams@...>, <linux-kernel@...>, <akpm@...>
Date: Friday, October 26, 2007 - 12:59 pm

>From: Haavard Skinnemoen [mailto:hskinnemoen@atmel.com] 

As Dan said, we've been discussing this offline, and hadn't come to an
agreement yet.  My version of the patch is the opposite of yours -
instead of adding a kref_get(), I remove one of the kref_put() calls.
--

When a channel is removed from dmaengine, too many kref_put() calls
are made and the device removal happens too soon, usually causing
a panic.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
---

 drivers/dma/dmaengine.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 8248992..144a1b7 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -131,7 +131,6 @@ static void dma_async_device_cleanup(struct kref
*kref);
 static void dma_class_dev_release(struct class_device *cd)
 {
 	struct dma_chan *chan = container_of(cd, struct dma_chan,
class_dev);
-	kref_put(&chan->device->refcount, dma_async_device_cleanup);
 }
 
 static struct class dma_devclass = {
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] DMA: Fix broken device refcounting, Haavard Skinnemoen, (Fri Oct 26, 12:12 pm)
RE: [PATCH] DMA: Fix broken device refcounting, Nelson, Shannon, (Fri Oct 26, 12:59 pm)
Re: [PATCH] DMA: Fix broken device refcounting, Dan Williams, (Fri Oct 26, 12:36 pm)
Re: [PATCH] DMA: Fix broken device refcounting, Haavard Skinnemoen, (Sat Oct 27, 9:49 am)
Re: [PATCH] DMA: Fix broken device refcounting, Dan Williams, (Sat Oct 27, 3:12 pm)
RE: [PATCH] DMA: Fix broken device refcounting, Nelson, Shannon, (Mon Oct 29, 12:02 pm)
Re: [PATCH] DMA: Fix broken device refcounting, Haavard Skinnemoen, (Mon Oct 29, 12:11 pm)
Re: [PATCH] DMA: Fix broken device refcounting, Shannon Nelson, (Sun Oct 28, 3:17 pm)