linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* usb_wwan regression in 3.6 kernel (bisected to bulk-urb allocation)
@ 2014-04-03  6:49 Rafał Miłecki
       [not found] ` <CACna6ry7WCou6kacACpQK6qhWffCGNGFyLQU8H9WbrVDLoB7Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Rafał Miłecki @ 2014-04-03  6:49 UTC (permalink / raw)
  To: Johan Hovold, Greg Kroah-Hartman, Dan Carpenter,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, Matthias Urlichs,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

[-- Attachment #1: Type: text/plain, Size: 955 bytes --]

Hi,

I recently wanted to use my ZTE MF636 modem 19d2:0031 and got NULL
pointer dereference in usb_wwan_write few seconds after plugging it.
This is 100% reproducible.

BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
IP: [<ffffffffa07b9570>] usb_wwan_write+0xa0/0x2b0 [usb_wwan]

I've bisected between 3.4 and 3.14 kernels and it has appeared to be a
regression caused by:

commit 8e493ca1767d4951ed1322abaa74d6edbca29918
Author: Johan Hovold <jhovold-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Fri Oct 26 18:44:20 2012 +0200

    USB: usb_wwan: fix bulk-urb allocation

    Make sure we do not allocate urbs if we do not have a bulk endpoint.

    Legacy code used incorrect assumption to test for bulk endpoints.

Reverting above patch from the 3.14 release fixes the NULL pointer
dereference for me.

Could you look into this, please? I can test any debug/fix patches you provide.

-- 
Rafał

[-- Attachment #2: usb_wwan-bug.txt --]
[-- Type: text/plain, Size: 15886 bytes --]

[   75.242271] usb 2-1.2: new high-speed USB device number 4 using ehci-pci
[   75.330669] usb 2-1.2: New USB device found, idVendor=19d2, idProduct=0031
[   75.330674] usb 2-1.2: New USB device strings: Mfr=2, Product=1, SerialNumber=3
[   75.330676] usb 2-1.2: Product: ZTE CDMA Technologies MSM
[   75.330678] usb 2-1.2: Manufacturer: ZTE, Incorporated
[   75.330680] usb 2-1.2: SerialNumber: 1234567890ABCDEF
[   80.114138] usbcore: registered new interface driver usbserial
[   80.114154] usbcore: registered new interface driver usbserial_generic
[   80.114166] usbserial: USB Serial support registered for generic
[   80.118906] usb-storage 2-1.2:1.2: USB Mass Storage device detected
[   80.119020] scsi6 : usb-storage 2-1.2:1.2
[   80.119108] usbcore: registered new interface driver usb-storage
[   80.170725] usbcore: registered new interface driver option
[   80.170753] usbserial: USB Serial support registered for GSM modem (1-port)
[   80.170906] option 2-1.2:1.0: GSM modem (1-port) converter detected
[   80.170995] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB0
[   80.171023] option 2-1.2:1.1: GSM modem (1-port) converter detected
[   80.171083] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB1
[   80.171117] option 2-1.2:1.3: GSM modem (1-port) converter detected
[   80.171191] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB2
[   80.190796] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.190802] option1 ttyUSB2: usb_wwan_write: endpoint 4 buf 0
[   80.190814] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.190818] option1 ttyUSB2: usb_wwan_write: endpoint 4 buf 1
[   80.190826] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190829] option1 ttyUSB2: usb_wwan_write: endpoint 4 buf 2
[   80.190838] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190843] option1 ttyUSB2: usb_wwan_write: endpoint 4 buf 3
[   80.190851] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190854] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190856] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190859] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190862] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190865] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190868] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190871] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190874] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190877] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190880] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190883] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190885] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190888] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190891] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190894] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190896] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190899] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.190902] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.190905] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.190908] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.190916] option1 ttyUSB2: usb_wwan_write: endpoint 4 buf 0
[   80.190924] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190927] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190930] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190933] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190935] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190938] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190941] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190944] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190947] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190950] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190952] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190955] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190958] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190961] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190963] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190966] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190969] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190972] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190975] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190978] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190981] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190983] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190986] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190989] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190991] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.190994] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.190997] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191000] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191003] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191006] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191009] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191012] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191014] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191017] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191020] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191023] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191025] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191028] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191031] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191034] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191037] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191039] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191042] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191045] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191048] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191051] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191054] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191056] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191059] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191062] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191064] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191067] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191070] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191073] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191076] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191079] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191082] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191084] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191087] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191090] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191093] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191095] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191099] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191101] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191104] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191107] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191109] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191112] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191115] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191118] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191121] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191124] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191127] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191129] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191132] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191135] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191137] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191140] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191143] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191146] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191149] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191151] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191154] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191157] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191165] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191168] option1 ttyUSB2: usb_wwan_write: endpoint 4 buf 1
[   80.191177] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191179] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191182] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191185] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191187] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191190] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191193] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191195] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191198] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191201] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191204] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191207] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191210] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191213] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191216] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191218] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191221] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191223] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191226] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191229] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191232] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191234] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191237] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191240] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191243] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191246] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191248] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191251] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191254] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191256] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191260] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191262] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191265] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191268] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191270] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191273] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191276] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191291] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191298] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191306] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191312] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191319] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191326] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191334] option1 ttyUSB2: usb_wwan_write: write (1 chars)
[   80.191342] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.191350] option1 ttyUSB2: usb_wwan_write: write (2 chars)
[   80.290888] option1 ttyUSB0: usb_wwan_write: write (1 chars)
[   80.290915] BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
[   80.290974] IP: [<ffffffffa07b9570>] usb_wwan_write+0xa0/0x2b0 [usb_wwan]
[   80.291007] PGD 26ebcb067 PUD 26e801067 PMD 0 
[   80.291031] Oops: 0000 [#1] PREEMPT SMP 
[   80.291054] Modules linked in: option usb_wwan usb_storage usbserial ctr ccm rfcomm xt_tcpudp xt_pkttype xt_LOG af_packet xt_limit ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw ipt_REJECT iptable_raw xt_CT iptable_filter ip6table_mangle nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_ipv4 nf_defrag_ipv4 ip_tables xt_conntrack nf_conntrack ip6table_filter bnep ip6_tables x_tables x86_pkg_temp_thermal coretemp kvm_intel kvm snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec_hdmi snd_hda_intel snd_hda_codec arc4 iwldvm crc32c_intel mac80211 ghash_clmulni_intel snd_hwdep aesni_intel snd_pcm iwlwifi ablk_helper btusb cryptd lrw gf128mul bluetooth cfg80211 snd_seq glue_helper uvcvideo videobuf2_core videodev sr_mod cdrom sdhci_pci sdhci joydev serio_raw pcspkr i2c_i801 iTCO_wdt
[   80.291448]  snd_timer snd_seq_device snd videobuf2_vmalloc samsung_laptop videobuf2_memops mmc_core iTCO_vendor_support r8169 mii 6lowpan_iphc aes_x86_64 video rfkill soundcore lpc_ich shpchp battery mfd_core button ac sg dm_mod autofs4 radeon ttm drm_kms_helper drm xhci_hcd i2c_algo_bit thermal fan processor thermal_sys scsi_dh_rdac scsi_dh_emc scsi_dh_hp_sw scsi_dh_alua scsi_dh
[   80.291642] CPU: 0 PID: 710 Comm: ModemManager Not tainted 3.14.0-torvalds+ #57
[   80.291672] Hardware name: SAMSUNG ELECTRONICS CO., LTD. 700G7A/700G7A, BIOS 01FF.M002.20110818.SCY 08/18/2011
[   80.291713] task: ffff88026ebb8210 ti: ffff88026dec0000 task.ti: ffff88026dec0000
[   80.291743] RIP: 0010:[<ffffffffa07b9570>]  [<ffffffffa07b9570>] usb_wwan_write+0xa0/0x2b0 [usb_wwan]
[   80.291782] RSP: 0018:ffff88026dec1d60  EFLAGS: 00010282
[   80.291804] RAX: ffff88026e4056c0 RBX: 0000000000000000 RCX: 0000000000000000
[   80.291832] RDX: ffff88027f40f578 RSI: ffff88026e4056c0 RDI: ffff88027f40d908
[   80.291860] RBP: ffff88026dec1dd0 R08: 000000000000000a R09: 00000000000004c8
[   80.291888] R10: 0000000000000000 R11: ffff88026dec196e R12: 0000000000000001
[   80.291916] R13: ffff88026e405640 R14: ffff880273a8e000 R15: 0000000000000000
[   80.291944] FS:  00007fc45d53e800(0000) GS:ffff88027f400000(0000) knlGS:0000000000000000
[   80.291976] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   80.292000] CR2: 0000000000000058 CR3: 000000027389e000 CR4: 00000000000407f0
[   80.292027] Stack:
[   80.292037]  ffff88026d309000 00007fff560e0a80 ffff88026e4056d0 ffff88026e405640
[   80.292072]  ffff88026f91a400 ffff880272bf4f80 ffff880273a8e2f0 0000000100000019
[   80.292107]  ffff88026e4056c0 ffff88026d309000 ffff880273a8e000 0000000000000001
[   80.292143] Call Trace:
[   80.292158]  [<ffffffffa07ad918>] serial_write+0x48/0xb0 [usbserial]
[   80.292188]  [<ffffffff813abe56>] n_tty_write+0x166/0x4e0
[   80.292214]  [<ffffffff81086150>] ? wake_up_state+0x10/0x10
[   80.292238]  [<ffffffff813a8d08>] tty_write+0x148/0x2a0
[   80.292260]  [<ffffffff813abcf0>] ? process_echoes+0x70/0x70
[   80.292285]  [<ffffffff81194105>] vfs_write+0xb5/0x1e0
[   80.292308]  [<ffffffff81194c21>] SyS_write+0x41/0xb0
[   80.292331]  [<ffffffff811a8a90>] ? SyS_poll+0x60/0xf0
[   80.292356]  [<ffffffff815de666>] system_call_fastpath+0x1a/0x1f
[   80.292381] Code: 05 90 00 00 00 41 89 dc 89 5d cc 48 89 45 a0 4c 89 e8 48 89 75 d0 4d 89 fd 49 89 c7 49 8b 5d 40 48 8b 45 d0 f0 4c 0f ab 38 72 60 <8b> 4b 58 48 8b 7d c0 45 89 f8 48 c7 c2 64 b4 7b a0 48 c7 c6 c3 
[   80.292561] RIP  [<ffffffffa07b9570>] usb_wwan_write+0xa0/0x2b0 [usb_wwan]
[   80.292592]  RSP <ffff88026dec1d60>
[   80.292606] CR2: 0000000000000058
[   80.302499] ---[ end trace fab25c368f672142 ]---
[   81.120808] scsi 6:0:0:0: Direct-Access     ZTE      MMC Storage      322  PQ: 0 ANSI: 2
[   81.121047] sd 6:0:0:0: Attached scsi generic sg3 type 0
[   81.122526] sd 6:0:0:0: [sdc] Attached SCSI removable disk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: usb_wwan regression in 3.6 kernel (bisected to bulk-urb allocation)
       [not found] ` <CACna6ry7WCou6kacACpQK6qhWffCGNGFyLQU8H9WbrVDLoB7Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-04-03  7:18   ` Johan Hovold
  2014-04-03  7:23     ` Rafał Miłecki
  0 siblings, 1 reply; 9+ messages in thread
From: Johan Hovold @ 2014-04-03  7:18 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Johan Hovold, Greg Kroah-Hartman, Dan Carpenter,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, Matthias Urlichs,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Thu, Apr 03, 2014 at 08:49:40AM +0200, Rafał Miłecki wrote:
> I recently wanted to use my ZTE MF636 modem 19d2:0031 and got NULL
> pointer dereference in usb_wwan_write few seconds after plugging it.
> This is 100% reproducible.
> 
> BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
> IP: [<ffffffffa07b9570>] usb_wwan_write+0xa0/0x2b0 [usb_wwan]
> 
> I've bisected between 3.4 and 3.14 kernels and it has appeared to be a
> regression caused by:
> 
> commit 8e493ca1767d4951ed1322abaa74d6edbca29918
> Author: Johan Hovold <jhovold-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Date: Fri Oct 26 18:44:20 2012 +0200
> 
>     USB: usb_wwan: fix bulk-urb allocation
> 
>     Make sure we do not allocate urbs if we do not have a bulk endpoint.
> 
>     Legacy code used incorrect assumption to test for bulk endpoints.
> 
> Reverting above patch from the 3.14 release fixes the NULL pointer
> dereference for me.
> 
> Could you look into this, please? I can test any debug/fix patches you provide.

Thanks for the detailed report. Could you also provide the output of

	lsusb -vd 19d2:0031

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: usb_wwan regression in 3.6 kernel (bisected to bulk-urb allocation)
  2014-04-03  7:18   ` Johan Hovold
@ 2014-04-03  7:23     ` Rafał Miłecki
       [not found]       ` <CACna6rzgnU_=2Gg4v1xk3-KX+zx6G85NksoJiZvbzGyzf+GQ_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Rafał Miłecki @ 2014-04-03  7:23 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Greg Kroah-Hartman, Dan Carpenter, linux-serial, Matthias Urlichs,
	linux-usb@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

2014-04-03 9:18 GMT+02:00 Johan Hovold <jhovold@gmail.com>:
> Thanks for the detailed report. Could you also provide the output of
>
>         lsusb -vd 19d2:0031

Sure, it's attached.

-- 
Rafał

[-- Attachment #2: lsusb-19d2-0031.txt --]
[-- Type: text/plain, Size: 7704 bytes --]


Bus 001 Device 005: ID 19d2:0031 ZTE WCDMA Technologies MSM MF110/MF627/MF636
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x19d2 ZTE WCDMA Technologies MSM
  idProduct          0x0031 MF110/MF627/MF636
  bcdDevice            0.00
  iManufacturer           2 ZTE, Incorporated
  iProduct                1 ZTE CDMA Technologies MSM
  iSerial                 3 1234567890ABCDEF
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          256
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 15 00 01
      ** UNRECOGNIZED:  05 24 06 00 00
      ** UNRECOGNIZED:  15 24 12 20 01 98 b0 6a 49 b0 9e 48 96 94 46 d9 9a 28 ca 4e 5d
      ** UNRECOGNIZED:  06 24 13 00 01 10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 15 00 01
      ** UNRECOGNIZED:  05 24 06 01 01
      ** UNRECOGNIZED:  15 24 12 20 01 98 b0 6a 49 b0 9e 48 96 94 46 d9 9a 28 ca 4e 5d
      ** UNRECOGNIZED:  06 24 13 00 01 10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 01 03 03
      ** UNRECOGNIZED:  05 24 06 03 03
      ** UNRECOGNIZED:  15 24 12 20 01 98 b0 6a 49 b0 9e 48 96 94 46 d9 9a 28 ca 4e 5d
      ** UNRECOGNIZED:  06 24 13 00 01 10
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               5
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: usb_wwan regression in 3.6 kernel (bisected to bulk-urb allocation)
       [not found]       ` <CACna6rzgnU_=2Gg4v1xk3-KX+zx6G85NksoJiZvbzGyzf+GQ_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-04-03  8:03         ` Bjørn Mork
       [not found]           ` <87wqf696wx.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Bjørn Mork @ 2014-04-03  8:03 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Johan Hovold, Greg Kroah-Hartman, Dan Carpenter,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, Matthias Urlichs,
	linux-usb@vger.kernel.org

Rafał Miłecki <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           0
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass    255 Vendor Specific Subclass
>       bInterfaceProtocol    255 Vendor Specific Protocol
>       iInterface              0 
>       ** UNRECOGNIZED:  05 24 00 10 01
>       ** UNRECOGNIZED:  05 24 15 00 01
>       ** UNRECOGNIZED:  05 24 06 00 00
>       ** UNRECOGNIZED:  15 24 12 20 01 98 b0 6a 49 b0 9e 48 96 94 46 d9 9a 28 ca 4e 5d
>       ** UNRECOGNIZED:  06 24 13 00 01 10
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       1
>       bNumEndpoints           2
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass    255 Vendor Specific Subclass
>       bInterfaceProtocol    255 Vendor Specific Protocol
>       iInterface              0 
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0200  1x 512 bytes
>         bInterval              32
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x01  EP 1 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0200  1x 512 bytes
>         bInterval              32
>   


Hmm, AFAICS we never change altsettings in the option/usb_wwan/
usb-serial probing, so this function ends up without any endpoints at all.
As such it should just have failed the probe.  But the option driver has
a static num_ports = 1, which looks like it is overriding the endpoint
based calculation in usb_serial_probe() even for the case where
num_bulk_out == 0.  That cannot be right...

I believe we should both change altsettings and fail if there still
aren't enough endpoints available.


Bjørn
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: usb_wwan regression in 3.6 kernel (bisected to bulk-urb allocation)
       [not found]           ` <87wqf696wx.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
@ 2014-04-03 10:17             ` Johan Hovold
  2014-04-03 11:06               ` [PATCH] USB: usb_wwan: fix handling of missing bulk endpoints Johan Hovold
  0 siblings, 1 reply; 9+ messages in thread
From: Johan Hovold @ 2014-04-03 10:17 UTC (permalink / raw)
  To: Bjørn Mork
  Cc: Rafał Miłecki, Johan Hovold, Greg Kroah-Hartman,
	Dan Carpenter, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	Matthias Urlichs,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Thu, Apr 03, 2014 at 10:03:10AM +0200, Bjørn Mork wrote:
> Rafał Miłecki <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> 
> >     Interface Descriptor:
> >       bLength                 9
> >       bDescriptorType         4
> >       bInterfaceNumber        0
> >       bAlternateSetting       0
> >       bNumEndpoints           0
> >       bInterfaceClass       255 Vendor Specific Class
> >       bInterfaceSubClass    255 Vendor Specific Subclass
> >       bInterfaceProtocol    255 Vendor Specific Protocol
> >       iInterface              0 
> >       ** UNRECOGNIZED:  05 24 00 10 01
> >       ** UNRECOGNIZED:  05 24 15 00 01
> >       ** UNRECOGNIZED:  05 24 06 00 00
> >       ** UNRECOGNIZED:  15 24 12 20 01 98 b0 6a 49 b0 9e 48 96 94 46 d9 9a 28 ca 4e 5d
> >       ** UNRECOGNIZED:  06 24 13 00 01 10
> >     Interface Descriptor:
> >       bLength                 9
> >       bDescriptorType         4
> >       bInterfaceNumber        0
> >       bAlternateSetting       1
> >       bNumEndpoints           2
> >       bInterfaceClass       255 Vendor Specific Class
> >       bInterfaceSubClass    255 Vendor Specific Subclass
> >       bInterfaceProtocol    255 Vendor Specific Protocol
> >       iInterface              0 
> >       Endpoint Descriptor:
> >         bLength                 7
> >         bDescriptorType         5
> >         bEndpointAddress     0x81  EP 1 IN
> >         bmAttributes            2
> >           Transfer Type            Bulk
> >           Synch Type               None
> >           Usage Type               Data
> >         wMaxPacketSize     0x0200  1x 512 bytes
> >         bInterval              32
> >       Endpoint Descriptor:
> >         bLength                 7
> >         bDescriptorType         5
> >         bEndpointAddress     0x01  EP 1 OUT
> >         bmAttributes            2
> >           Transfer Type            Bulk
> >           Synch Type               None
> >           Usage Type               Data
> >         wMaxPacketSize     0x0200  1x 512 bytes
> >         bInterval              32
> >   
> 
> 
> Hmm, AFAICS we never change altsettings in the option/usb_wwan/
> usb-serial probing, so this function ends up without any endpoints at all.
> As such it should just have failed the probe.  But the option driver has
> a static num_ports = 1, which looks like it is overriding the endpoint
> based calculation in usb_serial_probe() even for the case where
> num_bulk_out == 0.  That cannot be right...

You're right. We should probably require both bulk in and out endpoints
in usb_wwan port_probe or return -ENODEV.

The (original option) driver was apparently written under the assumption
that either endpoint could be missing. It would handle opening a device
without bulk-in (but would blow up during resume which was likely
implemented later), but not a missing bulk-out in write() (although it
is handled in some places).

But since it also got the missing-end-point test wrong, this was never
a (critical) issue...

> I believe we should both change altsettings and fail if there still
> aren't enough endpoints available.

The option driver currently does not implement changing altsettings for
any device as you noted. And in fact, this wouldn't even be necessary
for all 19d2:0031. A quick search for lsusb -v output reveals that not
all devices have these altsettings. As we haven't heard of this issue
before, my guess is that the device in question is the odd one.

Would only using interface 3 be sufficient for now? I'd assume so as
this is reported as a regression (which triggers the oops, but the first
two interfaces can obviously never have been used for anything).

I'll cook up a patch for the end-point test during port_probe.

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] USB: usb_wwan: fix handling of missing bulk endpoints
  2014-04-03 10:17             ` Johan Hovold
@ 2014-04-03 11:06               ` Johan Hovold
  2014-04-03 11:32                 ` Rafał Miłecki
  2014-04-03 15:20                 ` Rafał Miłecki
  0 siblings, 2 replies; 9+ messages in thread
From: Johan Hovold @ 2014-04-03 11:06 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-usb, Bjørn Mork, Greg Kroah-Hartman, Dan Carpenter,
	linux-serial, Matthias Urlichs, Johan Hovold, stable

Fix regression introduced by commit 8e493ca1767d ("USB: usb_wwan: fix
bulk-urb allocation") by making sure to require both bulk-in and out
endpoints during port probe.

The original option driver (which usb_wwan is based on) was written
under the assumption that either endpoint could be missing, but
evidently this cannot have been tested properly. Specifically, it would
handle opening a device without bulk-in (but would blow up during resume
which was implemented later), but not a missing bulk-out in write()
(although it is handled in some places such as write_room()).

Fortunately (?), the driver also got the test for missing endpoints
wrong so the urbs were in fact always allocated, although they would be
initialised using the wrong endpoint address (0) and any submission of
such an urb would fail.

The commit mentioned above fixed the test for missing endpoints but
thereby exposed the other bugs which would now generate null-pointer
exceptions rather than failed urb submissions.

The regression was introduced in v3.7, but the offending commit was also
marked for stable.

Reported-by: Rafał Miłecki <zajec5@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
---

Rafał, could you test this patch?

Thanks,
Johan


 drivers/usb/serial/usb_wwan.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index 640fe0173236..b078440e822f 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -466,6 +466,9 @@ int usb_wwan_port_probe(struct usb_serial_port *port)
 	int err;
 	int i;
 
+	if (!port->bulk_in_size || !port->bulk_out_size)
+		return -ENODEV;
+
 	portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
 	if (!portdata)
 		return -ENOMEM;
@@ -473,9 +476,6 @@ int usb_wwan_port_probe(struct usb_serial_port *port)
 	init_usb_anchor(&portdata->delayed);
 
 	for (i = 0; i < N_IN_URB; i++) {
-		if (!port->bulk_in_size)
-			break;
-
 		buffer = (u8 *)__get_free_page(GFP_KERNEL);
 		if (!buffer)
 			goto bail_out_error;
@@ -489,9 +489,6 @@ int usb_wwan_port_probe(struct usb_serial_port *port)
 	}
 
 	for (i = 0; i < N_OUT_URB; i++) {
-		if (!port->bulk_out_size)
-			break;
-
 		buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL);
 		if (!buffer)
 			goto bail_out_error2;
-- 
1.8.3.2

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] USB: usb_wwan: fix handling of missing bulk endpoints
  2014-04-03 11:06               ` [PATCH] USB: usb_wwan: fix handling of missing bulk endpoints Johan Hovold
@ 2014-04-03 11:32                 ` Rafał Miłecki
  2014-04-03 14:21                   ` Johan Hovold
  2014-04-03 15:20                 ` Rafał Miłecki
  1 sibling, 1 reply; 9+ messages in thread
From: Rafał Miłecki @ 2014-04-03 11:32 UTC (permalink / raw)
  To: Johan Hovold
  Cc: linux-usb@vger.kernel.org, Bjørn Mork, Greg Kroah-Hartman,
	Dan Carpenter, linux-serial, Matthias Urlichs, stable

2014-04-03 13:06 GMT+02:00 Johan Hovold <jhovold@gmail.com>:
> Fix regression introduced by commit 8e493ca1767d ("USB: usb_wwan: fix
> bulk-urb allocation") by making sure to require both bulk-in and out
> endpoints during port probe.

Ohh, that was quick! :)

This patch works for me:
[33050.103575] option 1-1.2:1.0: GSM modem (1-port) converter detected
[33050.103617] [usb_wwan_port_probe] bulk_in_size:0 bulk_out_size:0
[33050.103653] option 1-1.2:1.1: GSM modem (1-port) converter detected
[33050.103676] [usb_wwan_port_probe] bulk_in_size:0 bulk_out_size:0
[33050.103712] option 1-1.2:1.3: GSM modem (1-port) converter detected
[33050.103737] [usb_wwan_port_probe] bulk_in_size:512 bulk_out_size:512
[33050.103799] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB2
(out of curiosity I added one pr_info to print sizes).

Thank you!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] USB: usb_wwan: fix handling of missing bulk endpoints
  2014-04-03 11:32                 ` Rafał Miłecki
@ 2014-04-03 14:21                   ` Johan Hovold
  0 siblings, 0 replies; 9+ messages in thread
From: Johan Hovold @ 2014-04-03 14:21 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Johan Hovold, linux-usb@vger.kernel.org, Bjørn Mork,
	Greg Kroah-Hartman, Dan Carpenter, linux-serial, Matthias Urlichs,
	stable

On Thu, Apr 03, 2014 at 01:32:19PM +0200, Rafał Miłecki wrote:
> 2014-04-03 13:06 GMT+02:00 Johan Hovold <jhovold@gmail.com>:
> > Fix regression introduced by commit 8e493ca1767d ("USB: usb_wwan: fix
> > bulk-urb allocation") by making sure to require both bulk-in and out
> > endpoints during port probe.
> 
> Ohh, that was quick! :)
 
:)

> This patch works for me:
> [33050.103575] option 1-1.2:1.0: GSM modem (1-port) converter detected
> [33050.103617] [usb_wwan_port_probe] bulk_in_size:0 bulk_out_size:0
> [33050.103653] option 1-1.2:1.1: GSM modem (1-port) converter detected
> [33050.103676] [usb_wwan_port_probe] bulk_in_size:0 bulk_out_size:0
> [33050.103712] option 1-1.2:1.3: GSM modem (1-port) converter detected
> [33050.103737] [usb_wwan_port_probe] bulk_in_size:512 bulk_out_size:512
> [33050.103799] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB2
> (out of curiosity I added one pr_info to print sizes).
> 
> Thank you!

Thanks for testing. (You can respond to the patch-submission mail with a
Tested-by tag to get some credit for that too.)

As you might have noticed the third interface still shows up as ttyUSB2
as the first two minors will still be allocated for the unusable
interfaces.

Perhaps I should add a usb_wwan_probe (that would have to be called from
every driver relying on usb_wwan) to determine whether the required
endpoints are present before binding to the interface.

But I think the current fix is the right one for stable to fix the
regression.

Johan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] USB: usb_wwan: fix handling of missing bulk endpoints
  2014-04-03 11:06               ` [PATCH] USB: usb_wwan: fix handling of missing bulk endpoints Johan Hovold
  2014-04-03 11:32                 ` Rafał Miłecki
@ 2014-04-03 15:20                 ` Rafał Miłecki
  1 sibling, 0 replies; 9+ messages in thread
From: Rafał Miłecki @ 2014-04-03 15:20 UTC (permalink / raw)
  To: Johan Hovold
  Cc: linux-usb@vger.kernel.org, Bjørn Mork, Greg Kroah-Hartman,
	Dan Carpenter, linux-serial, Matthias Urlichs, stable

2014-04-03 13:06 GMT+02:00 Johan Hovold <jhovold@gmail.com>:
> Fix regression introduced by commit 8e493ca1767d ("USB: usb_wwan: fix
> bulk-urb allocation") by making sure to require both bulk-in and out
> endpoints during port probe.

Tested-by: Rafał Miłecki <zajec5@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-04-03 15:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03  6:49 usb_wwan regression in 3.6 kernel (bisected to bulk-urb allocation) Rafał Miłecki
     [not found] ` <CACna6ry7WCou6kacACpQK6qhWffCGNGFyLQU8H9WbrVDLoB7Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-03  7:18   ` Johan Hovold
2014-04-03  7:23     ` Rafał Miłecki
     [not found]       ` <CACna6rzgnU_=2Gg4v1xk3-KX+zx6G85NksoJiZvbzGyzf+GQ_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-03  8:03         ` Bjørn Mork
     [not found]           ` <87wqf696wx.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2014-04-03 10:17             ` Johan Hovold
2014-04-03 11:06               ` [PATCH] USB: usb_wwan: fix handling of missing bulk endpoints Johan Hovold
2014-04-03 11:32                 ` Rafał Miłecki
2014-04-03 14:21                   ` Johan Hovold
2014-04-03 15:20                 ` Rafał Miłecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).