linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Missing kobject release methods?
@ 2003-10-27 16:31 Alan Stern
  2003-10-29 22:59 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Stern @ 2003-10-27 16:31 UTC (permalink / raw)
  To: Greg KH; +Cc: USB development list, linux-kernel

Greg:

For a long time, I've been getting debug warnings about missing release()  
methods in various kobjects.  They come up because your usb-2.5 tree has
DEBUG defined in a number of driver-model source files.

It's not easy to track down exactly what the objects in question are; the
driver-model/kobject system is a pretty tangled web of pointers and
subobjects.  I suspect the objects in question are actually embedded as
sub-structures of other things that do get released correctly, so these
messages may be completely safe to ignore.  But it would be better if they
weren't generated in the first place, because they fill up my system logs
and debugging screens with stack dumps.

The kobjects and subroutines that provoke these messages are:

	usb		in usb_major_cleanup()
	usb_host	in usb_host_cleanup()
	drivers		in bus_unregister()
	devices		in bus_unregister()
	usb		in usb_exit()
	class_obj	in usb_host_release()

To see for yourself, try rmmod'ing a USB device driver module and the 
usbcore module.

It oculd be that fixing this will be as simple as initializing a .release
method with a pointer to a function that does nothing in some place like 
lib/kobject.c:kset_init().  But I don't pretend to understand the details 
of kobjects and such well enough to really track this down.  Maybe you 
can.

Alan Stern


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Missing kobject release methods?
  2003-10-27 16:31 Missing kobject release methods? Alan Stern
@ 2003-10-29 22:59 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2003-10-29 22:59 UTC (permalink / raw)
  To: Alan Stern; +Cc: USB development list, linux-kernel

On Mon, Oct 27, 2003 at 11:31:44AM -0500, Alan Stern wrote:
> Greg:
> 
> For a long time, I've been getting debug warnings about missing release()  
> methods in various kobjects.  They come up because your usb-2.5 tree has
> DEBUG defined in a number of driver-model source files.

And because I have a "test for .release in a kobject" patch in my tree
to help me debug.  That's what you are seeing.

> It's not easy to track down exactly what the objects in question are;

Don't worry about these, they are all for things that are only
directories, and don't have release functions because they do not need
to at this time.  Pat is aware of these and someday we will divorce
kobjects from beeing needed just to create a subdirectory in sysfs.

These false warnings are the reason that patch never made it into the
main kernel tree, unlike the other .release checks in the driver model
code.

You can just disable that change in your copy of my tree if it's really
annoying you :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-29 23:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-27 16:31 Missing kobject release methods? Alan Stern
2003-10-29 22:59 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).