[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081121234359.767d4283@extreme>
Date: Fri, 21 Nov 2008 23:43:59 -0800
From: Stephen Hemminger <shemminger@...tta.com>
To: Dan Williams <dan.j.williams@...el.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: next-20081121:WARNING: at drivers/dma/dmaengine.c:665
dma_async_device_unregister()
On Fri, 21 Nov 2008 17:53:44 -0700
Dan Williams <dan.j.williams@...el.com> wrote:
> On Fri, 2008-11-21 at 03:40 -0700, Alexander Beregalov wrote:
> > Hi
> >
> > It occured during shutdown process:
> >
> > sd 0:2:0:0: [sda] Synchronizing SCSI cache
> > ioatdma 0000:00:08.0: Removing dma and dca services
> > ------------[ cut here ]------------
> > WARNING: at drivers/dma/dmaengine.c:665 dma_async_device_unregister+0x90/0xd0()
> > dma_async_device_unregister called while 1 clients hold a reference
> ...
> > WARNING: at drivers/base/core.c:122 device_release+0x66/0x68()
> > Device 'dma0chan0' does not have a release() function, it is broken and must be
> > fixed.
>
> The following fixes these up for me. Maciej, do these look alright?:
>
> commit 16f5de60e2406c0c879627177aecd7ef489c30e5
> Author: Dan Williams <dan.j.williams@...el.com>
> Date: Fri Nov 21 17:48:55 2008 -0700
>
> dmaengine: add a release for dma class devices
>
> Resolves:
> WARNING: at drivers/base/core.c:122 device_release+0x4d/0x52()
> Device 'dma0chan0' does not have a release() function, it is broken and must be fixed.
>
> Reported-by: Alexander Beregalov <a.beregalov@...il.com>
> Signed-off-by: Dan Williams <dan.j.williams@...el.com>
>
> diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
> index 6fc6595..94dcc64 100644
> --- a/drivers/dma/dmaengine.c
> +++ b/drivers/dma/dmaengine.c
> @@ -103,9 +103,16 @@ static struct device_attribute dma_attrs[] = {
> __ATTR_NULL
> };
>
> +static void chan_dev_release(struct device *dev)
> +{
> + /* nothing to do */
> + do { } while (0);
> +}
> +
> static struct class dma_devclass = {
> .name = "dma",
> .dev_attrs = dma_attrs,
> + .dev_release = chan_dev_release,
> };
The warning is there for a reason. Device objects can live in sysfs even
after the module is removed. You just wallpapered over the problem..
--
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