2008-01-26 19:54:12

by Adrian McMenamin

[permalink] [raw]
Subject: kobject oops with maple bus

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




dreamy:~# [ 0.000000] Linux version 2.6.24-gf0ea9c3d-dirty (adrian@bossclass) (gcc version 3.4.6) #328 PREEMPT Sat Jan 26 19:45:30 GMT 2008
[ 0.000000] console [sercon0] enabled
[ 0.000000] Booting machvec: Sega Dreamcast
[ 0.000000] Node 0: start_pfn = 0xc000, low = 0xd000
[ 0.000000] Zone PFN ranges:
[ 0.000000] Normal 49152 -> 53248
[ 0.000000] Movable zone start PFN for each node
[ 0.000000] early_node_map[1] active PFN ranges
[ 0.000000] 0: 49152 -> 53248
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 4064
[ 0.000000] Kernel command line: root=/dev/nfs rw nfsroot=192.168.61.50:/home/adrian/debdist ip=dhcp earlyprintk=serial video=pvr2fb:640x480-32@60 consol7
[ 0.000000] PID hash table entries: 64 (order: 6, 256 bytes)
[ 0.000000] Using tmu for system timer
[ 0.000000] Using 12.469 MHz high precision timer.
[ 0.000000] Console: colour dummy device 80x25
[ 0.000000] Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Memory: 13468k/16384k available (1918k kernel code, 645k data, 96k init)
[ 0.000000] PVR=040205c1 CVR=00000000 PRR=00000000
[ 0.000000] I-cache : n_ways=1 n_sets=256 way_incr=8192
[ 0.000000] I-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2
[ 0.000000] D-cache : n_ways=1 n_sets=512 way_incr=16384
[ 0.000000] D-cache : entry_mask=0x00003fe0 alias_mask=0x00003000 n_aliases=4
[ 0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
[ 0.000000] Mount-cache hash table entries: 512
[ 0.000000] CPU: SH7750
[ 0.000000] net_namespace: 64 bytes
[ 0.000000] NET: Registered protocol family 16
[ 0.000000] Maple bus at (0, 0): Connected function 0x0
[ 0.000000] No maple driver found for this device
[ 0.000000] Maple bus at (1, 0): Connected function 0x0
[ 0.000000] No maple driver found for this device
[ 0.000000] Maple bus at (2, 0): Connected function 0x0
[ 0.000000] No maple driver found for this device
[ 0.000000] Maple bus at (3, 0): Connected function 0x0
[ 0.000000] No maple driver found for this device
[ 0.000000] Maple bus core now registered.
[ 0.000000] DMA: Registering DMA API.
[ 0.000000] DMA: Registering sh_dmac handler (4 channels).
[ 0.000000] Maple bus at (0, 0): Connected function 0x1
[ 0.000000] No maple driver found for this device
[ 0.000000] kobject (8cc2d360): tried to init an initialized object, something is seriously wrong.
[ 0.000000] Stack: (0x8cc1be88 to 0x8cc1c000)
[ 0.000000] be80: 8c00762e 8cc1be98 8c27d050 8cc2d360 8c103890 8cc1bea0
[ 0.000000] bea0: 8c14435e 8cc1beb0 8cc2d200 8cc2d2f8 8cc2d200 8c144aae 8cc1bec0 8cc2d2f8
[ 0.000000] bec0: 8c159aa8 8cc1becc 00000001 8c159e58 8cc1beec 8cc69880 fffffffe 8c159d20
[ 0.000000] bee0: 8c27e14c 8cc2d200 8c27e13c 8cc1bf10 8c02e7c0 8cc0ea3c 8c1dbf60 8c02a2da
[ 0.000000] bf00: 8cc1bf1c 8c018b60 fffffffe 8c159d20 ffffff0f 8cc01240 8c27e13c 8c02a428
[ 0.000000] bf20: 8cc1bf3c 8c02e7c0 <6>DMA: Registering pvr2_dmac handler (1 channel).
[ 0.000000] 8c02a220 8c02e940 8c02e200 8cc01248 8cc01240 00000000
[ 0.000000] bf40: <6>DMA: Registering g2_dmac handler (4 channels).
[ 0.000000] 8cc0e9c0 8c02e9c0 8cc1bf48 8cc1bf48 00000000 8cc0e9c0 8c02e9c0 8cc1bf48
[ 0.000000] bf60: 8cc1bf48 8c02e25a 8cc1bf84 00000000 fffffffc 8c013900 8c02a3a0 8cc01240
[ 0.000000] bf80: 8c02e200 8c0038c4 00000000 00000000 00000000 00000000 00000000 00000000
[ 0.000000] bfa0: 00000000 Autoconfig PCI channel 0x8c27e36c
[ 0.000000] Scanning bus 00, I/O 0x01001600:0x01003600, Mem 0x01840000:0x01848000
[ 0.000000] 00:00.0 Class 0200: 11db:1234 (rev 10)
[ 0.000000] I/O at 0x01001600 [size=0x100]
[ 0.000000] Mem at 0x01840000 [size=0x100]
[ 0.000000] 00000000 00000000 00000000 8cc11ec8 8c02e220 00000000 00000000
[ 0.000000] bfc0: 00000000 00000000 00000000 00000000 00000000 <5>PCI: Fixing up device 0000:00:00.0
[ 0.000000] 00000000 00000000 8cc1bfa0
[ 0.000000] bfe0: 8c0038c0 00000000 40000000 00000000 00000000 00000000 00000000 00000000
[ 0.000000]
[ 0.000000] Call trace:
[ 0.000000] [<8c00762e>] dump_stack+0xe/0x9e0
[ 0.000000] [<8c103890>] kobject_init+0x30/0xa0
[ 0.000000] [<8c14435e>] device_initialize+0x1e/0xa0
[ 0.000000] [<8c144aae>] device_register+0xe/0x40
[ 0.000000] [<8c159aa8>] maple_attach_driver+0x128/0x1c0
[ 0.000000] [<8c159e58>] maple_dma_handler+0x138/0x300
[ 0.000000] [<8c159d20>] maple_dma_handler+0x0/0x300
[ 0.000000] [<8c02e7c0>] prepare_to_wait+0x0/0xc0
[ 0.000000] [<8c1dbf60>] schedule+0x360/0x420
[ 0.000000] [<8c02a2da>] run_workqueue+0xba/0x180
[ 0.000000] [<8c018b60>] printk+0x0/0x40
[ 0.000000] [<8c159d20>] maple_dma_handler+0x0/0x300
[ 0.000000] [<8c02a428>] worker_thread+0x88/0xe0
[ 0.000000] [<8c02e7c0>] prepare_to_wait+0x0/0xc0
[ 0.000000] [<8c02a220>] run_workqueue+0x0/0x180
[ 0.000000] [<8c02e940>] finish_wait+0x0/0x80
[ 0.000000] [<8c02e200>] kthread_should_stop+0x0/0x20
[ 0.000000] [<8c02e9c0>] autoremove_wake_function+0x0/0x40
[ 0.000000] [<8c02e9c0>] autoremove_wake_function+0x0/0x40
[ 0.000000] [<8c02e25a>] kthread+0x3a/0x80
[ 0.000000] [<8c013900>] complete+0x0/0xc0
[ 0.000000] [<8c02a3a0>] worker_thread+0x0/0xe0
[ 0.000000] [<8c02e200>] kthread_should_stop+0x0/0x20
[ 0.000000] [<8c0038c4>] kernel_thread_helper+0x4/0x20
[ 0.000000] [<8c02e220>] kthread+0x0/0x80
[ 0.000000] [<8c0038c0>] kernel_thread_helper+0x0/0x20
[ 0.000000]
[ 0.000000] Maple bus at (1, 0): Connected function 0x40
[ 0.000000] No maple driver found for this device
[ 0.000000] Time: SuperH clocksource has been installed.
[ 0.000000] kobject (8cc2d560): tried to init an initialized object, something is seriously wrong.
[ 0.000000] Stack: (0x8cc1be88 to 0x8cc1c000)
[ 0.000000] be80: 8c00762e 8cc1be98 8c27d050 8cc2d560 8c103890 8cc1bea0
[ 0.000000] bea0: 8c14435e 8cc1beb0 8cc2d400 8cc2d4f8 8cc2d400 8c144aae 8cc1bec0 8cc2d4f8
[ 0.000000] bec0: 8c159aa8 8cc1becc 00000040 8c159e58 8cc1beec 8cc69920 fffffffe 8c159d20
[ 0.000000] bee0: 8c27e14c 8cc2d400 8c27e13c 8cc1bf10 8c02e7c0 8cc0ea3c 8c1dbf60 8c02a2da
[ 0.000000] bf00: 8cc1bf1c 8c018b60 fffffffe 8c159d20 ffffff0f 8cc01240 8c27e13c 8c02a428
[ 0.000000] bf20: 8cc1bf3c 8c02e7c0 8c02a220 8c02e940 8c02e200 8cc01248 8cc01240 00000000
[ 0.000000] bf40: 8cc0e9c0 8c02e9c0 8cc1bf48 8cc1bf48 00000000 8cc0e9c0 8c02e9c0 8cc1bf48
[ 0.000000] bf60: 8cc1bf48 <6>NET: Registered protocol family 2
[ 0.000000] 8c02e25a 8cc1bf84 00000000 fffffffc 8c013900 8c02a3a0 8cc01240
[ 0.000000] bf80: 8c02e200 8c0038c4 00000000 00000000 00000000 00000000 00000000 00000000
[ 0.000000] bfa0: 00000000 00000000 00000000 00000000 8cc11ec8 8c02e220 00000000 00000000
[ 0.000000] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 8cc1bfa0
[ 0.000000] bfe0: 8c0038c0 00000000 40000000 00000000 00000000 00000000 00000000 00000000
[ 0.000000]
[ 0.000000] Call trace:
[ 0.000000] [<8c00762e>] dump_stack+0xe/0x9e0
[ 0.000000] [<8c103890>] kobject_init+0x30/0xa0
[ 0.000000] [<8c14435e>] device_initialize+0x1e/0xa0
[ 0.000000] [<8c144aae>] device_register+0xe/0x40
[ 0.000000] [<8c159aa8>] maple_attach_driver+0x128/0x1c0
[ 0.000000] [<8c159e58>] maple_dma_handler+0x138/0x300
[ 0.000000] [<8c159d20>] maple_dma_handler+0x0/0x300
[ 0.000000] [<8c02e7c0>] prepare_to_wait+0x0/0xc0
[ 0.000000] [<8c1dbf60>] schedule+0x360/0x420
[ 0.000000] [<8c02a2da>] run_workqueue+0xba/0x180
[ 0.000000] [<8c018b60>] printk+0x0/0x40
[ 0.000000] [<8c159d20>] maple_dma_handler+0x0/0x300
[ 0.000000] [<8c02a428>] worker_thread+0x88/0xe0
[ 0.000000] [<8c02e7c0>] prepare_to_wait+0x0/0xc0
[ 0.000000] [<8c02a220>] run_workqueue+0x0/0x180
[ 0.000000] [<8c02e940>] finish_wait+0x0/0x80
[ 0.000000] [<8c02e200>] kthread_should_stop+0x0/0x20
[ 0.000000] [<8c02e9c0>] autoremove_wake_function+0x0/0x40
[ 0.000000] [<8c02e9c0>] autoremove_wake_function+0x0/0x40
[ 0.000000] [<8c02e25a>] kthread+0x3a/0x80
[ 0.000000] [<8c013900>] complete+0x0/0xc0
[ 0.000000] [<8c02a3a0>] worker_thread+0x0/0xe0
[ 0.000000] [<8c02e200>] kthread_should_stop+0x0/0x20
[ 0.000000] [<8c0038c4>] kernel_thread_helper+0x4/0x20
[ 0.000000] [<8c02e220>] kthread+0x0/0x80
[ 0.000000] [<8c0038c0>] kernel_thread_helper+0x0/0x20
[ 0.000000]
[ 0.000000] No maple devices attached to port 2
[ 0.000000] No maple devices attached to port 3


2008-01-26 19:55:36

by Adrian McMenamin

[permalink] [raw]
Subject: Re: kobject oops with maple bus

On 26/01/2008, Adrian McMenamin <[email protected]> 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
>
>
>
>
> dreamy:~# [ 0.000000] Linux version 2.6.24-gf0ea9c3d-dirty (adrian@bossclass) (gcc version 3.4.6) #328 PREEMPT Sat Jan 26 19:45:30 GMT 2008
> [ 0.000000] console [sercon0] enabled
> [ 0.000000] Booting machvec: Sega Dreamcast
> [ 0.000000] Node 0: start_pfn = 0xc000, low = 0xd000
> [ 0.000000] Zone PFN ranges:
> [ 0.000000] Normal 49152 -> 53248
> [ 0.000000] Movable zone start PFN for each node
> [ 0.000000] early_node_map[1] active PFN ranges


Oh, and I've just noticed everythung appears to be timed to 0 too. Very odd.

2008-01-26 20:45:48

by Greg KH

[permalink] [raw]
Subject: Re: kobject oops with maple bus

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
>
>
>
>
> dreamy:~# [ 0.000000] Linux version 2.6.24-gf0ea9c3d-dirty (adrian@bossclass) (gcc version 3.4.6) #328 PREEMPT Sat Jan 26 19:45:30 GMT 2008
> [ 0.000000] console [sercon0] enabled
> [ 0.000000] Booting machvec: Sega Dreamcast
> [ 0.000000] Node 0: start_pfn = 0xc000, low = 0xd000
> [ 0.000000] Zone PFN ranges:
> [ 0.000000] Normal 49152 -> 53248
> [ 0.000000] Movable zone start PFN for each node
> [ 0.000000] early_node_map[1] active PFN ranges
> [ 0.000000] 0: 49152 -> 53248
> [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 4064
> [ 0.000000] Kernel command line: root=/dev/nfs rw nfsroot=192.168.61.50:/home/adrian/debdist ip=dhcp earlyprintk=serial video=pvr2fb:640x480-32@60 consol7
> [ 0.000000] PID hash table entries: 64 (order: 6, 256 bytes)
> [ 0.000000] Using tmu for system timer
> [ 0.000000] Using 12.469 MHz high precision timer.
> [ 0.000000] Console: colour dummy device 80x25
> [ 0.000000] Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
> [ 0.000000] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
> [ 0.000000] Memory: 13468k/16384k available (1918k kernel code, 645k data, 96k init)
> [ 0.000000] PVR=040205c1 CVR=00000000 PRR=00000000
> [ 0.000000] I-cache : n_ways=1 n_sets=256 way_incr=8192
> [ 0.000000] I-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2
> [ 0.000000] D-cache : n_ways=1 n_sets=512 way_incr=16384
> [ 0.000000] D-cache : entry_mask=0x00003fe0 alias_mask=0x00003000 n_aliases=4
> [ 0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
> [ 0.000000] Mount-cache hash table entries: 512
> [ 0.000000] CPU: SH7750
> [ 0.000000] net_namespace: 64 bytes
> [ 0.000000] NET: Registered protocol family 16
> [ 0.000000] Maple bus at (0, 0): Connected function 0x0
> [ 0.000000] No maple driver found for this device
> [ 0.000000] Maple bus at (1, 0): Connected function 0x0
> [ 0.000000] No maple driver found for this device
> [ 0.000000] Maple bus at (2, 0): Connected function 0x0
> [ 0.000000] No maple driver found for this device
> [ 0.000000] Maple bus at (3, 0): Connected function 0x0
> [ 0.000000] No maple driver found for this device
> [ 0.000000] Maple bus core now registered.
> [ 0.000000] DMA: Registering DMA API.
> [ 0.000000] DMA: Registering sh_dmac handler (4 channels).
> [ 0.000000] Maple bus at (0, 0): Connected function 0x1
> [ 0.000000] No maple driver found for this device
> [ 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

2008-01-26 22:02:21

by Adrian McMenamin

[permalink] [raw]
Subject: Re: kobject oops with maple bus


On Sat, 2008-01-26 at 12:44 -0800, 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
> >
> >
> >
> >
> > dreamy:~# [ 0.000000] Linux version 2.6.24-gf0ea9c3d-dirty (adrian@bossclass) (gcc version 3.4.6) #328 PREEMPT Sat Jan 26 19:45:30 GMT 2008
> > [ 0.000000] console [sercon0] enabled
> > [ 0.000000] Booting machvec: Sega Dreamcast
> > [ 0.000000] Node 0: start_pfn = 0xc000, low = 0xd000
> > [ 0.000000] Zone PFN ranges:
> > [ 0.000000] Normal 49152 -> 53248
> > [ 0.000000] Movable zone start PFN for each node
> > [ 0.000000] early_node_map[1] active PFN ranges
> > [ 0.000000] 0: 49152 -> 53248
> > [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 4064
> > [ 0.000000] Kernel command line: root=/dev/nfs rw nfsroot=192.168.61.50:/home/adrian/debdist ip=dhcp earlyprintk=serial video=pvr2fb:640x480-32@60 consol7
> > [ 0.000000] PID hash table entries: 64 (order: 6, 256 bytes)
> > [ 0.000000] Using tmu for system timer
> > [ 0.000000] Using 12.469 MHz high precision timer.
> > [ 0.000000] Console: colour dummy device 80x25
> > [ 0.000000] Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
> > [ 0.000000] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
> > [ 0.000000] Memory: 13468k/16384k available (1918k kernel code, 645k data, 96k init)
> > [ 0.000000] PVR=040205c1 CVR=00000000 PRR=00000000
> > [ 0.000000] I-cache : n_ways=1 n_sets=256 way_incr=8192
> > [ 0.000000] I-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2
> > [ 0.000000] D-cache : n_ways=1 n_sets=512 way_incr=16384
> > [ 0.000000] D-cache : entry_mask=0x00003fe0 alias_mask=0x00003000 n_aliases=4
> > [ 0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
> > [ 0.000000] Mount-cache hash table entries: 512
> > [ 0.000000] CPU: SH7750
> > [ 0.000000] net_namespace: 64 bytes
> > [ 0.000000] NET: Registered protocol family 16
> > [ 0.000000] Maple bus at (0, 0): Connected function 0x0
> > [ 0.000000] No maple driver found for this device
> > [ 0.000000] Maple bus at (1, 0): Connected function 0x0
> > [ 0.000000] No maple driver found for this device
> > [ 0.000000] Maple bus at (2, 0): Connected function 0x0
> > [ 0.000000] No maple driver found for this device
> > [ 0.000000] Maple bus at (3, 0): Connected function 0x0
> > [ 0.000000] No maple driver found for this device
> > [ 0.000000] Maple bus core now registered.
> > [ 0.000000] DMA: Registering DMA API.
> > [ 0.000000] DMA: Registering sh_dmac handler (4 channels).
> > [ 0.000000] Maple bus at (0, 0): Connected function 0x1
> > [ 0.000000] No maple driver found for this device
> > [ 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?
>

I think it is probably registering the "dummy" driver a second or
further time. Does that make sense? By all means have a look, but I'll
have a go - I'm sure you have better things to do than mess about with
Dreamcast code :)

2008-01-28 09:43:16

by Adrian McMenamin

[permalink] [raw]
Subject: Re: kobject oops with maple bus

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 [email protected]
> 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?


[ 41.491053] Maple bus device detaching at (0, 2)
[ 42.509136] Maple bus at (0, 2): Connected function 0x10
[ 42.513939] No maple driver found for this device
[ 44.504875] Maple bus device detaching at (0, 2)
[ 45.523250] Maple bus at (0, 2): Connected function 0x10
[ 45.529272] No maple driver found for this device
[ 46.514861] Maple bus device detaching at (0, 1)
[ 47.516651] Maple bus device detaching at (0, 2)
[ 48.539093] Maple bus at (0, 1): Connected function 0xE
[ 48.545090] No maple driver found for this device
[ 48.565052] Maple bus at (0, 2): Connected function 0x10
[ 48.569995] No maple driver found for this device
[ 49.528324] Maple bus device detaching at (0, 2)
[ 51.551459] Maple bus at (0, 2): Connected function 0x10
[ 51.557579] No maple driver found for this device
[ 52.542771] Maple bus device detaching at (0, 2)
[ 53.560892] Maple bus at (0, 2): Connected function 0x10
[ 53.566011] No maple driver found for this device
[ 55.556921] Maple bus device detaching at (0, 2)
[ 56.574966] Maple bus at (0, 2): Connected function 0x10
[ 56.580969] No maple driver found for this device
[ 58.570982] Maple bus device detaching at (0, 2)
[ 59.589076] Maple bus at (0, 2): Connected function 0x10
[ 59.594105] No maple driver found for this device
[ 60.579944] Maple bus device detaching at (0, 2)
[ 61.598478] Maple bus at (0, 2): Connected function 0x10
[ 61.602238] No maple driver found for this device
[ 61.615106] Fault in unaligned fixup: 0000 [#1]
[ 61.616970] Modules linked in: nbd
[ 61.616970]
[ 61.616970] Pid : 752, Comm: udevd
[ 61.616970] PC is at kmem_cache_alloc+0x2e/0xc0
[ 61.616970] PC : 8c074a4e SP : 8c88ddc4 SR : 400080f0 TEA :
c00077c4 Not tainted
[ 61.616970] R0 : 00000000 R1 : 00000000 R2 : 00000000 R3 :
8ce1d000
[ 61.616970] R4 : 8c2b03b0 R5 : 000080d0 R6 : 00007fff R7 :
8c0c09e0
[ 61.616970] R8 : 00000000 R9 : ffffffff R10 : 8c2b03f4 R11 :
000080d0
[ 61.616970] R12 : 8c88dee4 R13 : 00007fff R14 : 8c88ddc4
[ 61.616970] MACH: 00000002 MACL: 00000000 GBR : 29708440 PR :
8c0c09e0
[ 61.616970]
[ 61.616970] Call trace:
[ 61.616970] [<8c0c09e0>] show_stat+0x20/0x3e0
[ 61.616970] [<8c0556b4>] rmqueue_bulk+0x34/0xa0
[ 61.616970] [<8c056e2e>] get_page_from_freelist+0x32e/0x540
[ 61.616970] [<8c057088>] __alloc_pages+0x48/0x3c0
[ 61.616970] [<8c09baa6>] seq_open+0x66/0xa0
[ 61.616970] [<8c09bbde>] single_open+0x3e/0xa0
[ 61.616970] [<8c0c09c0>] show_stat+0x0/0x3e0
[ 61.616970] [<8c0c094a>] stat_open+0x2a/0xa0
[ 61.616970] [<8c0b87d4>] proc_reg_open+0x54/0xc0
[ 61.616970] [<8c0c0920>] stat_open+0x0/0xa0
[ 61.616970] [<8c0b87dc>] proc_reg_open+0x5c/0xc0
[ 61.616970] [<8c075944>] __dentry_open+0xe4/0x2c0
[ 61.616970] [<8c0b8780>] proc_reg_open+0x0/0xc0
[ 61.616970] [<8c09bcae>] seq_read+0x6e/0x360
[ 61.616970] [<8c0b82c4>] proc_reg_read+0x64/0x100
[ 61.616970] [<8c09bc40>] seq_read+0x0/0x360
[ 61.616970] [<8c0781c4>] vfs_read+0x84/0xe0
[ 61.616970] [<8c07899c>] sys_read+0x3c/0xa0
[ 61.616970] [<8c008240>] syscall_call+0xc/0x10
[ 61.616970] [<8c078960>] sys_read+0x0/0xa0
[ 61.616970]
[ 61.616970] Process: udevd (pid: 752, stack limit = 8c88c001)
[ 61.616970] Stack: (0x8c88ddc4 to 0x8c88e000)
[ 61.616970] ddc0: 8c0c09e0 8c88dddc 8c4103c0 8cef3f80
00000001 8c4103c0 8c0556b4
[ 61.616970] dde0: 8c88ddfc 8c2bd6f0 00000000 00000000 00000001
00000000 8c2bd710 8c056e2e
[ 61.616970] de00: 8c88de20 8c2bd6f0 00000000 00000000 8c2bd704
00000000 8c2bd710 00000000
[ 61.616970] de20: 00000001 00000044 00000000 000240d0 8c2bdc34
00000000 00000000 00000001
[ 61.616970] de40: 8c057088 8c88de60 8c52f010 00000000 8cc65380
00000000 000040d0 8cef3f80
[ 61.616970] de60: 8c09baa6 8c88de78 8c48f240 8cef3fc0 8cef3f9c
8c88de78 8c09bbde 8c88de90
[ 61.616970] de80: 8c0c09c0 fffffff4 8cef3fc0 8c48f240 8c0c094a
8c88deac 00000000 8cef3f80
[ 61.616970] dea0: fffffff4 8ce1d000 8cef3fc0 8c0b87d4 8c88dec0
8c0c0920 8c0b87dc 8c88dec0
[ 61.616970] dec0: 8c075944 8c88dedc 8c0b8780 ffffff9c 8cd09c80
8c52f08c 8c88dedc 8cef3fc0
[ 61.616970] dee0: 8c09bcae 8c88df00 00007fff 8c88dee4 8c88df1c
8cef3f80 00000001 8c4103c0
[ 61.616970] df00: 8cef3fc0 8c88df7c 7bf155f8 8c4103e0 00000000
00008000 8c85d174 00000000
[ 61.616970] df20: 00000000 8c0b82c4 8c88df44 00007fff 7bf155f8
8c88df7c 8cef3f80 8c09bc40
[ 61.616970] df40: 8cc039c0 fffffffb 8c0781c4 8c88df68 00000000
0041e8a0 8c88df48 8c88df7c
[ 61.616970] df60: 7bf155f8 8cef3f80 8c07899c 8c88df7c 8cef3f80
00007fff fffffff7 00000000
[ 61.616970] df80: 00000000 00000000 8c008240 7bf155ec ffffff0f
00000021 8c88dff8 8c078960
[ 61.616970] dfa0: 00000000 00000440 fffffff9 00000003 00000007
7bf155f8 00007fff 0041cb3c
[ 61.616970] dfc0: 00000007 7bf155f8 fffffffb 00000000 0041e8a0
00000000 7bf155ec 7bf155ec
[ 61.616970] dfe0: 2962d174 00402b22 00000001 29708440 00000002
00000000 0000004c 00000160
[ 61.651001] ---[ end trace 31be9d8019f52cfa ]---

2008-01-28 19:26:50

by Greg KH

[permalink] [raw]
Subject: Re: kobject oops with maple bus

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 [email protected]
> > 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