All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-sh <linux-sh@vger.kernel.org>
Subject: Re: kobject oops with maple bus
Date: Mon, 28 Jan 2008 19:23:45 +0000	[thread overview]
Message-ID: <20080128192345.GA5006@kroah.com> (raw)
In-Reply-To: <26713.85.118.17.158.1201513309.squirrel@newgolddream.dyndns.info>

On Mon, Jan 28, 2008 at 09:41:49AM -0000, Adrian McMenamin wrote:
> On Sat, January 26, 2008 8:44 pm, Greg KH wrote:
> > On Sat, Jan 26, 2008 at 07:53:20PM +0000, Adrian McMenamin wrote:
> >> Greg,
> >>
> >> Just updated my git to the latest sources and get these (seemingly
> >> non-fatal) oops with the Dreamcast maple bus. I'll investigate further,
> >> but they may mean something to out out of the box.
> >>
> >> Adrian
> 
> ....
> 
> >> [    0.000000] kobject (8cc2d360): tried to init an initialized object,
> >> something is seriously wrong.
> >
> > The problem is here.  You have possibly already initialized this object,
> > or called 'kobject_get' on it before registering it with the driver
> > core.  This is a new sanity check that has been in the -mm tree for
> > years :)
> >
> > So I think something needs to be fixed in the code.  Do you want me to
> > take a look at it?
> >
> > thanks,
> >
> > greg k-h
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> 
> Greg,
> 
> Have now patched that. But I am trying to hunt down another bug - which
> seems memory related. After N hotplug events (where N is greater than two
> and less than about 100) I get this below - either indicating something
> very wrong in SLUB (unlikely) or a memory leak in my driver (sadly, much
> more likely).
> 
> I cannot see anything obvious and my best guess is that I am freeing up
> the underlying struct device incorrectly - this is allocated currently as
> staticly allocated member of a dynamically allocated struct maple_device.
> It gets hit by the kfree(mdev) - is that going to cause a problem?

Yes, you can not free the struct device on your own, you must let the
release function clean it up for you.

Try enabling CONFIG_KOBJECT_DEBUG as well as CONFIG_DEBUG_DRIVER and see
if that shows you some more clues as to what you are doing wrong here.

And please let me know what you find, in talking to Ingo, I need to find
all the "wrong cases" that this code is being used in to try to make it
easier to prevent this from happening again.

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-sh <linux-sh@vger.kernel.org>
Subject: Re: kobject oops with maple bus
Date: Mon, 28 Jan 2008 11:23:45 -0800	[thread overview]
Message-ID: <20080128192345.GA5006@kroah.com> (raw)
In-Reply-To: <26713.85.118.17.158.1201513309.squirrel@newgolddream.dyndns.info>

On Mon, Jan 28, 2008 at 09:41:49AM -0000, Adrian McMenamin wrote:
> On Sat, January 26, 2008 8:44 pm, Greg KH wrote:
> > On Sat, Jan 26, 2008 at 07:53:20PM +0000, Adrian McMenamin wrote:
> >> Greg,
> >>
> >> Just updated my git to the latest sources and get these (seemingly
> >> non-fatal) oops with the Dreamcast maple bus. I'll investigate further,
> >> but they may mean something to out out of the box.
> >>
> >> Adrian
> 
> ....
> 
> >> [    0.000000] kobject (8cc2d360): tried to init an initialized object,
> >> something is seriously wrong.
> >
> > The problem is here.  You have possibly already initialized this object,
> > or called 'kobject_get' on it before registering it with the driver
> > core.  This is a new sanity check that has been in the -mm tree for
> > years :)
> >
> > So I think something needs to be fixed in the code.  Do you want me to
> > take a look at it?
> >
> > thanks,
> >
> > greg k-h
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> 
> Greg,
> 
> Have now patched that. But I am trying to hunt down another bug - which
> seems memory related. After N hotplug events (where N is greater than two
> and less than about 100) I get this below - either indicating something
> very wrong in SLUB (unlikely) or a memory leak in my driver (sadly, much
> more likely).
> 
> I cannot see anything obvious and my best guess is that I am freeing up
> the underlying struct device incorrectly - this is allocated currently as
> staticly allocated member of a dynamically allocated struct maple_device.
> It gets hit by the kfree(mdev) - is that going to cause a problem?

Yes, you can not free the struct device on your own, you must let the
release function clean it up for you.

Try enabling CONFIG_KOBJECT_DEBUG as well as CONFIG_DEBUG_DRIVER and see
if that shows you some more clues as to what you are doing wrong here.

And please let me know what you find, in talking to Ingo, I need to find
all the "wrong cases" that this code is being used in to try to make it
easier to prevent this from happening again.

thanks,

greg k-h

  reply	other threads:[~2008-01-28 19:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-26 19:53 kobject oops with maple bus Adrian McMenamin
2008-01-26 19:53 ` Adrian McMenamin
2008-01-26 19:55 ` Adrian McMenamin
2008-01-26 20:44 ` Greg KH
2008-01-26 20:44   ` Greg KH
2008-01-26 22:01   ` Adrian McMenamin
2008-01-26 22:01     ` Adrian McMenamin
2008-01-28  9:41   ` Adrian McMenamin
2008-01-28  9:41     ` Adrian McMenamin
2008-01-28 19:23     ` Greg KH [this message]
2008-01-28 19:23       ` Greg KH

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=20080128192345.GA5006@kroah.com \
    --to=greg@kroah.com \
    --cc=adrian@newgolddream.dyndns.info \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.