insmod g_serial.ko fails if paramter n_ports larger than 1

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

 



HI,
    When I insmod g_serial.ko with paramter n_ports=3, it will fails,
the related information as follows:
system/opl/modules # busybox insmod g_serial.ko n_ports=3

<7>[   69.469000] gserial_setup: registered 3 ttyGS* devices
<7>[   69.469000] g_serial gadget: adding config #2 'CDC ACM config'/bf0042d0
<7>[   69.469000] g_serial gadget: adding 'acm'/c7a35780 to config
'CDC ACM config'/bf0042d0
<7>[   69.473000] g_serial gadget: acm ttyGS0: dual speed IN/ep1in
OUT/ep2out NOTIFY/ep3in
<7>[   69.473000] g_serial gadget: adding 'acm'/c7a35900 to config
'CDC ACM config'/bf0042d0
<4>[   69.473000] ------------[ cut here ]------------
<4>[   69.473000] WARNING: at fs/sysfs/dir.c:491 sysfs_add_one+0xa8/0x114()
<4>[   69.473000] sysfs: cannot create duplicate filename
'/class/usb_composite/acm'
<4>[   69.473000] Modules linked in: g_serial(+)
<4>[   69.473000] [<c0027544>] (unwind_backtrace+0x0/0xe8) from
[<c003f9a8>] (warn_slowpath_common+0
x48/0x60)
<4>[   69.473000] [<c003f9a8>] (warn_slowpath_common+0x48/
0x60) from [<c003f9fc>] (warn_slowpath_fmt
+0x28/0x38)
<4>[   69.473000] [<c003f9fc>] (warn_slowpath_fmt+0x28/0x38) from
[<c011a858>] (sysfs_add_one+0xa8/0
x114)
<4>[   69.473000] [<c011a858>] (sysfs_add_one+0xa8/0x114) from
[<c011aee0>] (create_dir+0x4c/0xa8)
<4>[   69.473000] [<c011aee0>] (create_dir+0x4c/0xa8) from
[<c011af6c>] (sysfs_create_dir+0x30/0x5c)
<4>[   69.473000] [<c011af6c>] (sysfs_create_dir+0x30/0x5c) from
[<c017d360>] (kobject_add_internal+
0x84/0x1cc)
<4>[   69.473000] [<c017d360>] (kobject_add_internal+0x84/0x1cc) from
[<c017d618>] (kobject_add+0x34
/0x64)
<4>[   69.473000] [<c017d618>] (kobject_add+0x34/0x64) from
[<c01ab668>] (device_add+0xa4/0x5d4)
<4>[   69.474000] [<c01ab668>] (device_add+0xa4/0x5d4) from
[<c01abc64>] (device_create_vargs+0xb4/0
x120)
<4>[   69.474000] [<c01abc64>] (device_create_vargs+0xb4/0x120) from
[<c01abcf0>] (device_create+0x2
0/0x28)
<4>[   69.474000] [<c01abcf0>] (device_create+0x20/0x28) from
[<bf009888>] (usb_add_function+0xa0/0x
1d8 [g_serial])
<4>[   69.474000] [<bf009888>] (usb_add_function+0xa0/0x1d8
[g_serial]) from [<bf009df8>] (acm_bind_
config+0x13c/0x1a4 [g_serial])
<4>[   69.474000] [<bf009df8>] (acm_bind_config+0x13c/0x1a4
[g_serial]) from [<bf009e98>] (serial_bi
nd_config+0x38/0xa0 [g_serial])
<4>[   69.474000] [<bf009e98>] (serial_bind_config+0x38/0xa0
[g_serial]) from [<bf008180>] (usb_add_
config+0xc4/0x244 [g_serial])
<4>[   69.475000] [<bf008180>] (usb_add_config+0xc4/0x244 [g_serial])
from [<bf008794>] (gs_bind+0xd
8/0x168 [g_serial])
<4>[   69.475000] [<bf008794>] (gs_bind+0xd8/0x168 [g_serial]) from
[<bf009494>] (composite_bind+0x1
c8/0x3c0 [g_serial])
<4>[   69.475000] [<bf009494>] (composite_bind+0x1c8/0x3c0 [g_serial])
from [<c01dd4e4>] (usb_gadget
_register_driver+0x94/0x1c8)
<4>[   69.475000] [<c01dd4e4>] (usb_gadget_register_driver+0x94/0x1c8)
from [<c0022338>] (do_one_ini
tcall+0x30/0x1b8)
<4>[   69.475000] [<c0022338>] (do_one_initcall+0x30/0x1b8) from
[<c006e63c>] (sys_init_module+0xc4/
0x1f4)
<4>[   69.475000] [<c006e63c>] (sys_init_module+0xc4/0x1f4) from
[<c00229a0>] (ret_fast_syscall+0x0/
0x28)
<4>[   69.475000] ---[ end trace f94f0b6afd839ad3 ]---
<3>[   69.475000] kobject_add_internal failed for acm with -EEXIST,
don't try to register things wit
h the same name in the same directory.
<4>[   69.487000] [<c0027544>] (unwind_backtrace+0x0/0xe8) from
[<c017d490>] (kobject_add_internal+0
x1b4/0x1cc)
<4>[   69.487000] [<c017d490>] (kobject_add_internal+0x1b4/0x1cc) from
[<c017d618>] (kobject_add+0x3
4/0x64)
<4>[   69.487000] [<c017d618>] (kobject_add+0x34/0x64) from
[<c01ab668>] (device_add+0xa4/0x5d4)
<4>[   69.487000] [<c01ab668>] (device_add+0xa4/0x5d4) from
[<c01abc64>] (device_create_vargs+0xb4/0
x120)
<4>[   69.487000] [<c01abc64>] (device_create_vargs+0xb4/0x120) from
[<c01abcf0>] (device_create+0x2
0/0x28)
<4>[   69.488000] [<c01abcf0>] (device_create+0x20/0x28) from
[<bf009888>] (usb_add_function+0xa0/0x
1d8 [g_serial])
<4>[   69.488000] [<bf009888>] (usb_add_function+0xa0/0x1d8
[g_serial]) from [<bf009df8>] (acm_bind_
config+0x13c/0x1a4 [g_serial])
<4>[   69.488000] [<bf009df8>] (acm_bind_config+0x13c/0x1a4
[g_serial]) from [<bf009e98>] (serial_bi
nd_config+0x38/0xa0 [g_serial])
<4>[   69.488000] [<bf009e98>] (serial_bind_config+0x38/0xa0
[g_serial]) from [<bf008180>] (usb_add_
config+0xc4/0x244 [g_serial])
<4>[   69.488000] [<bf008180>] (usb_add_config+0xc4/0x244 [g_serial])
from [<bf008794>] (gs_bind+0xd
8/0x168 [g_serial])
<4>[   69.488000] [<bf008794>] (gs_bind+0xd8/0x168 [g_serial]) from
[<bf009494>] (composite_bind+0x1
c8/0x3c0 [g_serial])
<4>[   69.488000] [<bf009494>] (composite_bind+0x1c8/0x3c0 [g_serial])
from [<c01dd4e4>] (usb_gadget
_register_driver+0x94/0x1c8)
<4>[   69.488000] [<c01dd4e4>] (usb_gadget_register_driver+0x94/0x1c8)
from [<c0022338>] (do_one_ini
tcall+0x30/0x1b8)
<4>[   69.489000] [<c0022338>] (do_one_initcall+0x30/0x1b8) from
[<c006e63c>] (sys_init_module+0xc4/
0x1f4)
<4>[   69.489000] [<c006e63c>] (sys_init_module+0xc4/0x1f4) from
[<c00229a0>] (ret_fast_syscall+0x0/
0x28)
<7>[   69.489000] g_serial gadget: added config 'CDC ACM config'/2 --> -17
<7>[   69.500000] gserial_cleanup: cleaned up ttyGS* support
<4>[   69.500000] ERROR::usb_gadget_register_driver:1044: bind to
driver g_serial --> error -17

Maybe it caused in acm_bind_config, where

  acm->port.func.name = "acm";



  acm->port.func.strings = acm_strings;




the name is the same even it is called 3 times. If I provide different
name like below:
 char name[10] = {0};
 sprintf(name, "acm%d", port_num);
 gser->port.func.name = name;




it could work.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux