Re: [PATCH] DMA: Fix broken device refcounting

2007-10-29 Thread Haavard Skinnemoen
On Mon, 29 Oct 2007 09:02:34 -0700 "Nelson, Shannon" <[EMAIL PROTECTED]> wrote: > I tested this in my ioatdma setup and no longer get the panic. I'm good with > this if you two are happy with it. Looks good to me too, although I haven't had a chance to test it yet. Thanks, HÃ¥vard - To unsubs

RE: [PATCH] DMA: Fix broken device refcounting

2007-10-29 Thread Nelson, Shannon
>From: Williams, Dan J >On Sat, 2007-10-27 at 06:49 -0700, Haavard Skinnemoen wrote: >> On Fri, 26 Oct 2007 09:36:17 -0700 >> Dan Williams <[EMAIL PROTECTED]> wrote: >> >> > @@ -221,7 +220,6 @@ void dma_chan_cleanup(struct kref *kref) >> > { >> > struct dma_chan *chan = container_of(kref,

Re: [PATCH] DMA: Fix broken device refcounting

2007-10-28 Thread Shannon Nelson
On 10/27/07, Dan Williams <[EMAIL PROTECTED]> wrote: > On Sat, 2007-10-27 at 06:49 -0700, Haavard Skinnemoen wrote: > > On Fri, 26 Oct 2007 09:36:17 -0700 > > Dan Williams <[EMAIL PROTECTED]> wrote: > > > > > @@ -221,7 +220,6 @@ void dma_chan_cleanup(struct kref *kref) > > > { > > > struct d

Re: [PATCH] DMA: Fix broken device refcounting

2007-10-27 Thread Dan Williams
On Sat, 2007-10-27 at 06:49 -0700, Haavard Skinnemoen wrote: > On Fri, 26 Oct 2007 09:36:17 -0700 > Dan Williams <[EMAIL PROTECTED]> wrote: > > > @@ -221,7 +220,6 @@ void dma_chan_cleanup(struct kref *kref) > > { > > struct dma_chan *chan = container_of(kref, struct dma_chan, refcount); > >

Re: [PATCH] DMA: Fix broken device refcounting

2007-10-27 Thread Haavard Skinnemoen
On Fri, 26 Oct 2007 09:36:17 -0700 Dan Williams <[EMAIL PROTECTED]> wrote: > @@ -221,7 +220,6 @@ void dma_chan_cleanup(struct kref *kref) > { > struct dma_chan *chan = container_of(kref, struct dma_chan, refcount); > chan->device->device_free_chan_resources(chan); > - kref_put(&ch

RE: [PATCH] DMA: Fix broken device refcounting

2007-10-26 Thread Nelson, Shannon
>-Original Message- >From: Nelson, Shannon >Sent: Friday, October 26, 2007 10:00 AM >To: 'Haavard Skinnemoen' >Cc: Williams, Dan J; linux-kernel@vger.kernel.org; >[EMAIL PROTECTED] >Subject: RE: [PATCH] DMA: Fix broken device refcounting > >-- > &

RE: [PATCH] DMA: Fix broken device refcounting

2007-10-26 Thread Nelson, Shannon
>From: Haavard Skinnemoen [mailto:[EMAIL PROTECTED] > >When a DMA device is unregistered, its reference count is decremented >twice for each channel: Once dma_class_dev_release() and once in >dma_chan_cleanup(). This may result in the DMA device driver's >remove() function completing before all ch

Re: [PATCH] DMA: Fix broken device refcounting

2007-10-26 Thread Dan Williams
On Fri, 2007-10-26 at 09:12 -0700, Haavard Skinnemoen wrote: > I'm not sure if this is the correct way to solve it, but it seems to > work. The remove() function does not hang, which indicates that the > device's reference count does drop all the way to zero on > unregistration, which in turn indi

[PATCH] DMA: Fix broken device refcounting

2007-10-26 Thread Haavard Skinnemoen
When a DMA device is unregistered, its reference count is decremented twice for each channel: Once dma_class_dev_release() and once in dma_chan_cleanup(). This may result in the DMA device driver's remove() function completing before all channels have been cleaned up, causing lots of use-after-free