mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: next-20081121:WARNING: at drivers/dma/dmaengine.c:665 dma_async_device_unregister()
Date: Fri, 21 Nov 2008 23:43:59 -0800	[thread overview]
Message-ID: <20081121234359.767d4283@extreme> (raw)
In-Reply-To: <1227315224.32103.7.camel@dwillia2-linux.ch.intel.com>

On Fri, 21 Nov 2008 17:53:44 -0700
Dan Williams <dan.j.williams@intel.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@intel.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@gmail.com>
>     Signed-off-by: Dan Williams <dan.j.williams@intel.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..

  reply	other threads:[~2008-11-22  7:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-21 10:40 Alexander Beregalov
2008-11-21 17:17 ` Dan Williams
2008-11-22  0:53 ` Dan Williams
2008-11-22  7:43   ` Stephen Hemminger [this message]
2008-11-22 16:39     ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081121234359.767d4283@extreme \
    --to=shemminger@vyatta.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®