login
Header Space

 
 

Re: 2.6.25 sysdev API problem

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Greg KH <gregkh@...>
Cc: Mikael Pettersson <mikpe@...>, <linux-kernel@...>
Date: Saturday, March 8, 2008 - 4:38 pm

Greg KH writes:
 > On Sat, Mar 08, 2008 at 04:56:39PM +0100, Mikael Pettersson wrote:
 > > In kernels up to and including 2.6.24, it was possible to
 > > register-then-unregister a sysdev_class/sys_device pair
 > > multiple times. Starting with the 2.6.24-git1 kernel, doing
 > > so causes a warning
 > > 
 > > kobject (f88e96c8): tried to init an initialized object, something is seriously wrong
 > 
 > This is a warning only, I have a patch queued up to fix this.  I've
 > included it below.
 > 
 > > the second time the class/device pair is registered, followed
 > > soon thereafter by random BUG()s and a kernel panic.
 > 
 > That's odd.  I don't think that is related, but it might be.  Can you
 > try the patch and let me know if it still happens?

The patch silenced the warning, but I still got a BUG() in
cache_alloc_refill() shortly after loading the test module.

(The machine needs some activity before the BUG() happens,
a few sync;dmesg;ps commands suffice for me.)

If I change the test module to do the sysdev_register stuff
once in module_init and the unregister stuff once in module_exit,
as opposed to once per "session" using the device, then things
work fine and I can't crash the kernel even if I repeatedly
insmod and rmmod the module. This indicates that some other part
of the sysdev object's state, apart from the state_initialized
flag, must also be cleaned up in the unregister() path.

I'll continue investigating this tomorrow.

/Mikael
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.25 sysdev API problem, Mikael Pettersson, (Sat Mar 8, 11:56 am)
Re: 2.6.25 sysdev API problem, Greg KH, (Sat Mar 8, 2:47 pm)
Re: 2.6.25 sysdev API problem, Balaji Rao, (Sat Mar 8, 4:57 pm)
Re: 2.6.25 sysdev API problem, Mikael Pettersson, (Sat Mar 8, 4:38 pm)
speck-geostationary