sysfs entry issue for dual instance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all

I have added dual instances of musb controller for ti81xx platform and facing issues
during second insmod. For this I have created two instances of "struct platform_device" 
with id set to 0 and 1 respectively as below.

1. 
struct platform_device musb_device[2] = {
	{
		.id = 0
		.name = "musb-ti81xx"
		.resource = musb_resource[0],
		.num_resources = 2,
		...
	},
	{
		.id = 1,
		.name = "musb-ti81xx"
		.resource = musb_resource[2],
		.num_resources = 2,
		...
	}
}
2. calling platform_device_regiser(&musb_device[0]);

3. Now kernel calls musb_ti81xx_probe() for instance 0 and 1 respectively

4. musb_ti81xx_probe() uses below API's to register musb-hdrc platform device.
	4.1. platform_device_alloc("musb-hdrc", pdev->id);
	4.2. platform_device_add_resources(musb, pdev->resource,
                        pdev->num_resources);
	4.3. platform_device_add_data(musb, pdata, sizeof(*pdata));
 	4.4. platform_device_add(musb);
5. Now both the instance works fine. 
6. The ti81xx_remove() uses below sequence to free the resources (kernel calls
	Two times for instance 0 and 1).
	6.1 platform_device_del()
	6.2 platform_device_put()

7. I see below crash/warning message while doing insmod after first rmmod.

Is anything missing in the ti81xx_remove() function causing below warning,
" sysfs: cannot create duplicate filename '/bus/platform/drivers/musb-ti81xx/musb-ti81xx'"

Please help me in resolving this issue.

Ravi.

---------------------------------------------------------------------------------
WARNING: at fs/sysfs/dir.c:451 sysfs_add_one+0x7c/0x9c()
sysfs: cannot create duplicate filename '/bus/platform/drivers/musb-ti81xx/musb-ti81xx'
Modules linked in: ti81xx(+) cppi41dma musb_hdrc [last unloaded: ti81xx]
Backtrace:
[<c0042b48>] (dump_backtrace+0x0/0x110) from [<c0359b54>] (dump_stack+0x18/0x1c)
 r7:c6841d90 r6:c00f90dc r5:c041aa3e r4:000001c3
[<c0359b3c>] (dump_stack+0x0/0x1c) from [<c005d66c>] (warn_slowpath_common+0x54/0x6c)
[<c005d618>] (warn_slowpath_common+0x0/0x6c) from [<c005d728>] (warn_slowpath_fmt+0x38/0x40)
 r9:c6840000 r8:c5cbd3f0 r7:ffffffef r6:c6841de0 r5:c68bb6f0
r4:c6975000
[<c005d6f0>] (warn_slowpath_fmt+0x0/0x40) from [<c00f90dc>] (sysfs_add_one+0x7c/0x9c)
 r3:c6975000 r2:c041aa4d
[<c00f9060>] (sysfs_add_one+0x0/0x9c) from [<c00fa0a4>] (sysfs_do_create_link+0xfc/0x1c8)
 r7:c048cc88 r6:00000000 r5:c68bb6f0 r4:c70522a0
[<c00f9fa8>] (sysfs_do_create_link+0x0/0x1c8) from [<c00fa19c>] (sysfs_create_link+0x14/0x18)
[<c00fa188>] (sysfs_create_link+0x0/0x18) from [<c01de6c8>] (driver_sysfs_add+0x48/0x88)
[<c01de680>] (driver_sysfs_add+0x0/0x88) from [<c01de808>] (driver_probe_device+0x84/0x190)
 r7:c6869a00 r6:bf0297d8 r5:c048cc80 r4:c048cc80
[<c01de784>] (driver_probe_device+0x0/0x190) from [<c01de97c>] (__driver_attach+0x68/0x8c)
 r7:c6869a00 r6:bf0297d8 r5:c048ccb4 r4:c048cc80
[<c01de914>] (__driver_attach+0x0/0x8c) from [<c01de000>] (bus_for_each_dev+0x50/0x84)
 r7:c6869a00 r6:bf0297d8 r5:c01de914 r4:00000000
[<c01ddfb0>] (bus_for_each_dev+0x0/0x84) from [<c01de678>] (driver_attach+0x20/0x28)
 r6:bf0297d8 r5:bf0297c4 r4:00000000
[<c01de658>] (driver_attach+0x0/0x28) from [<c01dd8d8>] (bus_add_driver+0xb4/0x234)
[<c01dd824>] (bus_add_driver+0x0/0x234) from [<c01decb4>] (driver_register+0xb0/0x13c)
[<c01dec04>] (driver_register+0x0/0x13c) from [<c01dfbd4>] (platform_driver_register+0x4c/0x60)
 r9:c6840000 r8:bf02d000 r7:00012018 r6:00012008 r5:bf0297c4
r4:00000000
[<c01dfb88>] (platform_driver_register+0x0/0x60) from [<c01dfc08>] (platform_driver_probe+0x20/0x70)
[<c01dfbe8>] (platform_driver_probe+0x0/0x70) from [<bf02d024>] (ti81xx_glue_init+0x24/0x38 [ti81xx])
 r5:bf029908 r4:00000000
[<bf02d000>] (ti81xx_glue_init+0x0/0x38 [ti81xx]) from [<c00343d8>] (do_one_initcall+0xd0/0x1a4)
[<c0034308>] (do_one_initcall+0x0/0x1a4) from [<c00885b8>] (sys_init_module+0x9c/0x1bc)
[<c008851c>] (sys_init_module+0x0/0x1bc) from [<c003eda0>] (ret_fast_syscall+0x0/0x30)
 r7:00000080 r6:00012018 r5:00008000 r4:00000000
---[ end trace df2512adcc4b0ec1 ]---
really_probe: driver_sysfs_add(musb-ti81xx) failed
musb-ti81xx: probe of musb-ti81xx failed with error 0
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux