2012/3/18 Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>: > On Sun, Mar 18, 2012 at 01:25:30PM +0400, tamerlan311 wrote: >> 2012/3/18 Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> >> >> On Sat, Mar 17, 2012 at 08:07:07PM +0400, Aleksey Babahin wrote: >> > Without this declaration we can`t use interrupt_out_endpointAddress. >> > --- >> > drivers/usb/serial/metro-usb.c | 9 +++++++++ >> > 1 files changed, 9 insertions(+), 0 deletions(-) >> > >> > diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/ >> metro-usb.c >> > index 08d16e8..6dba779 100644 >> > --- a/drivers/usb/serial/metro-usb.c >> > +++ b/drivers/usb/serial/metro-usb.c >> > @@ -136,6 +136,14 @@ exit: >> > __func__, result); >> > } >> > >> > +static void metrousb_write_int_callback (struct urb *urb) >> > +{ >> > + struct usb_serial_port *port = urb->context; >> > + >> > + dev_warn(&port->dev, "%s not implemented yet.\n" >> > + ,__FUNCTION__); >> > +} >> >> So you enable it, and then complain to the user that it's broken? That >> doesn't make sense... >> >> >> This function is never called at now. Because we don`t send much data to >> device. >> >> Only one byte is sent to device via usb_interrupt_msg(), which does not require >> callback function. >> But without declaration of .write_int_callback in usb_serial_driver struct, the >> usb_serial_core subsystem doesn`t initialize endpoint address for the interrupt >> out pipe (interrupt_out_endpointAddress). This endpoint is necessary for >> sending data via usb_interrupt_msg() function and i don`t know other way to get >> it. > > Ah, ok, then explain this in the patch submission please, that is a > reason to accept this. > > Care to redo this series and resend it so I can apply them? Ok, i will resend series with fixes. All other hints i will also try to consider. Now I encountered a small problem. New version of module backported to old kernel (3.2) make a panic when module try to unload. usb_serial_register_drivers usb_serial_deregister_drivers() module_usb_serial_driver() these functions just copied to private header with kernel version check condition. Maybe old kernel required usb_driver inside the struct usb_serial_driver. Panic log: Mar 18 21:04:48 hellga kernel: [165282.421189] USB Serial deregistering driver Metrologic USB to serial converter. Mar 18 21:04:48 hellga kernel: [165282.421309] usbcore: deregistering interface driver metro-usb Mar 18 21:04:48 hellga kernel: [165282.421371] ------------[ cut here ]------------ Mar 18 21:04:48 hellga kernel: [165282.421392] WARNING: at /build/buildd/linux-3.2.0/fs/sysfs/inode.c:323 sysfs_hash_and_remove+0x92/0xa0() Mar 18 21:04:48 hellga kernel: [165282.421399] Hardware name: HP ProBook 4330s Mar 18 21:04:48 hellga kernel: [165282.421403] sysfs: can not remove 'ttyUSB0', no directory Mar 18 21:04:48 hellga kernel: [165282.421408] Modules linked in: metro_usb(O-) nfs lockd fscache auth_rpcgss nfs_acl sunrpc btrfs libcrc32c ufs qnx4 hfsplus hfs minix ntfs msdos jfs xfs ext2 usbhid option usb_wwan cdc_ether usbnet ath3k nls_iso8859_1 nls_cp437 vfat fat pl2303 usbserial hidp hid ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 ip_tables x_tables rfcomm bnep pci_stub vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) deflate zlib_deflate ctr twofish_generic twofish_i586 twofish_common camellia serpent blowfish_generic blowfish_common cast5 des_generic xcbc parport_pc rmd160 ppdev sha512_generic crypto_null af_key autofs4 binfmt_misc dm_crypt snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep btusb snd_pcm bluetooth snd_seq_midi uas uvcvideo videodev snd_rawmidi arc4 ath9k snd_seq_midi_event snd_seq usb_storage mac80211 snd_timer snd_seq_device ath9k_common ath9k_hw snd joydev psmouse netconsole ath soundcore snd_page_alloc configfs hp_wmi hp_a Mar 18 21:04:48 hellga kernel: ccel lis3lv02d mac_hid cfg80211 serio_raw sparse_keymap jmb38x_ms memstick input_polldev mei(C) coretemp lp parport reiserfs vesafb wmi i915 drm_kms_helper sdhci_pci r8169 sdhci drm i2c_algo_bit video [last unloaded: ipmi_msghandler] Mar 18 21:04:48 hellga kernel: [165282.421741] Pid: 8594, comm: modprobe Tainted: G C O 3.2.0-17-generic-pae #27-Ubuntu Mar 18 21:04:48 hellga kernel: [165282.421750] Call Trace: Mar 18 21:04:48 hellga kernel: [165282.421775] [<c105a322>] warn_slowpath_common+0x72/0xa0 Mar 18 21:04:48 hellga kernel: [165282.421794] [<c11a4772>] ? sysfs_hash_and_remove+0x92/0xa0 Mar 18 21:04:48 hellga kernel: [165282.421810] [<c11a4772>] ? sysfs_hash_and_remove+0x92/0xa0 Mar 18 21:04:48 hellga kernel: [165282.421830] [<c105a3f3>] warn_slowpath_fmt+0x33/0x40 Mar 18 21:04:48 hellga kernel: [165282.421842] [<c11a4772>] sysfs_hash_and_remove+0x92/0xa0 Mar 18 21:04:48 hellga kernel: [165282.421858] [<c15a475d>] ? _raw_spin_lock_irqsave+0x2d/0x40 Mar 18 21:04:48 hellga kernel: [165282.421871] [<c11a68d0>] sysfs_remove_link+0x20/0x30 Mar 18 21:04:48 hellga kernel: [165282.421886] [<c1380ebd>] driver_sysfs_remove+0x1d/0x30 Mar 18 21:04:48 hellga kernel: [165282.421898] [<c1380ef4>] __device_release_driver+0x24/0xb0 Mar 18 21:04:48 hellga kernel: [165282.421910] [<c1380fa4>] device_release_driver+0x24/0x40 Mar 18 21:04:48 hellga kernel: [165282.421922] [<c1380b1a>] bus_remove_device+0x5a/0x80 Mar 18 21:04:48 hellga kernel: [165282.421933] [<c137e837>] device_del+0xe7/0x150 Mar 18 21:04:48 hellga kernel: [165282.421960] [<f99ed77a>] usb_serial_disconnect+0xca/0x150 [usbserial] Mar 18 21:04:48 hellga kernel: [165282.421972] [<c1411d4c>] usb_unbind_interface+0x3c/0x140 Mar 18 21:04:48 hellga kernel: [165282.421985] [<c1380f2b>] __device_release_driver+0x5b/0xb0 Mar 18 21:04:48 hellga kernel: [165282.421997] [<c138158f>] driver_detach+0x8f/0xa0 Mar 18 21:04:48 hellga kernel: [165282.422010] [<c1380e03>] bus_remove_driver+0x63/0xa0 Mar 18 21:04:48 hellga kernel: [165282.422022] [<c1381c28>] driver_unregister+0x48/0x80 Mar 18 21:04:48 hellga kernel: [165282.422037] [<c1411155>] usb_deregister+0xa5/0xb0 Mar 18 21:04:48 hellga kernel: [165282.422051] [<f9b4e87d>] usb_serial_deregister_drivers+0x2d/0x34 [metro_usb] Mar 18 21:04:48 hellga kernel: [165282.422064] [<f9b4e896>] usb_serial_driver_exit+0x12/0x77c [metro_usb] Mar 18 21:04:48 hellga kernel: [165282.422077] [<c1094c95>] sys_delete_module+0x135/0x230 Mar 18 21:04:48 hellga kernel: [165282.422092] [<c111af5a>] ? do_munmap+0x16a/0x200 Mar 18 21:04:48 hellga kernel: [165282.422106] [<c15ab91f>] sysenter_do_call+0x12/0x28 Mar 18 21:04:48 hellga kernel: [165282.422115] ---[ end trace 073e21f4571f47f2 ]--- Mar 18 21:04:48 hellga kernel: [165282.422299] metro-usb ttyUSB0: Metrologic USB to serial converter. converter now disconnected from ttyUSB0 Mar 18 21:04:48 hellga kernel: [165282.422336] BUG: unable to handle kernel NULL pointer dereference at 00000010 Mar 18 21:04:48 hellga kernel: [165282.426897] IP: [<c1571a98>] klist_put+0x18/0x80 Mar 18 21:04:48 hellga kernel: [165282.431062] *pdpt = 000000000526d001 *pde = 0000000000000000 Mar 18 21:04:48 hellga kernel: [165282.435508] Oops: 0000 [#1] SMP Mar 18 21:04:48 hellga kernel: [165282.439418] Modules linked in: metro_usb(O-) nfs lockd fscache auth_rpcgss nfs_acl sunrpc btrfs libcrc32c ufs qnx4 hfsplus hfs minix ntfs msdos jfs xfs ext2 usbhid option usb_wwan cdc_ether usbnet ath3k nls_iso8859_1 nls_cp437 vfat fat pl2303 usbserial hidp hid ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 ip_tables x_tables rfcomm bnep pci_stub vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) deflate zlib_deflate ctr twofish_generic twofish_i586 twofish_common camellia serpent blowfish_generic blowfish_common cast5 des_generic xcbc parport_pc rmd160 ppdev sha512_generic crypto_null af_key autofs4 binfmt_misc dm_crypt snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep btusb snd_pcm bluetooth snd_seq_midi uas uvcvideo videodev snd_rawmidi arc4 ath9k snd_seq_midi_event snd_seq usb_storage mac80211 snd_timer snd_seq_device ath9k_common ath9k_hw snd joydev psmouse netconsole ath soundcore snd_page_alloc configfs hp_wmi hp_a Mar 18 21:04:48 hellga kernel: ccel lis3lv02d mac_hid cfg80211 serio_raw sparse_keymap jmb38x_ms memstick input_polldev mei(C) coretemp lp parport reiserfs vesafb wmi i915 drm_kms_helper sdhci_pci r8169 sdhci drm i2c_algo_bit video [last unloaded: ipmi_msghandler] Mar 18 21:04:48 hellga kernel: [165282.470523] Mar 18 21:04:48 hellga kernel: [165282.473877] Pid: 8594, comm: modprobe Tainted: G WC O 3.2.0-17-generic-pae #27-Ubuntu Hewlett-Packard HP ProBook 4330s/167E Mar 18 21:04:48 hellga kernel: [165282.476279] EIP: 0060:[<c1571a98>] EFLAGS: 00210246 CPU: 1 Mar 18 21:04:48 hellga kernel: [165282.480163] EIP is at klist_put+0x18/0x80 Mar 18 21:04:48 hellga kernel: [165282.484465] EAX: 00000000 EBX: eb332624 ECX: 000000d1 EDX: 00000001 Mar 18 21:04:48 hellga kernel: [165282.487035] ESI: 00000000 EDI: ef08901c EBP: eb2afdfc ESP: eb2afdec Mar 18 21:04:48 hellga kernel: [165282.490898] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 Mar 18 21:04:48 hellga kernel: [165282.494935] Process modprobe (pid: 8594, ti=eb2ae000 task=cd800ca0 task.ti=eb2ae000) Mar 18 21:04:48 hellga kernel: [165282.499222] Stack: Mar 18 21:04:48 hellga kernel: [165282.503644] eb2afdf8 cd800ca0 eb332624 ef08901c eb2afe04 c1571b2d eb2afe2c c1571c55 Mar 18 21:04:48 hellga kernel: [165282.507834] c1865174 c1865174 eb332624 cd800ca0 00000000 c1384309 ce025118 f9b500d4 Mar 18 21:04:48 hellga kernel: [165282.512767] eb2afe3c c1380f44 ce02514c ce025118 eb2afe4c c1380fa4 ce025118 ce025000 Mar 18 21:04:48 hellga kernel: [165282.516705] Call Trace: Mar 18 21:04:48 hellga kernel: [165282.520146] [<c1571b2d>] klist_del+0xd/0x10 Mar 18 21:04:48 hellga kernel: [165282.524430] [<c1571c55>] klist_remove+0x55/0x90 Mar 18 21:04:48 hellga kernel: [165282.528366] [<c1384309>] ? devres_release_all+0x39/0x60 Mar 18 21:04:48 hellga kernel: [165282.532509] [<c1380f44>] __device_release_driver+0x74/0xb0 Mar 18 21:04:48 hellga kernel: [165282.536710] [<c1380fa4>] device_release_driver+0x24/0x40 Mar 18 21:04:48 hellga kernel: [165282.540875] [<c1380b1a>] bus_remove_device+0x5a/0x80 Mar 18 21:04:48 hellga kernel: [165282.545134] [<c137e837>] device_del+0xe7/0x150 Mar 18 21:04:48 hellga kernel: [165282.549328] [<f99ed77a>] usb_serial_disconnect+0xca/0x150 [usbserial] Mar 18 21:04:48 hellga kernel: [165282.553684] [<c1411d4c>] usb_unbind_interface+0x3c/0x140 Mar 18 21:04:48 hellga kernel: [165282.557983] [<c1380f2b>] __device_release_driver+0x5b/0xb0 Mar 18 21:04:48 hellga kernel: [165282.562375] [<c138158f>] driver_detach+0x8f/0xa0 Mar 18 21:04:48 hellga kernel: [165282.566715] [<c1380e03>] bus_remove_driver+0x63/0xa0 Mar 18 21:04:48 hellga kernel: [165282.570966] [<c1381c28>] driver_unregister+0x48/0x80 Mar 18 21:04:48 hellga kernel: [165282.575188] [<c1411155>] usb_deregister+0xa5/0xb0 Mar 18 21:04:48 hellga kernel: [165282.579345] [<f9b4e87d>] usb_serial_deregister_drivers+0x2d/0x34 [metro_usb] Mar 18 21:04:48 hellga kernel: [165282.583774] [<f9b4e896>] usb_serial_driver_exit+0x12/0x77c [metro_usb] Mar 18 21:04:48 hellga kernel: [165282.588205] [<c1094c95>] sys_delete_module+0x135/0x230 Mar 18 21:04:48 hellga kernel: [165282.592442] [<c111af5a>] ? do_munmap+0x16a/0x200 Mar 18 21:04:48 hellga kernel: [165282.596395] [<c15ab91f>] sysenter_do_call+0x12/0x28 Mar 18 21:04:48 hellga kernel: [165282.600704] Code: c6 74 b4 f6 42 fc 01 74 a1 eb ee 90 8d b4 26 00 00 00 00 55 89 e5 83 ec 10 89 5d f4 89 c3 89 75 f8 89 7d fc 8b 30 83 e6 fe 89 f0 <8b> 7e 10 88 55 f0 e8 7d 2a 03 00 0f b6 55 f0 84 d2 74 0b 8b 03 Mar 18 21:04:48 hellga kernel: [165282.608372] EIP: [<c1571a98>] klist_put+0x18/0x80 SS:ESP 0068:eb2afdec Mar 18 21:04:48 hellga kernel: [165282.612956] CR2: 0000000000000010 Mar 18 21:04:49 hellga kernel: [165282.689245] ---[ end trace 073e21f4571f47f3 ]--- -- 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